Skip to content

froggy-reboot/froggy-back

Repository files navigation

실행 방법

docker compose up -d mysql

  1. npm install
  2. npm run migration:run
  3. npm run seed:run
  4. npm run start:dev

db 세팅

현재 entity를 읽어와 이에 해당하는 쿼리 생성해줌 npm run migration:generate -- src/database/migrations/파일이름 npm run migration:generate:dev -- src/database/froggy-dev_migrations/파일이름 npm run migration:generate:live -- src/database/froggy-live_migrations/파일이름

database/migrations/에 있는 쿼리 실행 npm run migration:run:live npm run migration:run:dev

테이블 드랍, 모든 테이블 드랍되니 조심 ! npm run schema:drop

Description

NestJS REST API boilerplate for typical project

Full documentation here

Table of Contents

Features

  • Database (typeorm).
  • Seeding.
  • Config Service (@nestjs/config).
  • Mailing (nodemailer, @nestjs-modules/mailer).
  • Sign in and sign up via email.
  • Social sign in (Apple, Facebook, Google, Twitter).
  • Admin and User roles.
  • I18N (nestjs-i18n).
  • File uploads. Support local and Amazon S3 drivers.
  • Swagger.
  • E2E and units tests.
  • Docker.
  • CI (Github Actions).

Quick run

git clone --depth 1 https://github.com/brocoders/nestjs-boilerplate.git my-app
cd my-app/
docker compose up -d

For check status run

docker compose logs

Comfortable development

git clone --depth 1 https://github.com/brocoders/nestjs-boilerplate.git my-app
cd my-app/

Change DATABASE_HOST=postgres to DATABASE_HOST=localhost

Change MAIL_HOST=maildev to MAIL_HOST=localhost

Run additional container:

docker compose up -d postgres adminer maildev redis
npm install

npm run migration:run

npm run seed:run

npm run start:dev

Links

Automatic update of dependencies

If you want to automatically update dependencies, you can connect Renovate for your project.

Database utils

Generate migration

npm run migration:generate -- src/database/migrations/CreateNameTable

Run migration

npm run migration:run

Revert migration

npm run migration:revert

Drop all tables in database

npm run schema:drop

Run seed

npm run seed:run

Tests

# unit tests
npm run test

# e2e tests
npm run test:e2e

Tests in Docker

docker compose -f docker-compose.ci.yaml --env-file .env -p ci up --build --exit-code-from api && docker compose -p ci rm -svf

Test benchmarking

docker run --rm jordi/ab -n 100 -c 100 -T application/json -H "Authorization: Bearer USER_TOKEN" -v 2 http://<server_ip>:3000/api/v1/users

API DOCS

visit http://localhost:3000/docs

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published