Skip to content

jthanh8144/capstone-project

Repository files navigation

Safe Talk API

Deploy

Install steps

  1. Install dependencies
yarn install --frozen-lockfile
  1. Create .env file
cp example.env .env
  1. Fill config for database, mail service, minIO, Redis and Firebase to .env file.

  2. Build source

yarn build
  1. Run back-end service
yarn start

Prepare

  • Create a .env file from the .env.example file

    cp example.env .env
    

    Fill config for database, mail service, minIO, Redis and Firebase.

  • Install package

    npm ci --frozen-lockfile
    

    or with yarn

    yarn install --frozen-lockfile
    
  • Build source

    npm run build
    

    or with yarn

    yarn build
    

Local (For DEV)

  • Environment

    node v16+
    
  • Docker commands

    • Build & run all container

      docker-compose up --build
      
    • Run all container

      docker-compose up
      
    • Run a container

      docker-compose up <service_name>
      
    • Exec

      docker exec -it <service_name> sh
      

Migration

  • Generate migration file with Windows

    npm run migration:generate-win --name=<file-name>
    

    or with Linux / MacOS

    npm run migration:generate-mac --name=<file-name>
    
  • Running migration

    npm run migration:run
    

    or with yarn

    yarn migration:run
    
  • Revert migration

    npm run migration:revert
    

    or with yarn

    yarn migration:revert
    

Convention

Architect