Segments (1122) Delete Previous Page 7 of 23 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) ✎ A3 A3BES15 OTO BENUE - 7.14632 7.69472 - 7.14601 7.91230 25.05 ✎ A3 A3BES16 Otukpo BENUE - 7.14601 7.91230 - 7.21033 8.11962 25.43 ✎ A3 A3BES17 Makurdi - Otupko Rd BENUE - 7.21033 8.11962 - 7.27249 8.29944 25.28 ✎ A3 A3BES18 Makurdi-Aliade Rd BENUE - 7.27249 8.29944 - 7.32114 8.50253 25.00 ✎ A3 A3BES19 Makurdi-Aliade Rd, BENUE - 7.32114 8.50253 - 7.49052 8.60281 24.99 ✎ A3 A3BES20 Victor Malu Road BENUE - 7.49052 8.60281 - 7.69338 8.53521 24.96 ✎ A3 A3BES21 Unende BENUE - 7.69338 8.53521 - 7.90865 8.58860 26.73 ✎ A3 A3BES22 Makurdi-Lafia Rd, BENUE - 7.90865 8.58860 - 8.11376 8.58782 33.51 ✎ A3 A3NAS23 kubeli NASARAWA - 8.11376 8.58782 - 8.32174 8.56312 36.75 ✎ A3 A3NAS24 Lafia-Agwatashi-Rd NASARAWA - 8.32174 8.56312 - 8.48729 8.52683 25.24 ✎ A3 A3NAS25 Asough NASARAWA - 8.48729 8.52683 - 8.69189 8.55068 25.62 ✎ A3 A3NAS26 Lafia road NASARAWA - 8.69189 8.55068 - 8.83175 8.45493 31.98 ✎ A3 A3NAS27 Lafia road NASARAWA - 8.83175 8.45493 - 8.93584 8.53117 24.93 ✎ A3 A3NAS28 wana NASARAWA - 8.93584 8.53117 - 9.04386 8.54992 24.99 ✎ A3 A3KDS29 wana KADUNA - 9.04386 8.54992 - 9.20743 8.48591 25.00 ✎ A3 A3KDS30 BARIMAW KADUNA - 9.20067 8.48569 - 9.36175 8.57332 25.81 ✎ A3 A3KDS31 wate KADUNA - 9.36175 8.57332 - 9.51111 8.60434 24.96 ✎ A3 A3PLS32 ungwan mada PLATEAU - 9.51111 8.60434 - 9.64169 8.76822 25.00 ✎ A3 A3LSS33 Jenta PLETEAU - 9.64169 8.76822 - 9.80494 8.86243 24.98 ✎ A3 A3PLS34 Hoss PLATEAU - 9.80494 8.86243 - 10.00416 8.91097 25.04 ✎ A3 A3BAS35 udu BAUCHI - 10.00416 8.91097 - 10.06660 9.12376 25.03 ✎ A3 A3BAS36 Barakin BAUCHI - 10.06660 9.12376 - 10.17084 9.31837 25.03 ✎ A3 A3BAS37 Jos - Bauchi Rd, BAUCHI - 10.17084 9.31837 - 10.22437 9.52378 25.01 ✎ A3 A3BAS38 Narabi BAUCHI - 10.22437 9.52378 - 10.22434 9.73089 36.86 ✎ A3 A3BAS39 - BAUCHI - 10.22434 9.73089 - 10.37809 9.92572 29.82 ✎ A3 A3BAS40 Stumi hill BAUCHI - 10.37809 9.92572 - 10.52696 10.08935 25.20 ✎ A3 A3BAS41 wom BAUCHI - 10.52696 10.08935 - 10.69440 10.22178 24.98 ✎ A3 A3BAS42 Tsada hill BAUCHI - 10.69440 10.22178 - 10.87017 10.36539 25.73 ✎ A3 A3BAS43 bauchi road BAUCHI - 10.87017 10.36539 - 11.08279 10.43254 25.10 ✎ A3 A3BAS44 bauchi road BAUCHI - 11.08279 10.43254 - 11.26055 10.57620 25.87 ✎ A3 A3BAS45 Reri BAUCHI - 11.26055 10.57620 - 11.39080 10.75670 24.87 ✎ A3 A3BAS46 wailo BAUCHI - 11.39080 10.75670 - 11.48767 10.95770 25.03 ✎ A3 A3YBS47 Madadiwa YOBE - 11.48767 10.95770 - 11.68945 11.05047 25.03 ✎ A3 A3YBS48 Gunduri YOBE - 11.68945 11.05047 - 11.66557 11.26930 27.68 ✎ A3 A3YBS49 yubunga YOBE - 11.66557 11.26930 - 11.66333 11.49605 24.98 ✎ A3 A3YBS50 Lanpo YOBE - 11.66333 11.49605 - 11.70056 11.72049 25.00 ✎ A3 A3YBS51 Auta YOBE - 11.70056 11.72049 - 11.73815 11.94668 25.03 ✎ A3 A3YBS52 Gishwa YOBE - 11.73815 11.94668 - 11.73282 12.16849 25.68 ✎ A3 A3BOS53 Ngarbia BORNO - 11.73282 12.16849 - 11.77840 12.38975 24.98 ✎ A3 A3BOS54 Kudyare BORNO - 11.77840 12.38975 - 11.82862 12.61144 24.97 ✎ A3 A3BOS55 Damaturu rd BORNO - 11.82862 12.61144 - 11.84967 12.83747 25.04 ✎ A3 A3YBS56 Maiduguri Rd YOBE - 11.84967 12.83747 - 11.84969 12.83751 0.01 ✎ A3 A3BOS57 Fadili Borno - 11.84969 12.83751 - 11.84299 13.06549 25.03 ✎ A3 A3BOS58 Maiduguri-Mafa Rd, Borno - 11.84299 13.06549 - 11.87726 13.28136 25.04 ✎ A3 A3BOS59 Malasiri Borno - 11.87726 13.28136 - 11.89294 13.50619 24.96 ✎ A3 A3BOS60 Maiduguri-Dikwa Rd Borno - 11.89294 13.50619 - 11.97476 13.71837 25.03 ✎ A3 A3BOS61 mai-meleri Borno - 11.97476 13.71837 - 12.04833 13.92894 24.97 ✎ A3 A3BOS62 Gambaru-Dikwa Rd, Borno - 12.04833 13.92894 - 12.23112 14.04692 25.02 ✎ A3 A3BOS63 jidari Borno - 12.23112 14.04692 - 12.33640 14.16961 18.05 ✎ A3 A3BOS64 Ngala Borno - 12.33640 14.16961 - 12.36437 14.19459 14.52 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.