Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/yeukfei02/ecommerce-api-sequelize

ecommerce-api-sequelize
https://github.com/yeukfei02/ecommerce-api-sequelize

docker nestjs nodejs postgres sequelize typescript

Last synced: 5 days ago
JSON representation

ecommerce-api-sequelize

Awesome Lists containing this project

README

        

# ecommerce-api-sequelize

ecommerce-api-sequelize

documentation:

## Requirement

- install yarn
- install node (v16+)

## Testing and run

```zsh
// test api in local
$ yarn run start:dev

// run in production
$ yarn run start:prod

// lint code
$ yarn run lint

// format code
$ yarn run format

// run test case
$ yarn run test

// create module
$ nest g module

// create controller
$ nest g controller

// create service
$ nest g service

// create migration file
$ npx sequelize-cli model:generate --name --attributes

// run db migration
$ yarn run db:migrate

// undo db migration
$ yarn run db:migrate:undo

// check migrations status
$ yarn run db:migrate:status

// create seed file
$ npx sequelize-cli seed:generate --name

// seed data to database
$ yarn run db:seed
```

## Docker

```zsh
// build images and start container in one line
docker-compose up -d --build

// go inside container
docker exec -it /bin/bash

// check container logs
docker logs

// remove and stop container
docker-compose down
```

open localhost:3000