Skip to content

Tasks

Development

sh
$ pnpm dev

pnpm dev runs Docker Compose, migrates, generates Prisma client code, and finally runs next dev.

Production

sh
# need to boot Database
$ pnpm db:up
$ pnpm build
$ pnpm start

Payment Optional

  1. Create a subscription here and get price_id.

  2. Modify the environment variables. The test API key is here.

STRIPE_SECRET_KEY=
STRIPE_WEBHOOK_SECRET=
STRIPE_PRICE_ID=
  1. Install stripe CLI to bypass the webhook.

  2. Execute the following command in another terminal.

sh
$ stripe listen --forward-to localhost:3000/api/payment/webhook
  1. After signing in, you can go to the http://localhost:3000/me/payment page to see how to make a payment.

Observability Optional

This template uses Jaeger as a tracing platform. The local environment doesn't require TRACE_EXPORTER_URL environment value.

sh
# open Jaeger
$ open http://localhost:16686/

Test

Unit Test

sh
$ pnpm test
$ pnpm test:watch

E2E Test Optional

A build task must be executed before running tests to bypass JWT logic.

sh
# install chrome
$ pnpm exec playwright install chrome
# build using test environments since it needs to change encode/decode functions of next-auth
$ pnpm build:test

$ pnpm test:e2e
# execute with UI
$ pnpm test:e2e:ui

Database

sh
$ pnpm db:up
$ pnpm db:migrate
$ pnpm db:reset
# view the database items
$ pnpm db:studio