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.
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.
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 runyarn migrate:prod
on.env.prod
when releasing.
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`
yarn set version berry
yarn
yarn dlx @yarnpkg/sdks vscode
yarn plugin import typescript
yarn dlx @yarnpkg/sdks vscode
- Useful when prettier extension is not working.