- Node.js - http://nodejs.org/
- Express - http://expressjs.com/
- Mongo DB - https://www.mongodb.com/
- Mongoose - https://mongoosejs.com/
- nodemon - https://www.npmjs.com/package/nodemon
- pm2 - https://www.npmjs.com/package/pm2
- authentication with jwt, login, logout, register, blacklist token, logout jwt
- verifiy route with jwt
- crud example
- error handling
- database use no sql mongodb mongoose
- testing with mocha and chai
- coverage use istanbull
- with docker example
- validiation, use express-valdator
- pagination example
- custom message api response
- eslint airbnb base
- jestjs - https://jestjs.io/
cp .env-sample .env
- via yarn or npm :
# install package
npm install or yarn install
# running app
npm run dev or yarn dev
# running unit tetsing
npm run test or yarn test
- via make :
# start aplication with docker
make docker-start
# stop docker container
make docker-stop
# remove docker container
make docker-down
APP_PORT=2000
TZ=Asia/Jakarta
MONGO_SERVICE=# uri mongodb
AUTH_SOURCE= #auth service
SECRET_KEY= #jwt secret key here
#Mongodb config
MONGO_PORT=27017
MONGO_INITDB_ROOT_USERNAME= #username
MONGO_INITDB_ROOT_PASSWORD= #password
MONGO_INITDB_DATABASE= #db name
docker-compose up --build
docker-compose up --build -d
# install package
docker-compose exec boillerplate npm install
# running unit testing
docker-compose exec boillerplate npm run test
in file documentation.json
export to your postman
.
├── api/ * all api file here
├── config/ * all configuration file here
| └── db.js * configuration database
├── middleware/ * all middleware file here, for check before next to api
├── models/ * all models schema file here
| └── attributes * custom your attribute if line is to long
| └── function * custom function mongose schema
├── routes/ * all file route here
| └── index.js * register all route
├── static/ * all configuration swagger
| └── path * custom your path api
| └── schema * custom schema body
├── test/ * all test file here
| └── index.js * test apps
├── utils/ * all utils file here
| └── crud.js * for basic crud if same
- Guideline:
- Use camelCase for variable name, naming function, load module or other functions
- Use UpperCase for Constant Variable
- Use PascalCase for class name, models, api, route, load module model
- Use snake_case for file name as variable
- Function name use Verb
- Variable name use Noun