This is a backend template using Node.js, Express.js, MongoDB, Mongoose, TypeScript, Zod, and Yarn.
- Node.js
- Yarn
- MongoDB
- Mongoose
- TypeScript
- Zod
Install using npx
- Create a new project using the template:
npx @atik203/node-express-ts-starter my-project
- Clone the repository:
git clone https://github.com/Atik203/Node.js-Express.js-MongoDb-Mongoose-Project-Template.git
- Navigate into the project directory:
cd Node.js-Express.js-MongoDb-Mongoose-Project-Template
- Install the dependencies:
yarn Install
- Set up the MongoDB database URL in the
.envfile, following the format provided in the.env.examplefile.
- Start the application in development mode:
yarn start:dev
- Or, to start the application in production mode:
yarn start:prod
- To build the application:
yarn build
- To lint the code:
yarn lint
- To automatically fix linting errors:
yarn lint:fix
- To format the code with Prettier:
yarn prettier
- To automatically fix formatting errors with Prettier:
yarn prettier:fix
Enjoy using the application!