Course monorepo with separate frontend and backend parts.
У поточній версії застосунку реалізовано дві сутності:
Сутність користувачів системи.
Використовується для зберігання інформації про осіб, які можуть подавати заявки на доступ до лабораторії.
Основні поля:
idfullNameemailrolenotes
Основна доменна сутність застосунку — заявки на доступ до лабораторії.
Початково вона розглядалася як сутність із полями Date і Comments, але в реалізації була розширена до більш практичної моделі із часовим інтервалом доступу.
Основні поля:
iduserIdstartDateTimeendDateTimecomments
frontend/— client-side partbackend/— API built with Express and TypeScript
- Node.js (use version from
.nvmrc) - Corepack
- pnpm
From the repository root:
pnpm install
frontend/backend/
Defined in /package.json
Run backend in development mode:
pnpm dev:backend
Build backend:
pnpm build:backend
Run TypeScript type checking for backend:
pnpm type-check:backend
Start compiled backend build:
pnpm start:backend
Check backend code with ESLint:
pnpm lint:check:backend
Fix backend lint issues automatically:
pnpm lint:fix:backend
Check backend formatting with Prettier:
pnpm format:check:backend
Format backend code automatically:
pnpm format:fix:backend
Run frontend in development mode:
pnpm dev:frontend
Build frontend:
pnpm build:frontend
Run TypeScript type checking for frontend:
pnpm type-check:frontend
Start frontend:
pnpm start:frontend
Check frontend code with ESLint:
pnpm lint:check:frontend
Fix frontend lint issues automatically:
pnpm lint:fix:frontend
Check frontend formatting with Prettier:
pnpm format:check:frontend
Format frontend code automatically:
pnpm format:fix:frontend
Базова адреса сервера:
http://localhost:3000
curl -i http://localhost:3000/healthcurl -i "http://localhost:3000/api/users?status=active"curl -i "http://localhost:3000/api/users?status=all"curl -i -X POST http://localhost:3000/api/users \
-H "Content-Type: application/json" \
-d "{\"fullName\":\"Ірина Мельник\",\"email\":\"[email protected]\",\"role\":\"student\",\"notes\":\"Потрібен доступ до лабораторії\"}"curl -i -X POST http://localhost:3000/api/users \
-H "Content-Type: application/json" \
-d "{\"fullName\":\"\",\"email\":\"bad-email\",\"role\":\"\",\"notes\":\"12\"}"curl -i -X PATCH http://localhost:3000/api/users/1 \
-H "Content-Type: application/json" \
-d "{\"notes\":\"Оновлений коментар через PATCH\"}"curl -i -X PATCH http://localhost:3000/api/users/1 \
-H "Content-Type: application/json" \
-d "{\"isDeleted\":true}"curl -i "http://localhost:3000/api/users?status=deleted"curl -i "http://localhost:3000/api/access-requests?status=active"curl -i -X POST http://localhost:3000/api/access-requests \
-H "Content-Type: application/json" \
-d "{\"userId\":2,\"startDateTime\":\"2026-03-20T09:00\",\"endDateTime\":\"2026-03-20T12:00\",\"comments\":\"Практична робота в лабораторії\"}"curl -i -X POST http://localhost:3000/api/access-requests \
-H "Content-Type: application/json" \
-d "{\"userId\":2,\"startDateTime\":\"2026-03-20T09:00\",\"endDateTime\":\"2026-03-20T16:30\",\"comments\":\"Занадто довгий доступ\"}"curl -i -X PATCH http://localhost:3000/api/access-requests/1 \
-H "Content-Type: application/json" \
-d "{\"comments\":\"Оновлена заявка через PATCH\"}"curl -i -X PATCH http://localhost:3000/api/access-requests/1 \
-H "Content-Type: application/json" \
-d "{\"isDeleted\":true}"curl -i "http://localhost:3000/api/access-requests?status=deleted"-
index.ts — тільки запуск
-
app.ts — збирає express-застосунок
-
users.routes.ts — маршрути Users
-
users.store.ts — дані в пам’яті
-
user.validator.ts — нормалізація + валідація
-
paths.ts — шлях до папки frontend
-
not-found.ts — для не-API маршрутів віддає index.html
-
error-handler.ts — єдиний формат помилок
TODO:
- describe full project architecture
- document interaction between frontend and backend
- add setup instructions for each lab stage
- Users, AccessRequests (Date, Comments), Approvals
- Рекомендована ключова сутність AccessRequests
- Рекомендовані поля ключової сутності UserName, Date(input date/datetime), AccessType(select), Comments(textarea), Status(select, по замовчуванню «Pending»)