A monorepo training project for building an internal task/ticket tracker.
- Monorepo: npm workspaces
- Database: PostgreSQL (Docker) + Prisma ORM
- Backend: NestJS
- Frontend: Next.js (App Router) + TailwindCSS
- Auth: Better-Auth
# 1. Fork this repo on GitHub, then clone your fork
git clone https://github.com/<your-username>/inter-se-training.git
# 2. Add the original repo as upstream
git remote add upstream https://github.com/SolveServeSolution/inter-se-training.git
# 3. Install dependencies
npm install
# 4. Copy environment variables
cp .env.example .env
# 5. Start PostgreSQL
docker compose up -d
# 6. Push database schema (creates tables)
npm run db:push
# 7. Start the API (port 4000)
npm run dev:api
# 8. Start the web app (port 3000) — in a separate terminal
npm run dev:web- Frontend: http://localhost:3000
- API: http://localhost:4000
├── docker-compose.yml # PostgreSQL service
├── packages/
│ └── database/ # Prisma schema + client (Better-Auth models)
└── apps/
├── api/ # NestJS backend (port 4000)
│ └── src/
│ ├── prisma/ # PrismaService (DB connection)
│ └── task/ # Task module (STUBBED — see below)
└── web/ # Next.js frontend (port 3000)
└── src/
├── app/
│ ├── login/ # Sign in / sign up page (working)
│ └── tasks/ # Task board (STUBBED — see below)
├── components/ # Navbar with login/logout
└── lib/ # Better-Auth server & client config
- Docker Compose with PostgreSQL
- Prisma schema with Better-Auth models (
User,Session,Account,Verification) - NestJS API with CORS, PrismaService, and a global PrismaModule
- Next.js with Better-Auth email/password sign-in and sign-up
- Navbar with session-aware login/logout button
-
Add a
Taskmodel topackages/database/prisma/schema.prisma(e.g.,id,title,description,status,userId, timestamps). Then runnpm run db:push. -
POST /tasks(apps/api/src/task/task.controller.ts:18) — Extracttitleanddescriptionfrom the request body, use Prisma to save a new task. Currently returns501 Not Implemented. -
GET /tasks(apps/api/src/task/task.controller.ts:14) — Fetch and return tasks from the database. Currently returns an empty array[]. -
PATCH /tasks/:id/status(apps/api/src/task/task.controller.ts:24) — Find a task by ID and update its status (e.g.,OPEN→CLOSED). Currently returns501 Not Implemented.
-
Task Board UI (
apps/web/src/app/tasks/page.tsx) — Build a task list, a form to create tasks, and a button to close tasks. Fetch data fromhttp://localhost:4000/tasks. -
Route protection —
/tasksis intentionally left unprotected. Add a Better-Auth session check to redirect unauthenticated users to/login.
| Command | Description |
|---|---|
npm run db:push |
Push Prisma schema to database |
npm run db:studio |
Open Prisma Studio (database GUI) |
npm run dev:api |
Start NestJS in watch mode |
npm run dev:web |
Start Next.js dev server |