Skip to content

A simple JWT powered API boiler plate written in NodeJS/Typescript and uses an SQL database for data storage out of the box.

License

Notifications You must be signed in to change notification settings

the-code-genin/Simple-JWT-API

Repository files navigation

Simple JWT API

This is a simple API boilerplate that uses JWT for bearer token authentication. It is written in NodeJS/Typescript and uses MySQL for data storage by default.

The choice of the data storage system can easily be swapped with another SQL/NoSQL database as per project requirements.

The repository can be forked/cloned and used as a bootstrap for API development as all required authentication endpoints and logic have already been implemented.

If you appreciate the project, remember to leave a star! Thank you.

Contributions are always welcomed!

Developed and maintained by Mohammed Adekunle.

Requirements

  • The NodeJS runtime.
  • NPM, Yarn or any similar NodeJS package manager.
  • MySQL or any other supported SQL database.

Features

  • Express as the base requests router.
  • Knex for query builder and migrations.
  • Joi for data validation.
  • Written completely in Typescript.
  • JWT authentication endpoints out of the box for SPAs and mobile apps.
  • Mocha for testing.
  • Twig for view templating.
  • A well defined directory structure.

How To Install

  • Download and place the repository's files in your web server's root directory.
  • Run npm install or yarn install to install the app dependencies.
  • Copy the .env.example file to .env.
  • Update your .env file according to your web server's environment.
  • Run npm run knex migrate:latest to run all migrations.
  • Run npm run dev to fire up the web server.
  • Build something awesome!

Licensing

This project is licensed under the MIT license.