Segments (1252) Delete Previous Page 15 of 26 Next All roads A F None All routes A1 A10 A11 A12 A121 A122 A123 A124 A125 A126 A13 A14 A2 A231 A232 A233 A234 A235 A236 A237 A3 A3-1 A342 A343 A344 A345 A4 A4-1 A4-2 A4-4 A4-5 A4-6 A4-7 A5 A5-1 A6 A7 A8 A8 (1) A9 E1 F100 F101 F101-1 F102 F103 F103-1 F104 F105 F106 F107 F108 F109 F110 F111 F112 F113 F114 F115 F116 F117 F118 F118-1 F119 F120 F121 F122 F123 F124 F124-1 F125 F126 F127 F128 F128-1 F128-2 F128-3 F129 F130 F131 F132 F133 F135 F136 F137 F138 F139 F200 F201 F202 F203 F204 F205 F206 F207 F208 F209 F210 F211 F212 F213 F214 F215 F216 F217 F218 F219 F220 F221 F222 F223 F224 F225 F226 F227 F228 F229 F230 F231 F232 F233 F234 F235 F236 F237 F238 F239 F240 F242 F243 F244 F245 F246 F247 F248 F249 F250 F251 F252 F252-1 F253 F254 F255 F255-1 F256 F257 F258 F259 F260 F261 Select state Abia Adamawa Akwa Ibom Anambra Bauchi Bayelsa Benue Borno Cross River Delta Ebonyi Edo Ekiti FCT Gombe Imo Jigawa Kaduna Kano Katsina Kebbi Kogi Kwara Lagos Nasarawa Niger Ogun Ondo Osun Oyo Plateau Rivers Sokoto Taraba Yobe Zamfara ☰ Route Segment code Name State Start name Northings Eastings End name Northings 2 Eastings 2 Distance(km) ✎ F124-1 FI24-1NGS04 - NIGER Default 8.74333 5.81319 Default 8.91092 5.88322 0.00 ✎ F124-1 FI24-1NGS05 - NIGER Default 8.91092 5.88322 Default 9.08501 6.03111 0.00 ✎ F125 F125NAS01 - NASARAWA Default 8.49902 8.51726 Default 8.53644 8.72209 0.00 ✎ F125 F125PLS01 Kurum PLATEAU Default 8.87826 9.54114 Default 9.05264 9.65652 0.00 ✎ F125 F125NAS02 - NASARAWA Default 8.53644 8.72209 Default 8.62313 8.95088 0.00 ✎ F125 F125PLS02 Langtang PLATEAU Default 9.05264 9.65652 Default 9.14121 9.81836 0.00 ✎ F125 F125PLS03 - PLATEAU Default 8.62313 8.95088 Default 8.70845 9.15923 0.00 ✎ F125 F125PLS04 - PLATEAU Default 8.70845 9.15923 Default 8.78132 9.31149 0.00 ✎ F125 F125PLS05 - PLATEAU Default 8.78132 9.31149 Default 8.87826 9.54114 0.00 ✎ F125 F125PLS06 Kurum PLATEAU Default 8.87826 9.54114 Default 9.05263 9.65651 0.00 ✎ F125 F125PLS07 Langtang PLATEAU Default 9.05263 9.65651 Default 9.14120 9.81835 0.00 ✎ F125 F125TAS07 Zurak TARABA Default 9.23976 10.58631 Default 9.23671 10.79814 0.00 ✎ F125 F125PLS08 Wase PLATEAU Default 9.14120 9.81835 Default 9.11724 9.97849 0.00 ✎ F125 F125TAS08 Materum TARABA Default 9.23671 10.79814 Default 9.30117 10.98934 0.00 ✎ F125 F125PLS09 Yola PLATEAU Default 9.11724 9.97849 Default 9.27319 10.12550 0.00 ✎ F125 F125TAS09 Mutum Daya TARABA Default 9.30117 10.98934 Default 9.36739 11.07205 0.00 ✎ F125 F125PLS10 Bashar PLATEAU Default 9.27319 10.12550 Default 9.28302 10.31642 0.00 ✎ F125 F125PLS11 Zok PLATEAU Default 9.28302 10.31640 Default 9.23976 10.58631 0.00 ✎ F125 F125TAS14 Mutum Daya TARABA Default 9.30117 10.98934 Default 9.36739 11.07200 0.00 ✎ F126 F126NIS01 ZUNGERU NIGER - 9.81138 6.16069 - 9.63478 6.28373 24.97 ✎ F126 F126NIS02 JIGBEJI NIGER - 9.63478 6.28373 - 9.67809 6.49246 25.08 ✎ F126 F126NIS03 MINNA NIGER - 9.67809 6.49246 - 9.50300 6.60765 26.70 ✎ F126 F126NIS04 PENWETA NIGER - 9.50300 6.60765 - 9.39332 6.78196 24.97 ✎ F126 F126NIS05 TUNGAN KUKA NIGER - 9.39332 6.78196 - 9.36490 6.99460 24.97 ✎ F126 F126NIS06 1ZOM NIGER - 9.36490 6.99460 - 9.27886 6.99364 10.04 ✎ F127 FI27KAS01 - KADUNA Default 9.58440 8.37170 Default 9.65339 8.57602 0.00 ✎ F127 FI27PLS02 - PLATEAU Default 9.65339 8.57602 Default 9.69845 8.72039 0.00 ✎ F127 FI27PLS03 - PLATEAU Default 9.69845 8.72039 Default 9.76905 8.86004 0.00 ✎ F128 F128NIS01 SAMUNAKA NIGER Default 10.32101 4.25909 Default 10.50740 4.34921 0.00 ✎ F128 F128NIS02 TUGAN BAKERE NIGER Default 10.50740 4.34921 Default 10.67733 4.43284 0.00 ✎ F128 F128NIS03 AGWARRA NIGER Default 10.67733 4.43284 Default 10.72365 4.63997 0.00 ✎ F128 F128NIS04 - NIGER Default 10.72365 4.63997 Default 10.71214 4.69562 0.00 ✎ F128 F128KES05 BIN YAURI KEBBI Default 10.71214 4.69562 Default 10.79438 4.81542 0.00 ✎ F128 F128KES06 GWANDA KEBBI Default 10.79438 4.81542 Default 10.89993 5.01014 0.00 ✎ F128 F128KES07 - KEBBI Default 10.89993 5.01014 Default 10.97053 5.07375 0.00 ✎ F128 F128NIS08 - NIGER Default 10.97053 5.07375 Default 11.09074 5.24749 0.00 ✎ F128 F128NIS09 - NIGER Default 11.09074 5.24749 Default 11.18787 5.38752 0.00 ✎ F128 F128KES10 MARAFAN SAKABA KEBBI Default 11.18787 5.38752 Default 11.31951 5.48109 0.00 ✎ F128 F128KES11 RIBAH KEBBI Default 11.31951 5.48109 Default 11.33991 5.60816 0.00 ✎ F128 F128KES12 WASAGA KEBBI Default 11.33991 5.60816 Default 11.36484 5.82991 0.00 ✎ F128 F128SZA12 MAI MARAHU ZAMFARA Default 11.45625 6.01543 Default 11.57050 6.07404 0.00 ✎ F128 F128KES13 BENA KEBBI Default 11.36484 5.82991 Default 11.37262 5.98353 0.00 ✎ F128 F128ZAS13 DAN GULBI ZAMFARA Default 11.57050 6.07404 Default 11.66179 6.25401 0.00 ✎ F128 F128KES14 - KEBBI Default 11.37262 5.98353 Default 11.45625 6.01543 0.00 ✎ F128 F128ZAS14 GOBIRAWA ZAMFARA Default 11.66179 6.25401 Default 11.70124 6.45459 0.00 ✎ F128 F128ZAS15 MAGAMI ZAMFARA Default 11.70124 6.45459 Default 11.71920 6.67074 0.00 ✎ F128 F128ZAS16 KONKOMBA ZAMFARA Default 11.71920 6.67074 Default 11.76256 6.86553 0.00 ✎ F128 F128ZAS17 - ZAMFARA Default 11.76256 6.86553 Default 11.82919 7.01837 0.00 ✎ F128 F128KTS18 DAN BAWO KATSINA Default 11.82919 7.01837 Default 11.82684 7.32319 0.00 ✎ F128 F128KTS19 KANKARA KATSINA Default 11.82684 7.32319 Default 11.92800 7.49357 0.00 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.