This is a template for a Node.js backend application using TypeScript, Express, MongoDB and Restful APIs.
To get started with this project, follow these steps:
- Clone the repository to your local machine.
- Install dependencies by running
npm installoryarn install. - Create a
.envfile based on the provided.env.samplefile. This will contain configuration options for the app. - Start the development server by running
npm run devoryarn dev.
npm run build: Compiles TypeScript code and creates a production build in thedistfolder.npm run start: Starts the app in production mode by running the compiled code from thedistfolder.npm run dev: Starts the app in development mode with auto-reloading enabled.
You can also replace npm with yarn in the above commands if you prefer to use Yarn.
The project is structured as follows:
src/
├── config/ # Contains configs files for .env
├── controllers/ # Contains class-based controller files
├── database/ # Contains Database
| └─ models/ # Contains database model files
├── services/ # Contains functional service files
├── routes/ # Contains route files
└─ database # Contains functional service files
Contributions to this project are welcome. If you find a bug or think of an improvement, feel free to submit a pull request or open an issue.
This project is licensed under the MIT License.