A Node.js with Express.js CRUD apis project with Standard way to use of TypeScript in Node.js.
- Create, Remove/Delete, Update and Listing API's included in it.
- Standard way to use TypeScript added with Node.js.
- Proper setup with watch mode of tsc, nodemon, etc. added. (You can see more in package.json file)
TypeScript is an open-source language maintained and developed by Microsoft. It's loved and used by a lot of software developers around the world.
Basically, it's a superset of JavaScript that adds new capabilities to the language. The most notable addition is static type definitions, something that is not present in plain JavaScript. Thanks to types, it's possible, for example, to declare what kind of arguments we are expecting and what is returned exactly in our functions or what's the exact shape of the object that we are creating. TypeScript is a really powerful tool and opens a new world of possibilities in JavaScript projects. It makes our code more secure and robust by preventing many bugs before the code is even shipped - it catches problems during code development and integrates wonderfully with code editors like Visual Studio Code.
If you found this project useful, then please consider giving it a ⭐️ on Github and sharing it with your friends via social media.
src
└───app.ts # Application entry point
└───routes # Application routes / endpoints
└───controllers # Express route controllers for all the endpoints of the app
└───services # All the database interaction logic is here
└───utils # common code such as constants, helpers, etc.
└───middlewares # express middlewares
└───models # DB Models (MongoDB)
└───validations # API Request object validations
inside "/dist" directory your JS app will exported which is our distribution directory
Feel free to reach out to me through @sanjaykumarwebs if you have any questions or feedback!