All Reports (22) Delete Upload 🔍 File Name Type Last Updated Uploaded by A1KES31-12 RCA 2 weeks ago Engineer Ridwan Bankole A1KES31-14 RCA 2 weeks ago Engineer Ridwan Bankole A1KES31-14 Physical Inspection 2 weeks ago Engineer Ridwan Bankole A1KES31-15 RCA 2 weeks ago Engineer Ridwan Bankole A1KES31-15 Physical Inspection 2 weeks ago Engineer Ridwan Bankole A1KES40-01 RCA 3 weeks ago Engineer Ridwan Bankole A1KES40-08 RCA 3 weeks ago Engineer Ridwan Bankole A1KES40-12 RCA 3 weeks ago Engineer Ridwan Bankole A1KWS15-01 RCA 3 weeks ago Engineer Ridwan Bankole A1KWS15-02 RCA 3 weeks ago Engineer Ridwan Bankole A1KWS15-13 RCA 1 day ago Engineer Ridwan Bankole A1LAS01-01 RCA 1 day ago Engineer Ridwan Bankole A1LAS01-02 RCA 1 day ago Engineer Ridwan Bankole A1NIS26-01 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-02 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-03 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-04 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-05 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-06 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-11 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-16 RCA 2 weeks ago Engineer Ridwan Bankole A1NIS26-17 RCA 2 weeks ago Engineer Ridwan Bankole Architecture ArchitectureSystem overviewCPMS FERMA is a Django monolith with server-rendered templates, domain APIs, and background workers.Browser -> Nginx -> Gunicorn (Django: roads.wsgi) -> website app (template views) -> all_roads app (domain models + API) -> PostgreSQL -> Redis (Celery broker/result) Celery Worker -> all_roads.tasks.refresh_segments_task -> all_roads.services.refresh_segments_from_google -> Google Distance Matrix API -> PostgreSQL updatesCode boundariesroads/project-level URLssplit settings (settings/base.py, settings/local.py, settings/production.py)WSGI/ASGI and Celery bootstrapwebsite/page-level routes and application workflowsinventory/motorability/condition pagesengineering-admin workflowslibrary pagesall_roads/domain models (Road, Route, Segment, SubSegment, Defect, workflow models)DRF endpoints for segment refresh/statusservices for Google API refreshCelery tasks and management commandsData model map (high-level)Road (1) ----- (N) Route (1) ----- (N) Segment (1) ----- (N) SubSegment | | | +-- start_point/end_point -> Address +-- start_point/end_point -> Address SubSegment (1) ----- (N) Defect Defect (1) ----- (N) RootCauseAnalysis (1) ----- (N) RootCauseDetail Defect (1) ----- (N) PhysicalInspection (1) ----- (N) PhysicalInspectionAnalysis PhysicalInspectionAnalysis (1) ----- (N) PhysicalInspectionCharacteristic Library: document records linked by workflow context (defect/inspection/etc.)Request flow examples1) Road inventory pageGET /road-inventory/ -> website.views.road_inventoryBuilds filter-aware queryset of SegmentComputes KPI metrics and right-panel summary/detail datasetsRenders website/templates/website/road_inventory.htmlTable row click triggers AJAX to /road-inventory/route-details/2) Road condition save-draftUser selects sub-segments and submitsPOST /road-condition/save-draft/Backend creates Defect draft for eligible sub-segments (non-terminal)Returns JSON with created/blocked/not-found counts3) Segment refresh via background jobPOST /api/update-segments/queue/ (optional segment codes)Returns Celery task IDWorker calls Google Distance Matrix APIUpdates Segment fields: distance/travel_time/avg_speed/status/start/end addressSettings architectureSplit settings package is authoritative:roads.settings.baseroads.settings.localroads.settings.productionProduction inserts WhiteNoise middleware and uses manifest static storage.A legacy roads/settings.py exists and should be treated as legacy/backward artifact.Static files architectureApp static source: website/static/website/...Collected static: STATIC_ROOT = BASE_DIR/staticfilesProduction serving path: /static/...Common failure mode: stale app process serving old/empty static artifacts after deployment; restart Gunicorn after collectstatic.Background processingBroker/result backend: Redis (REDIS_URL)Task module: all_roads/tasks.pyCore service implementation: all_roads/services.pyRecommended operation: queue refreshes for long-running updates instead of synchronous endpoint loops.Security posture (production)HTTPS redirect onsecure cookies onHSTS enabledhost allow-list configuredCSRF trusted origins configured for production domainsKnown architectural risksVery large website/views.py (many concerns in one module).Potential confusion from coexistence of split settings package and legacy roads/settings.py file.Requirements file appears incomplete for full reproducible setup. Uploads Download template Select file (.xls, .xlsx, .csv) Begin Upload Uploading, please wait... Upload summary Download error CSV
ArchitectureSystem overviewCPMS FERMA is a Django monolith with server-rendered templates, domain APIs, and background workers.Browser -> Nginx -> Gunicorn (Django: roads.wsgi) -> website app (template views) -> all_roads app (domain models + API) -> PostgreSQL -> Redis (Celery broker/result) Celery Worker -> all_roads.tasks.refresh_segments_task -> all_roads.services.refresh_segments_from_google -> Google Distance Matrix API -> PostgreSQL updatesCode boundariesroads/project-level URLssplit settings (settings/base.py, settings/local.py, settings/production.py)WSGI/ASGI and Celery bootstrapwebsite/page-level routes and application workflowsinventory/motorability/condition pagesengineering-admin workflowslibrary pagesall_roads/domain models (Road, Route, Segment, SubSegment, Defect, workflow models)DRF endpoints for segment refresh/statusservices for Google API refreshCelery tasks and management commandsData model map (high-level)Road (1) ----- (N) Route (1) ----- (N) Segment (1) ----- (N) SubSegment | | | +-- start_point/end_point -> Address +-- start_point/end_point -> Address SubSegment (1) ----- (N) Defect Defect (1) ----- (N) RootCauseAnalysis (1) ----- (N) RootCauseDetail Defect (1) ----- (N) PhysicalInspection (1) ----- (N) PhysicalInspectionAnalysis PhysicalInspectionAnalysis (1) ----- (N) PhysicalInspectionCharacteristic Library: document records linked by workflow context (defect/inspection/etc.)Request flow examples1) Road inventory pageGET /road-inventory/ -> website.views.road_inventoryBuilds filter-aware queryset of SegmentComputes KPI metrics and right-panel summary/detail datasetsRenders website/templates/website/road_inventory.htmlTable row click triggers AJAX to /road-inventory/route-details/2) Road condition save-draftUser selects sub-segments and submitsPOST /road-condition/save-draft/Backend creates Defect draft for eligible sub-segments (non-terminal)Returns JSON with created/blocked/not-found counts3) Segment refresh via background jobPOST /api/update-segments/queue/ (optional segment codes)Returns Celery task IDWorker calls Google Distance Matrix APIUpdates Segment fields: distance/travel_time/avg_speed/status/start/end addressSettings architectureSplit settings package is authoritative:roads.settings.baseroads.settings.localroads.settings.productionProduction inserts WhiteNoise middleware and uses manifest static storage.A legacy roads/settings.py exists and should be treated as legacy/backward artifact.Static files architectureApp static source: website/static/website/...Collected static: STATIC_ROOT = BASE_DIR/staticfilesProduction serving path: /static/...Common failure mode: stale app process serving old/empty static artifacts after deployment; restart Gunicorn after collectstatic.Background processingBroker/result backend: Redis (REDIS_URL)Task module: all_roads/tasks.pyCore service implementation: all_roads/services.pyRecommended operation: queue refreshes for long-running updates instead of synchronous endpoint loops.Security posture (production)HTTPS redirect onsecure cookies onHSTS enabledhost allow-list configuredCSRF trusted origins configured for production domainsKnown architectural risksVery large website/views.py (many concerns in one module).Potential confusion from coexistence of split settings package and legacy roads/settings.py file.Requirements file appears incomplete for full reproducible setup.