Trend in One API 서버

0. Information

0-1. API Documents

스크린샷 2023-03-31 오후 11 45 06

0-2. Maintainers

0-3. Technical Specs

  • Node.js 16 (with Yarn)
  • Nest.js 9

1. Prerequisites

1-1. Setup Environment Variables

Copy example environment variables.

$ cp .env.example .env

Change values below accordingly.

# Application
APP_URL=localhost:13000
APP_PORT=13000
APP_SECRET=xxxxxxxxxx

# Database
DB_HOST=xxxxxxxxxx
DB_PORT=15432
DB_DATABASE=xxxxxxxxxx
DB_USERNAME=xxxxxxxxxx
DB_PASSWORD=xxxxxxxxxx

1-2. Install Dependencies

This project uses yarn as a package manager.

$ yarn

2. Run Project

2-1. Run Server

You can start development server with this command.

$ yarn start:dev

2-2. Migrate Database

The migrations will run automatically when the server is started. When it doesn't work, you can migrate manually with this command.

$ yarn migration:run

2-3. Generate New Migration

$ yarn migration:generate src/migrations/{migration_name}

Examples of Migration names

  • create_users_table
  • add_social_vendor_id_to_users_table
  • drop_password_from_users_table