Segments (1252) Delete Previous Page 13 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) ✎ F115 F115EDS04 - EDO - 6.73426 6.17059 - 6.04258 6.17059 94.31 ✎ F116 F116ENS01 Ukpabi Nimbo ENUGU - 6.71269 6.99242 - 6.78849 7.17224 25.31 ✎ F116 F116ENS02 Owele ENUGU - 6.78849 7.17224 - 6.82983 7.36476 24.95 ✎ F116 F116ENS03 Nsukka ENUGU - 6.82983 7.36476 - 6.85429 7.38264 3.38 ✎ F117 F117OSS01 IKEJI ILE OSUN Default 7.47898 4.90012 Default 7.40112 5.00454 0.00 ✎ F117 F117ONS02 ONDO BRD ONDO Default 7.40112 5.00454 Default 7.46009 5.06456 0.00 ✎ F117 F117EKS03 EKITI BRD EKITI Default 7.46009 5.06456 Default 7.49034 5.23238 0.00 ✎ F117 F117EKS04 ISE EKITI Default 7.49034 5.23238 Default 7.45423 5.43067 0.00 ✎ F117 F117EKS05 ISE EKITI Default 7.45423 5.43067 Default 7.44295 5.59470 0.00 ✎ F117 F117ONS06 ONDO BRD ONDO Default 7.44295 5.59470 Default 7.45616 5.79970 0.00 ✎ F117 F117ONS07 OKIA ONDO Default 7.45616 5.79970 Default 7.45630 5.98360 0.00 ✎ F117 F117EDS08 EKON EDO Default 7.45630 5.98360 Default 7.45295 6.11090 0.00 ✎ F117 F117KGS09 MAGOGO KOGI Default 7.45295 6.11090 Default 7.53414 6.25143 0.00 ✎ F117 F117KGS10 EBIYA KOGI Default 7.53414 6.25143 Default 7.52320 6.46280 0.00 ✎ F117 F117KGS11 ADOGO KOGI Default 7.52320 6.46280 Default 7.46229 6.66670 0.00 ✎ F117 F117KGS12 - KOGI Default 7.46229 6.66670 Default 7.41740 6.86950 0.00 ✎ F117 F117KGS13 ALOGI KOGI Default 7.41740 6.86950 Default 7.37625 7.07710 0.00 ✎ F117 F117KGS14 ADADEJU KOGI Default 7.37625 7.07710 Default 7.23900 7.48480 0.00 ✎ F117 F117KGS15 OGPE KOGI Default 7.23900 7.48480 Default 7.13137 7.63612 0.00 ✎ F117 F117BNS16 BENUE BDR BENUE Default 7.13137 7.63612 Default 7.04680 7.60540 0.00 ✎ F117 F117BNS17 KOGI BDR BENUE Default 7.04680 7.60540 Default 6.98260 7.55380 0.00 ✎ F117 F117ENS18 ENUGU BDR ENUGU Default 6.98260 7.55380 Default 6.86310 7.64590 0.00 ✎ F117 F117ENS19 OKBO ENUGU Default 6.86310 7.64590 Default 6.63633 7.76680 0.00 ✎ F118 F118S01 TEMIDIRE OYO - 8.01213 2.71730 - 7.95807 2.93153 25.00 ✎ F118 F118S02 IWEE-ILE OYO - 7.95807 2.93153 - 7.99945 3.10899 24.84 ✎ F118 F118S03 IGANA OYO - 7.99945 3.10899 - 8.00854 3.31889 25.09 ✎ F118 F118S04 ABULE OJO OYO - 8.00854 3.31889 - 8.00686 3.51103 26.56 ✎ F118 F118S05 ISEYIN OYO - 8.00686 3.51103 - 7.91449 3.70235 25.07 ✎ F118 F118S06 OYO OYO - 7.91449 3.70235 - 7.86197 3.90252 25.46 ✎ F118 F118S07 - OYO - 7.86197 3.90252 - 7.84984 3.90709 3.25 ✎ F118 F118S08 AKAPO OYO - 7.84984 3.90709 - 7.72466 4.06893 25.01 ✎ F118 F118S09 IWO OSUN - 7.72466 4.06893 - 7.48586 4.34595 46.20 ✎ F118-1 F118-1S01 IJEMU OSUN - 7.46777 4.33175 - 7.62569 4.43955 22.04 ✎ F119 F119EKS01 - EKITI Default 7.76851 5.72110 Default 7.71644 5.73746 0.00 ✎ F119 F119ODS02 - ONDO Default 7.71644 5.73746 Default 7.61637 5.89097 0.00 ✎ F119 F119ODS03 - ONDO Default 7.61637 5.89097 Default 7.60832 5.96634 0.00 ✎ F119 F119KOS04 - KOGI Default 7.60832 5.96634 Default 7.61368 6.15651 0.00 ✎ F119 F119KOS05 - KOGI Default 7.61368 6.15651 Default 7.57798 6.21963 0.00 ✎ F119 F119KOS06 - KOGI Default 7.57798 6.21963 Default 7.51882 6.46704 0.00 ✎ F119 F119KOS07 - KOGI Default 7.51882 6.46704 Default 7.45621 6.67084 0.00 ✎ F119 F119KOS08 - KOGI Default 7.45621 6.67084 Default 7.41689 6.87408 0.00 ✎ F119 F119KOS09 - KOGI Default 7.41689 6.87408 Default 7.41557 7.08467 0.00 ✎ F119 F119KOS10 - KOGI Default 7.41557 7.08467 Default 7.49243 7.17100 0.00 ✎ F120 F120BES01 - BENUE Default 6.79829 9.02100 Default 6.68475 9.15566 0.00 ✎ F120 F120CRS02 NeweKwete CROSS RIVER Default 6.68475 9.15566 Default 6.61898 9.33870 0.00 ✎ F120 F120CRS03 Anape II CROSS RIVER Default 6.61898 9.33870 Default 6.45470 9.43384 0.00 ✎ F120 F120CRS04 Obudu Cattle Ranch CROSS RIVER Default 6.45470 9.43384 Default 6.37566 9.37515 0.00 ✎ F121 F121BES01 Gyushage BENUE - 7.72743 8.54666 - 7.74777 8.75546 24.95 ✎ F121 F121S01 Gyushage BENUE Default 7.72743 8.54666 Default 7.74777 8.75546 0.00 ✎ F121 F121BES02 Ortese BENUE - 7.74777 8.75546 - 7.58275 8.87967 24.94 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.