A fullβstack platform for refining large-language models in primary-care diagnostics using expert feedback. Licensed clinicians review patient vignettes (real vs. synthetic) to train and evaluate AI, with a responsive Next.js frontend and an Express + TypeScript backend.
Note
This project is currently in development and not yet deployed!
/
βββ backend/ # Express API (TypeScript + TypeORM)
β βββ src/
β β βββ controllers/ # Route handlers (Auth, Users, Cases, Assignments, Responses)
β β βββ entities/ # TypeORM entities (User, Case, Assignment, UserResponse)
β β βββ middlewares/ # Auth, error handling, etc.
β β βββ routes/ # Express routers
β β βββ utils/ # S3 upload, CSV export, JWT, etc.
β β βββ index.ts # App initialization
β β βββ data-source.ts # TypeORM datasource
β βββ scripts/ # Seed scripts, assignment helpers
β βββ swagger/ # SwaggerβJSDoc decorators
β βββ tsconfig.json
β βββ package.json
βββ frontend/ # Next.js UI (TypeScript + TailwindCSS + shadcn/ui)
β βββ public/ # Static assets (logo, default avatar, etc.)
β βββ src/
β β βββ components/ # Layout, UI primitives
β β βββ hooks/ # Authentication & data hooks
β β βββ lib/ # Axios API client
β β βββ pages/ # Next.js pages (login, signup, profile, FAQ, case review)
β βββ tailwind.config.js
β βββ tsconfig.json
β βββ package.json
βββ README.md # <-- you are here
βββ package.json # Root scripts & formatting
- Node.js β₯ 18
- PostgreSQL database up and running
- If you don't have PostgreSQL installed, go to PostgreSQL Downloads and follow the instructions for your OS.
- AWS S3 bucket for avatar storage
NEXT_PUBLIC_API_URLpointing to backend (e.g.http://localhost:5001/api)
cd backend
cp .env.example .env
# Edit .env:
# - DB_HOST, DB_PORT, DB_USER, DB_PASS, DB_NAME, DB_SSL
# - JWT_SECRET, JWT_EXPIRES
# - AWS_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, S3_BUCKET
npm install
npm run typeorm migration:run # if using migrations
npm run seed:cases # optional: preβpopulate cases
npm run dev # starts on localhost:5001- Swagger UI available at
http://localhost:5001/docs - Raw OpenAPI JSON:
http://localhost:5001/api-docs.json
cd frontend
cp .env.local.example .env.local
# Set NEXT_PUBLIC_API_URL=http://localhost:5001/api
npm install --legacy-peer-deps # IMPORTANT: Shadcn UI requires this
npm run dev # starts on localhost:3000- Visit
http://localhost:3000β youβll be redirected to the Swagger docs. - After login, the βCase Reviewβ deck appears.
| Command | Description |
|---|---|
npm run dev |
Run in dev mode with automatic reload (ts-node-dev) |
npm run start |
Run production (ts-node) |
npm run build |
Compile TS to dist/ |
npm run typeorm |
Direct TypeORM CLI commands |
npm run seed:cases |
Seed database with synthetic cases |
npm run assign:user |
Manually assign cases to a given user |
| Command | Description |
|---|---|
npm run dev |
Next.js dev server (Turbopack) |
npm run build |
Build for production |
npm run start |
Start built app |
npm run lint |
ESLint & Prettier check |
| Command | Description |
|---|---|
npm run lint |
Prettier formatting |
| Name | Purpose |
|---|---|
| Backend | |
PORT |
Server port (default 5001) |
DB_HOST β¦ DB_NAME |
PostgreSQL connection |
DB_SSL |
true/false SSL mode |
JWT_SECRET, JWT_EXPIRES |
Auth token secrets |
AWS_REGION, β¦ S3_BUCKET |
S3 credentials & bucket for avatars |
| Frontend | |
NEXT_PUBLIC_API_URL |
e.g. http://localhost:5001/api |
-
Auth
POST /api/auth/signupPOST /api/auth/loginPOST /api/auth/logoutPOST /api/auth/verify-emailPOST /api/auth/reset-password
-
Users
GET /api/users/mePUT /api/users/mePOST /api/users/me/avatarDELETE /api/users/me/avatar
-
Cases
POST /api/cases/upload(CSV)GET /api/casesGET /api/cases/export
-
Assignments
GET /api/assignments(admin)GET /api/assignments/mePOST /api/assignments
-
Responses
POST /api/responsesGET /api/responses/me
Full schemas and examples are in Swagger UI.
- Express + TypeScript for backend, with TypeORM for data modeling and migrations.
- Next.js for frontend, leveraging shadcn/ui, Radix, and TailwindCSS for a consistent, responsive design.
- Framer-Motion for smooth page/card animations.
- Sonner for toast notifications.
- AWS S3 for storing user avatars.
- CSV import/export for bulk case management.
- Fork & clone.
npm installin both/backendand/frontend.- Implement feature or fix bug.
- Add/update tests (Jest in backend; Cypress or React Testing Library in frontend).
- Submit PR with descriptive title and changelog.
MIT License Β© UNC DHEP Lab. See LICENSE for more details.
