First, copy .env.template
to .env
and fill in the required environment variables.
Second, make sure that Docker is installed as this service require database to run locally. To start the database run:
docker compose -f ./docker/docker-compose.dev.yaml up
You can enter pgadmin via http://localhost:5050 with the following credentials (see docker-compose.dev.yaml)
email: [email protected]
password: root
Then go to register page
- Go to
Connection
page and add- hostname: pd_db
- username: admin
- password: root
- Click Save
- Connect to db
After finishing development, you can stop the database by running:
docker compose -f ./docker/docker-compose.dev.yaml down
bunx prisma generate
bunx prisma migrate dev
bunx tsx ./prisma/seed.ts
Note: You can also run bunx prisma studio
to open the Prisma Studio to see the database.
Note2: prisma migrate dev
can reset the database, so be careful when running this command.
bun install
bun run dev
Open http://localhost:3000/ with your browser to see the result.
docker compose -f ./docker/docker-compose.dev.yaml down
docker volume rm lg24-passport-backend_pg-data lg24-passport-backend_pgadmin-data
docker compose -f ./docker/docker-compose.dev.yaml up -d