Koa, Mongoose, JWT Auth Example fork from Koa Boilerplate
This is one of many build of Koa + Mongoose + Passport.js + ES7. Thx a lot to [@Jeffijoe] and his Koa Boilerplate
# Clone repository.
git clone git@github.com:ZabedovskiyA/koa-mongoose-jwt-auth-boilerplate.git new-project
# Go to project folder.
cd new-project
# Install dependencies
yarn
# Run in development mode
yarn dev
Server will starts at http://localhost:5000/
- In `src/config` create file
config.js
- Add your database name in
dbName
- Database user in
dbUser
- Database password in
dbPass
- Database host in
dbHost
- Database port in
dbPort
There are a few defined run scripts, here's a list of them with a description of what they do. To run them, simply execute npm run <script name>
- e.g. npm run dev
start
: Used by the production environment to start the app. This will run a compiled version, so you need to executebuild
first.build
: Runs thebabel
CLI to compile the app. Files are emitted todist/
.dev
: Runs the app in development mode - usesbabel-node
to compile on-the-fly. Also usesnodemon
to automatically restart when stuff changes.test
: Runs tests.cover
: Runs tests and collects coverage.lint
: Lints + formats the code.
Tip: to pass additional arguments to the actual CLI's being called, do it like in this example:
For npm:
# Note the `--` before the actual arguments.
npm run test -- --debug
For yarn:
# Yarn does not need the `--` before the actual arguments.
yarn test --debug
For running dev:
# Note: use --build only when you want to build. Usually when you change packages.json
docker-compose up --build
Add socket.io support
Add migrations
Add logging
MIT.