4-life / backend-ts

The example of simple user auth API. Stack: Express, Sequelize, Typescript, Mocha

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The example of simple user auth API build status

The codebase consists of a basic NodeJS project with simple Sequelize models, Express.js routes, and integration tests.

A db connection to a local SQLite storage is already setup and all required tables (Users and Contacts), mapping the sequelize models, are in place.

The list of API routes

Tests

The Auth tests check endpoints for user sign-up and login, including verifying that protected routes are not accessible without authentication. The CRUD tests are independent from the Auth tests. They verify CRUD operations on the Contacts table.

Test results

Pre-requisites

  • Node
  • Yarn

Setup

Install the dependencies.

yarn

Run

Run the NodeJs backend locally.

yarn dev

Test

Execute the tests

yarn test
yarn unit-test

About

The example of simple user auth API. Stack: Express, Sequelize, Typescript, Mocha


Languages

Language:TypeScript 87.8%Language:JavaScript 12.2%