Web & Mobile Template

  • Client: NextJS
  • Serevr: NestJS
  • Mobile: React Native

TODO: https://www.tomray.dev/nestjs-caching-redis


Environment Variables

cd into ./server folder and copy environment variables from .env.example to .env file:

cd ./server && cp .env.example .env

Add values to empty environment variables in the ./server/.env file:

POSTGRES_DB=
POSTGRES_USER=
POSTGRES_PASSWORD=

Docker

To build and run the application with Docker run the command below in the root folder.

docker-compose up --build

Once the application is built, run the command below in the root folder without the --build flag to start the application.

docker-compose up

Migrations & Prisma Studio

Prisma Migration and Prisma Studio introspection with Docker.

  1. Run migration in Docker server shell terminal:
npx prisma migrate dev --name {add/change/delete}-{title}-{row/table}
  1. Restart prisma-studio Docker container by running the command below in the root folder:
docker-compose restart prisma-studio
  1. Run regeneration of Prisma Client in the server directory
npx prisma generate

Seed the database

npx prisma db seed