How ytkaaaaaaaaa/iw3 works
This is a workforce-dispatch application for managing companies, workers, vacancies, schedules, attendance reports, travel, and external data synchronization. The principal workflow is dispatcher login, loading scoped workforce data into workspace views, editing vacancy staffing schedules, and persisting those changes through authenticated APIs. The graph includes the key domain stages and sync/travel capabilities documented by the source index and tree. Most route and view implementations were not sampled, so their connections are included only where source-index references or excerpts support them.
Main entry points: app Workspace pages · sync/route.ts Sync API · schedule/route.ts Schedule API · guard.ts Session guard
Components 26
Dispatcher workspace
- Login UI
app/login/login-form.tsx - App shell
components/app-shell.tsx - Workspace pages
app
Workforce operations
- Company management
components/companies-view.tsx - People management
components/people/people-view.tsx - Vacancy management
components/vacancies/vacancies-view.tsx - Schedule workspace
components/vacancy-schedule.tsx - Schedule API
app/api/vacancies/[slug]/schedule/route.ts - Hours and reports
components/hours/hours-view.tsx - Map workspace
components/map-view.tsx - People search
components/search-dialog.tsx - Sync controls
components/sync-view.tsx - Report endpoints
app/api/vacancies/[slug]/reports/route.ts
Application services
- Session guard
lib/auth/guard.ts - Workforce context
components/workforce-data-context.tsx - Page data loader
lib/db/page-data.ts - Workforce queries
lib/db/workforce.ts - PostgreSQL
lib/db/index.ts - Schedule persistence
lib/schedule-persistence.ts - Staffing calculations
lib/derive.ts
Data integrations
- Sync API
app/api/sync/route.ts - Warehouse sync
lib/sync/supabase-warehouse.ts - Flexpedia sync
lib/sync/flexpedia-sync.ts - Travel distances
lib/travel/services.ts - Geocoding API
app/api/geocode/route.ts
Other components
- Dispatcher
Connections 29
- Dispatcher → Login UI: signs in
- Login UI → Session guard: starts session
app/login/login-form.tsx - Dispatcher → Workspace pages: uses workspace
app/companies/page.tsx - Workspace pages → Session guard: checks session
app/companies/page.tsx - Workspace pages → Page data loader: loads data
app/companies/page.tsx - Page data loader → Workforce queries: loads workforce
lib/db/page-data.ts - Workforce queries → PostgreSQL: queries
- Workspace pages → Workforce context: provides data
app/companies/page.tsx - Workspace pages → App shell: renders shell
- Workspace pages → Company management: renders view
app/companies/page.tsx - Workspace pages → People management: renders view
app/people/page.tsx - Workspace pages → Vacancy management: renders view
app/vacancies/page.tsx - Workspace pages → Schedule workspace: renders schedule
- Schedule workspace → Schedule API: saves schedule
- Schedule API → Session guard: checks session
app/api/vacancies/[slug]/schedule/route.ts - Schedule API → Schedule persistence: parses snapshot
app/api/vacancies/[slug]/schedule/route.ts - Schedule API → PostgreSQL: reads and writes
app/api/vacancies/[slug]/schedule/route.ts - Schedule workspace → Staffing calculations: calculates staffing
- Workspace pages → Hours and reports: renders view
app/hours/page.tsx - Workspace pages → Map workspace: renders workspace
- App shell → People search: opens search
components/app-shell.tsx - Workspace pages → Sync controls: renders view
app/sync/page.tsx - Sync controls → Sync API: requests sync
- Sync API → Session guard: checks session
app/api/sync/route.ts - Sync API → Warehouse sync: runs warehouse sync
app/api/sync/route.ts - Sync API → Flexpedia sync: runs employee sync
app/api/sync/route.ts - Sync API → Travel distances: refreshes distances
app/api/sync/route.ts - Map workspace → Geocoding API: looks up addresses
- Hours and reports → Report endpoints: submits reports