Next.js 16 application for the site, admin dashboard, theme management, visitor analytics, contact messages, authentication, and shop management.
- Next.js 16
- React 19
- Bun
- Prisma
- PostgreSQL
- NextAuth
- HeroUI
- Bun
- Node-compatible environment for Next.js/Bun tooling
- PostgreSQL if running locally without Docker
- Docker Desktop if running the container stack
Use .env.local.
Required values:
NEXTAUTH_SECRET=replace-with-a-long-random-secret
NEXTAUTH_URL=http://localhost:3000
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change-me
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/gabe_website
SESSION_TIMEOUT_MINUTES=480Copy .env.docker.example to .env.docker and set the values there.
Example:
NEXTAUTH_SECRET=replace-with-a-long-random-secret
NEXTAUTH_URL=http://localhost:3000
ADMIN_USERNAME=admin
ADMIN_PASSWORD=change-me
SESSION_TIMEOUT_MINUTES=480
DATABASE_URL=postgresql://postgres:postgres@db:5432/gabe_website
POSTGRES_DB=gabe_website
POSTGRES_USER=postgres
POSTGRES_PASSWORD=postgresInstall dependencies:
bun installGenerate Prisma client:
bunx prisma generatePush the schema to your local database:
bunx prisma db pushStart the dev server:
bun run devOpen:
http://localhost:3000
Build:
bun run buildStart:
bun run startFiles added for the container setup:
- Copy
.env.docker.exampleto.env.docker - Set the secrets and database values
- Run:
docker compose up --buildThis starts:
db: PostgreSQL 16app: the Next.js production server on port3000
URLs:
- App:
http://localhost:3000 - Postgres:
localhost:5432
docker/start.sh:
- waits for the database
- runs
bunx prisma db push - starts
bun run start
This means the schema is applied automatically when the app container boots.
docker compose downdocker compose down -vThat removes the postgres_data volume and resets the database.
Prisma schema:
prisma/schema.prisma
Prisma config:
prisma.config.ts
Useful commands:
bunx prisma generate
bunx prisma db pushAdmin auth uses NextAuth.
Bootstrap admin credentials are created from:
ADMIN_USERNAMEADMIN_PASSWORD
The bootstrap admin is assigned the locked system_administrator role.
bunx tsc --noEmit
bun run lint- Theme changes are stored in Postgres and applied globally through the root layout.
- The Docker stack is intended for running the app and database together with one command.
- If you change Prisma models, rerun
bunx prisma db pushlocally or rebuild the Docker stack.