- Install node modules
npm install
with pnpm
pnpm i
- Create an .env file and set the next variables:
- DB_USER="USERNAME" (default: postgres)
- DB_NAME="YOUR_DB_NAME"
- DB_PASSWORD="YOUR_DB_PASSWORD"
NOTE: You can copy and rename the template
.env.template
->.env
-
Setup prisma DATABASE_URL in your .env file:
DATABASE_URL="postgresql://user:password@localhost:5432/db-name?schema=public"
-
Run the Docker compose command to create the postgres database
docker compose up -d
- Run prisma dev migration
npx prisma migrate dev
- Run seed script (this will add some products to the DB)
npm run seed
- Run the development server:
npm run dev
Open http://localhost:3000 with your browser to see the result.