This is a Next.js project bootstrapped with create-next-app.
Requirements
- Docker & Docker Compose
- PowerShell (commands below use PowerShell syntax)
Quick start:
# Run all services, install dependencies and apply migrations
docker compose up --buildOpen http://localhost:3000 to see the results.
Services one by one start:
- Apply migrations (one-off):
# Run the migrate service: installs dependencies and runs 'npx prisma migrate deploy'
docker compose -f .\docker-compose.yml run --rm migrate- Start the app and database in the background:
docker compose -f .\docker-compose.yml up -d- Tail app logs:
docker compose -f .\docker-compose.yml logs --follow --tail 200 appUseful commands
# Check service status
docker compose -f .\docker-compose.yml ps
# Run migrate manually (one-off / CI)
docker compose -f .\docker-compose.yml run --rm migrate
# List tables in the Postgres database
docker compose -f .\docker-compose.yml exec postgres psql -U admin -d boardsy -c "\dt"
# Stop and remove containers and volumes (including node_modules volume)
docker compose -f .\docker-compose.yml down --volumesWhy there is a migrate service?
- The
migrateservice is a one-off container that installs project dependencies and runsnpx prisma migrate deployagainst the database running in Compose. This avoids running migrations manually on the host. - After migrations finish, the
migratecontainer exits. This is expected.
About node_modules and Windows
- We use a named Docker volume for
node_modulesto avoid common Windows <-> container filesystem issues (for example,ENOTEMPTYerrors duringnpm install). If something goes wrong, you can remove the volume withdocker compose down --volumesand restart.
Troubleshooting (common issues)
- Can't reach database (
P1001/ "Can't reach database server at localhost:5432"): make sure services use the internal Compose hostnamepostgres. The compose file in this repo setsLOCAL_DATABASE_URLforappandmigrateto use thepostgresservice. ENOTEMPTYduringnpm installin the container: handled by using a namednode_modulesvolume. If it persists, remove that volume and retry.
Open http://localhost:3000 to see the results.
src/
├─ app/
│ ├─ layout.tsx # Root layout (header, footer, metadata)
│ ├─ page.tsx # Landing page
│ ├─ (sign)/ # Routes for user authentication
│ │ ├─ signin
│ │ └─ signup
│ └─ dashboard # Main dashboard - allows viewing and managing boards
│ └─ profile # Page for managing user's profile
│
├─ server/
│ ├─ actions/ # React server actions for retrieving and managing data
│ │ ├─ sign.ts # Sign up, sign in and sign out
│ │ ├─ user.ts # Managing user's profile
│ │ └─ board.ts # Creating, retrieving, updating and deleting user's boards
│ ├─ auth.ts # Session and cookie helpers
│ ├─ dal.ts # Data access layer abstractions
│ ├─ db.ts # Prisma client initialization
│ └─ utils.ts # Miscellaneous server utilities
│
└─ types/
└─ global.d.ts # Global type declarations