Skip to content

Latest commit

 

History

History
65 lines (41 loc) · 1.77 KB

CONTRIBUTING.md

File metadata and controls

65 lines (41 loc) · 1.77 KB

Contributing

Concise overview

In this template, we use Next.js version 13 or higher, as it supports React Server Components. The project relies on Prisma for the ORM, and it's crucial to be aware that Prisma does not provide connection pooling by default. This requires extra steps when deploying on Vercel.

Consequently, the main emphasis of the current project is on deploying as a standalone server, utilizing a Docker image to achieve this goal.

Installation

1. Prepare Database

Run yarn migrate:dev to you local database then when every is done right, you can then run yarn migrate:prod to update production database.

2. Copy environment variables

cp .env.sample .env.local

Check the environment variables stated in Environment variables and replace to your own.

We recommend to have 2 environments as shown below.

  • .env.local
  • .env.prod

Try running yarn migrate:dev database to .env.local then run yarn migrate:prod on .env.prod when releasing.

Environment variables

NEXT_PUBLIC_ROOT_URL

Base url of your web app.

JWT_SECRET

Used in server-side when you want to encode & decode data when communicating with client.

DATABASE_URL

Database connection url to access database.

Copy sample from .env.sample.

cp `.env.sample` `.env.local`

Tips

When using yarn berry and TS fails after upgrading packages, try to follow below steps.

  1. yarn set version berry
  2. yarn
  3. yarn dlx @yarnpkg/sdks vscode
  4. yarn plugin import typescript
  5. yarn dlx @yarnpkg/sdks vscode
    • Useful when prettier extension is not working.