Skip to content

tier-one/be-fikia

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fikia Backend API

CI

Description

This is the Fikia Backend API.

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/
cp env-example .env
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/
cp env-example .env

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
yarn install

# create api database in local postgres
create database api;


yarn run migration:run

yarn run seed:run

yarn 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

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

Run migration

yarn run migration:run

Revert migration

yarn run migration:revert

Drop all tables in database

yarn run schema:drop

Run seed

yarn run seed:run

Tests

# unit tests
yarn run test

# e2e tests
yarn run test:e2e

Tests in Docker

docker compose -f docker-compose.ci.yaml --env-file env-example -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