|-- migrations # Database migration dir
|-- tests # All unit and integration test files goes here
|-- .husky # Husky hooks for git pre-commits for lint check
|-- src
| index.js # App entry point
| app.js # Load express application modules
|-- config # Environment variables and configuration related stuff
|-- constants # App constants
|-- controllers # Express route controllers
|-- interfaces # TypeScript interfaces
|-- middlewares # Express middlewares
|-- models # Mongoose models
|-- routes # Express routes
|-- services # Service modules
|-- startup # Split the startup process into modules
|-- types # Shared TypeScript types
|-- utils # Shared utilities modules
- NodeJS >= 12.x
- Yarn >= 1.x
- MongoDB >= 4.2
First of all, you need to check if you're using the required versions of Node.js and npm
Then, please follow the instructions below:
$ git clone https://github.com/yatri-motorcycles/nodejs-starter.git
$ cd nodejs-starter
Install dependencies:
$ yarn install
Set environment variables:
$ cp .env.example .env
Import sample documents
$ yarn seed:import
$ yarn dev
In the project directory, you can run:
# lint code with ESLint
$ yarn lint
# try to fix ESLint errors
$ yarn lint:fix
# run all tests with Mocha
$ yarn test
# run lint and tests
$ yarn validate
$ yarn debug
$ yarn seed:import
$ yarn seed:delete
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes.
© Yatri Motorcycles. All rights reserved.