How oucmaroua-max/sonatrch-maintenance works
Sonatrach Maintenance is a maintenance-work-order management application. Users authenticate, create and assign work within their organizational scope, track progress, and submit completed work for supervisory feedback; administrators manage users, organization structure, and interim assignments. The React SPA calls an Express REST API backed by PostgreSQL/Drizzle. The README documents the overall client/API/database boundary and major features; source excerpts confirm route dispatch, work-scope handling, notification calls, and schema setup. Some frontend-to-API and controller-to-storage details are not shown, so those links are omitted.
Main entry points: app.ts Express API · App.tsx Page routing · work.controller.ts Work-order handling · client.ts Drizzle database client
Components 19
Web application
- React SPA
Sonatrach-bolt-main/src/main.tsx - Page routing
Sonatrach-bolt-main/src/App.tsx - Work-order screens
Sonatrach-bolt-main/src/pages/WorkOrdersPage.tsx - Dashboard
Sonatrach-bolt-main/src/pages/DashboardPage.tsx - Personal profile
Sonatrach-bolt-main/src/pages/ProfilePage.tsx - Admin screens
Sonatrach-bolt-main/src/pages/admin/AdminUsersPage.tsx
Backend API
- Express API
Backend/src/app.ts - Authentication
Backend/src/controllers/auth.controller.ts
Work and delegation
- Work-order handling
Backend/src/controllers/work.controller.ts - Interim handling
Backend/src/controllers/interim.controller.ts - Notifications
Backend/src/controllers/notification.controller.ts
Administration
- User administration
Backend/src/controllers/user.controller.ts - Organization management
Backend/src/controllers/org.controller.ts
Persistence and scope
- Organizational scope
Backend/src/utils/orgScope.ts - Interim effective scope
Backend/src/utils/effectiveScope.ts - Drizzle database client
Backend/src/db/client.ts - Domain schema
Backend/src/db/schema.ts
Other components
- Maintenance user
- PostgreSQL
Connections 24
- Maintenance user → React SPA: uses
- React SPA → Page routing: renders
Sonatrach-bolt-main/src/main.tsx - Page routing → Work-order screens: routes
Sonatrach-bolt-main/src/App.tsx - Page routing → Dashboard: routes
Sonatrach-bolt-main/src/App.tsx - Page routing → Personal profile: routes
Sonatrach-bolt-main/src/App.tsx - Page routing → Admin screens: routes
Sonatrach-bolt-main/src/App.tsx - React SPA → Express API: calls REST API
- Express API → Authentication: routes authentication
Backend/src/app.ts - Express API → Work-order handling: routes work orders
Backend/src/app.ts - Express API → Interim handling: routes interim requests
Backend/src/app.ts - Express API → Notifications: routes notifications
Backend/src/app.ts - Express API → User administration: routes user management
Backend/src/app.ts - Express API → Organization management: routes organization
Backend/src/app.ts - Work-order handling → Organizational scope: checks visibility
Backend/src/controllers/work.controller.ts - Work-order handling → Interim effective scope: resolves acting scope
Backend/src/controllers/work.controller.ts - Interim handling → Interim effective scope: resolves acting scope
Backend/src/controllers/interim.controller.ts - Work-order handling → Notifications: sends assignment updates
Backend/src/controllers/work.controller.ts - Interim handling → Notifications: sends interim updates
Backend/src/controllers/interim.controller.ts - User administration → Notifications: sends admin alerts
Backend/src/controllers/user.controller.ts - Drizzle database client → Domain schema: configures Drizzle
Backend/src/db/client.ts - Work-order handling → Drizzle database client: queries work data
Backend/src/controllers/work.controller.ts - Organizational scope → Drizzle database client: queries organization
Backend/src/utils/orgScope.ts - Interim effective scope → Drizzle database client: reads interim scope
Backend/src/utils/effectiveScope.ts - Drizzle database client → PostgreSQL: persists data