An easy start restapi nodejs project boilerplate for development, in module architecture with airbnb coding standerd & all latest stable packages with es6 code format.
Start coding fast with stright forwarded application flow and build in user & authentication modules, with integration & unit test & apidoc rest api documentation.
You can clone & follow the below sections to make it use of your own.
Make sure you have installed all of the following prerequisites on your development machine:
Some popular dependencies used to build the boileplate.
Dependency | Description |
---|---|
express | Minimalist web framework |
mongoose | MongoDB ODM |
bluebird | Fully featured promise library |
commander | Nodejs cli solution |
passport | Authentication library for nodejs |
moment | Parse, validate, manipulate date |
joi | Object schema validation |
pug | HTML template language |
lodash | Utility library |
nodemailer | Mailer package |
onesignal-node | Push notification |
textlocal | SMS package |
morgan | HTTP request logger |
winston | Nodejs logger pakage |
Some popular dev dependencies
Dependency | Description |
---|---|
eslint | Pattern checker for JS |
nodemon | Montior script runner for nodejs |
apidoc | Resful api documentation |
mocha | Test framework |
chai | Assertion library for nodejs |
supertest | Test HTTP servers |
sinon | JS test spies, stub & mocks |
coveralls | Test runner report |
faker | Generate fake data |
Some optional packages to install globally in your dev machine.
Dependency | Installation |
---|---|
EsLint | yarn global add eslint |
Nodemon | yarn global add nodemon |
- Clone the repository from github as your project name
git clone https://github.com/focus-io/node-es6-restapi-boilerplate.git project-name
cd project-name
- Install dependent packages
yarn install
- Create environment file
mv .env.example .env
- Change your application name & database name from .env
vi .env
- Run the project
yarn start
- Application will start in port 3000 by default url
- To create user
yarn scripts user create
- Generate api docs by running
yarn docs
- Test lint by
yarn lint
- Lint fixes
yarn lint:fix
- Unit Test
yarn test:unit
- Integration Test
yarn test:integration
- Test
yarn test
- Test Coverage
yarn coverage
YTC
We welcome any contribution you make contributors guidelines.
We use SemVer for versioning. For the versions available, see the versions on this repository.
This project is licensed under the MIT License - see the LICENSE.md file for details
Inspirations
- Unit Test
- Test System module
- Seeder
- S3 for user image
- CI/CD
- Docker
- Build