Monorepo: Express + Prisma + PostgreSQL backend, React (Vite) frontend, JWT auth (Authorization: Bearer).
- Node.js LTS
- PostgreSQL running locally (or Docker) and a database created, e.g.
job_application_tracker
-
Install dependencies (once, from repo root)
npm install
-
Database
Create an empty database (e.g.
job_application_tracker) and setDATABASE_URLinbackend/.env(seebackend/.env.example). -
Backend
cd backend cp .env.example .envEdit
backend/.env:DATABASE_URL— must match your Postgres user, password, host, port, and database name.JWT_SECRET— must be at least 16 characters (the app validates this; short values cause a startup error).PORT— default5000(optional).
Apply the schema and generate the Prisma client:
npx prisma migrate deploy npx prisma generate
For local development you can use
npx prisma migrate devinstead ofdeployif you prefer interactive migrations.Start the API:
npm run dev
Health check:
http://localhost:5000/health
API base:http://localhost:5000/api(or yourPORT). -
Frontend
From repo root, the
frontendworkspace is already installed. Start the UI:cd frontend npm run devIn development, Vite proxies
/apitohttp://localhost:5000, so the defaultVITE_API_URL(/apiin code) works without a.envfile. Optional: createfrontend/.envwithVITE_API_URL=http://localhost:5000/apiif you change ports. -
Run both (from repo root)
npm run dev
This starts the backend and frontend together (requires
concurrentlyfrom the root install).
| Problem | What to do |
|---|---|
npm install fails at repo root |
Ensure both backend/package.json and frontend/package.json exist (monorepo workspaces). Run npm install from the root, not only inside one folder, unless you only need one app. |
Backend exits immediately / Zod error for JWT_SECRET |
Set JWT_SECRET in backend/.env to a string at least 16 characters long. |
P1001 / can't reach database |
Postgres must be running; DATABASE_URL host, port, user, password, and database name must be correct. |
| Prisma / migration errors | From backend, run npx prisma migrate deploy after .env is correct. If the DB is new and empty, this applies the SQL in prisma/migrations. |
| Frontend can’t reach API | Start the backend first. Use the same ports as in vite.config.ts proxy (5000) or set VITE_API_URL to your API base URL. |
IDE errors on @prisma/client |
After changing the schema, run npx prisma generate from backend. |
Response rate = (applications whose status is not Applied) / (total applications). If there are no applications, the rate is 0.
| Method | Path | Auth |
|---|---|---|
| POST | /api/auth/register |
No |
| POST | /api/auth/login |
No |
| GET | /api/auth/me |
Bearer |
| GET | /api/applications |
Bearer |
| POST | /api/applications |
Bearer |
| PATCH | /api/applications/:id |
Bearer |
| DELETE | /api/applications/:id |
Bearer |
| GET | /api/applications/:applicationId/notes |
Bearer |
| POST | /api/applications/:applicationId/notes |
Bearer |
| PATCH | /api/notes/:noteId |
Bearer |
| DELETE | /api/notes/:noteId |
Bearer |
| GET | /api/analytics/summary |
Bearer |