This is a Usefulness API, using :
- expressjs
- JWT with passportjs so you can change strategies easily.
- sequelizejs to manage DBs (Postgres per example)
A starter project is a basic project with some vital features:
- Database access
- User connexion
- Docker ready
- Set development environement (travis, code-coverage)
More informations on Usefulness API project.
Current coded stories or next todos
- As an User, I want to sign-in
- As an User, I want to sign-out (and blacklist authToken)
- As an User, I want to be automatically reconnected (using refresh Token)
- node8
- yarn (or npm)
- Docker (if using Docker)
NODE_ENV=development
DATABASE_URL=postgres://localhost:5432/my-app
SECRET=YourSecretToken
TOKEN_EXPIRATION=10m
REFRESH_TOKEN_EXPIRATION=2d
# Yarn install
yarn install
yarn run start
# Or using Npm :
npm install
npm start
# Yarn install
yarn install
# Or using Npm :
npm install
# Database migration
node_modules/.bin/sequelize db:migrate
# In production mode
yarn run start
# In developement mode (this does the migrations)
yarn run start-dev
You should have docker installed on your dev environement.
docker-compose build
docker-compose up
Using coveralls.io, create a file named .coveralls.yml
with your repo_token
service_name: travis-pro
repo_token: yourRepoToken
List of useful urls
/auth/sign-in
sign-in using username and password/auth/token
refresh the auth token using the refresh token/auth/reject
reject the refresh token for the user/me
user profile page
Don't hesitate to submit issues, comments and pull request. This has been developped in TDD.
- Blacklist refresh tokens
- Register user
- Add some seeds (to generate users for example)