Skip to content

dev-yann/mamimomo-api

Repository files navigation

Description

App running with Nest framework TypeScript starter repository.

Installation

$ yarn

This project use private package with verdaccio (.npmrc_config and .yarnrc_config). If you want to install this project, please let me know at [email protected].

Running the app

Start container :

docker-compose up -d

then :

# development  
$ yarn start  
  
# watch mode  
$ yarn start:dev  
  
# production mode  
$ yarn start:prod  

Migration

Mamimomo database is create on the first docker-compose execution. You do not need to create db.

To start with a good database you can run this :

yarn typeorm migration:run

If you need to generate a new migration after entity change you can run :

yarn typeorm migration:generate -n <migration-name>

If you need to revert the last migration :

yarn typeorm migration:revert

You can check what does this command in your package.json. You can discover more command with yarn typeorm

⚠️ You need to build ts to js before the migration. yarn build️ then you can run yarn migration:run

Seed

After migration you can create some fake data to start developing :

yarn seed:run

⚠️ You need to build ts to js before the seed. If you need to write some seeders :

The idea was that the seeds should be isolated and run one use case like createAdminUserWithPets.seed.ts. With that we do not need any ordering.

Connection and JWT

Authentication system works with JWT. We using passport.js to handle authentication.

  • Request control is handle by passport jwt strategy.
  • Simple connection is handle by passport localstrategy. (provide jwt with email and password)

Test

# unit tests  
$ npm run test  
  
# e2e tests  
$ npm run test:e2e  
  
# test coverage  
$ npm run test:cov  

Swagger

Find swagger-ui on http://localhost:8080/api/

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages