Skip to content

remithomas/usefulness-api-expressjs

Repository files navigation

Usefulness API ExpressJs

Build Status Coverage Status

This is a Usefulness API, using :

What's a starter project

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.

User stories

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)

Requirements

  • node8
  • yarn (or npm)
  • Docker (if using Docker)

Environements variables

NODE_ENV=development
DATABASE_URL=postgres://localhost:5432/my-app
SECRET=YourSecretToken
TOKEN_EXPIRATION=10m
REFRESH_TOKEN_EXPIRATION=2d

Starting App

Without Migrations

# Yarn install
yarn install
yarn run start

# Or using Npm :
npm install
npm start

With Migrations

# 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

With docker

You should have docker installed on your dev environement.

docker-compose build
docker-compose up

Code coverage

Using coveralls.io, create a file named .coveralls.yml with your repo_token

service_name: travis-pro
repo_token: yourRepoToken

Urls

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

Contributions

Don't hesitate to submit issues, comments and pull request. This has been developped in TDD.

ToDos / Plans

  • Blacklist refresh tokens
  • Register user
  • Add some seeds (to generate users for example)

About

An Usefulness API using expressJs, Sequelize and more...

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published