How mrtikky/-grilaati works
Grila ATI is a multi-tenant monthly scheduling application for ICU/anesthesia teams. The main workflow is editing staff schedules in a monthly grid, saving and retrieving schedule data through APIs, then creating an archived server-side snapshot for PDF export and later regeneration. The README also documents leave balances, staff management, archive browsing and configurable exports; the tree and source index show supporting settings, workspace, membership and proposal features. Some UI-to-API links are documented only at a product level, so uncertain connections are omitted.
Main entry points: db.ts Neon Postgres · ScheduleGrid.tsx Monthly schedule grid · luna/route.ts Monthly schedule API · programari/route.ts Schedule entry API
Components 30
Scheduling
- Monthly schedule grid
src/components/schedule/ScheduleGrid.tsx - Monthly schedule API
src/app/api/luna/route.ts - Schedule entry API
src/app/api/programari/route.ts - Staff API
src/app/api/angajati/route.ts - Leave balances API
src/app/api/concedii/route.ts - Categories
src/lib/categorii.ts - Schedule codes
src/lib/coduri.ts - Schedule sheets
src/lib/foi.ts
Identity & workspaces
- Login page
src/app/login/page.tsx - Session auth
src/lib/auth.ts - API access guard
src/lib/apiGuard.ts - Workspace API
src/app/api/workspaces/route.ts - Workspace access
src/lib/workspace.ts
Configuration
- Settings pages
src/app/setari/page.tsx - Category settings API
src/app/api/setari/categorii/route.ts - Code settings API
src/app/api/setari/coduri/route.ts - PDF template settings
src/app/api/setari/export-pdf/route.ts - PDF template logic
src/lib/pdfTemplate.ts
Archive & exports
- Snapshot API
src/app/api/grafice/route.ts - Snapshot builder
src/lib/buildGraficSnapshot.ts - Archive item API
src/app/api/grafice/[id]/route.ts - Schedule history
src/app/istoric/page.tsx - PDF renderer
src/components/pdf/GraficAtiPdfTemplated.tsx - Excel export
src/components/export/exportGraficExcel.ts
Supporting features
- Audit log
src/lib/audit.ts - Developer proposals
src/app/api/propuneri/route.ts - Account management
src/app/api/conturi/me/route.ts - Workspace invitations
src/app/api/setari/membri/invitatii/route.ts
Other components
- Team member
- Neon Postgres
src/lib/db.ts
Connections 29
- Team member → Monthly schedule grid: edits schedule
src/components/schedule/ScheduleGrid.tsx - Monthly schedule grid → Monthly schedule API: loads month
- Monthly schedule grid → Schedule entry API: saves entries
- Monthly schedule API → Neon Postgres: reads schedule
src/app/api/luna/route.ts - Schedule entry API → Neon Postgres: writes entries
src/app/api/programari/route.ts - Monthly schedule API → Categories: loads categories
src/app/api/luna/route.ts - Monthly schedule API → Schedule sheets: loads sheets
src/app/api/luna/route.ts - Schedule entry API → Schedule codes: uses codes
src/app/api/programari/route.ts - Team member → Login page: signs in
README.md - Login page → Session auth: authenticates
- API access guard → Session auth: checks session
src/lib/apiGuard.ts - API access guard → Workspace access: resolves access
src/lib/apiGuard.ts - Workspace API → Workspace access: manages selection
src/app/api/workspaces/route.ts - Settings pages → Category settings API: configures categories
- Settings pages → Code settings API: configures codes
- Category settings API → Categories: updates categories
src/app/api/setari/categorii/route.ts - Code settings API → Schedule codes: updates codes
src/app/api/setari/coduri/route.ts - PDF template settings → PDF template logic: saves template
src/app/api/setari/export-pdf/route.ts - Monthly schedule grid → Snapshot API: requests PDF snapshot
README.md - Snapshot API → Snapshot builder: builds snapshot
src/app/api/grafice/route.ts - Snapshot API → Neon Postgres: stores archive
src/app/api/grafice/route.ts - Schedule history → Archive item API: views archive
- Schedule history → PDF renderer: regenerates PDF
README.md - Monthly schedule grid → Excel export: exports workbook
src/components/schedule/ScheduleGrid.tsx - PDF renderer → PDF template logic: uses template
src/components/pdf/GraficAtiPdfTemplated.tsx - Audit log → Neon Postgres: writes audit
src/lib/audit.ts - Developer proposals → Neon Postgres: stores proposals
src/app/api/propuneri/route.ts - Account management → Neon Postgres: manages accounts
src/app/api/conturi/me/route.ts - Workspace invitations → Neon Postgres: manages invitations