eduahcb / api_jwt

A REST API with JWT

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

API JWT

API to learn some techs

Project   |    Techs   |    How to use   |   

CircleCI

Codecov

Code Climate maintainability

Project

Preview

Structure

  ├── .circleci
  ├── build 
  ├── coverage
  ├── src
│   ├── components
│   │   ├── login
│   │   ├── logout
│   │   └── user
│   ├── config
│   │   ├── constants
│   │   └── redis
│   ├── database
│   │   └── migrations
│   ├── environments
│   ├── exceptions
│   ├── handlers
│   ├── helpers
│   ├── middlewares
│   └── utils
  • .circleci: CI configuration

  • build: the build files

  • coverage: test coverage

  • src: application source

  • src/components: the project separates by components each component has its route, controller, test and others in the same directory

  • src/config: application config (redis, database, etc)

  • src/database: the migrations files

  • src/environments: the variable settings for each environment (development, test, production)

  • src/exceptions: the application custom exceptions

  • src/handlers: handlers files

  • src/helpers: files with some methods to help

  • src/middlewares: application middlewares

  • src/utils: utility functions or class

Techs

How to Use

Clone the repository

 git clone https://github.com/eduahcb/api_jwt.git

 cd api_jwt

Install Dependencies

 
  yarn install

Run development mode

Before you run this command you need to create a .env file like .env.example. You can choose the connection (mysql, postgres, mssql), host, etc, then you need to run the migrations:

  yarn typeorm migration:run
 yarn dev

Run with docker

docker-compose up -d

BaseUrl Ports and API documentation

  baseUrl: "/api/v1"
  
  port: "localhost:8080"
  
  api documentation: "/api/v1/doc"

Tests

 yarn test

Coverage

 yarn cov

Build

  yarn build

About

A REST API with JWT


Languages

Language:TypeScript 97.5%Language:Dockerfile 2.1%Language:Shell 0.4%