Segments (1240) Delete Previous Page 15 of 25 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 Enugu FCT Gombe Imo Jigawa Kaduna Kano Katsina Kebbi Kogi Kwara Lagos Lagos I Lagos II 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) ✎ F125 F125PLS05 - PLATEAU - 8.78132 9.31149 - 8.87826 9.54114 29.39 ✎ F125 F125PLS06 Kurum PLATEAU - 8.87826 9.54114 - 9.05263 9.65651 24.96 ✎ F125 F125PLS07 Langtang PLATEAU - 9.05263 9.65651 - 9.14120 9.81835 24.95 ✎ F125 F125TAS07 Zurak TARABA - 9.23976 10.58631 - 9.23671 10.79814 25.07 ✎ F125 F125PLS08 Wase PLATEAU - 9.14120 9.81835 - 9.11724 9.97849 24.95 ✎ F125 F125TAS08 Materum TARABA - 9.23671 10.79814 - 9.30117 10.98934 24.65 ✎ F125 F125PLS09 Yola PLATEAU - 9.11724 9.97849 - 9.27319 10.12550 24.95 ✎ F125 F125TAS09 Mutum Daya TARABA - 9.30117 10.98934 - 9.36739 11.07205 12.21 ✎ F125 F125PLS10 Bashar PLATEAU - 9.27319 10.12550 - 9.28302 10.31642 24.96 ✎ F125 F125PLS11 Zok PLATEAU - 9.28302 10.31640 - 9.23976 10.58631 31.48 ✎ F125 F125TAS14 Mutum Daya TARABA - 9.30117 10.98934 - 9.36739 11.07200 12.21 ✎ 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 25.00 ✎ 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 - 9.58440 8.37170 - 9.65339 8.57602 27.48 ✎ F127 FI27PLS02 - PLATEAU - 9.65339 8.57602 - 9.69845 8.72039 25.05 ✎ F127 FI27PLS03 - PLATEAU - 9.69845 8.72039 - 9.76905 8.86004 19.60 ✎ F128 F128NIS01 SAMUNAKA NIGER - 10.32101 4.25909 - 10.50740 4.34921 25.03 ✎ F128 F128NIS02 TUGAN BAKERE NIGER - 10.50740 4.34921 - 10.67733 4.43284 24.98 ✎ F128 F128NIS03 AGWARRA NIGER - 10.67733 4.43284 - 10.72365 4.63997 25.02 ✎ F128 F128NIS04 - NIGER - 10.72365 4.63997 - 10.71214 4.69562 6.96 ✎ F128 F128KES05 BIN YAURI KEBBI - 10.71214 4.69562 - 10.79438 4.81542 30.32 ✎ F128 F128KES06 GWANDA KEBBI - 10.79438 4.81542 - 10.89993 5.01014 24.99 ✎ F128 F128KES07 - KEBBI - 10.89993 5.01014 - 10.97053 5.07375 11.02 ✎ F128 F128NIS08 - NIGER - 10.97053 5.07375 - 11.09074 5.24749 24.66 ✎ F128 F128NIS09 - NIGER - 11.09074 5.24749 - 11.18787 5.38752 19.70 ✎ F128 F128KES10 MARAFAN SAKABA KEBBI - 11.18787 5.38752 - 11.31951 5.48109 19.57 ✎ F128 F128KES11 RIBAH KEBBI - 11.31951 5.48109 - 11.33991 5.60816 25.07 ✎ F128 F128KES12 WASAGA KEBBI - 11.33991 5.60816 - 11.36484 5.82991 25.00 ✎ F128 F128KES13 BENA KEBBI - 11.36484 5.82991 - 11.37262 5.98353 25.03 ✎ F128 F128KES14 - KEBBI - 11.37262 5.98353 - 11.45625 6.01543 10.14 ✎ F128 F128SZA15 MAI MARAHU ZAMFARA - 11.45625 6.01543 - 11.57050 6.07404 28.17 ✎ F128 F128ZAS16 DAN GULBI ZAMFARA - 11.57050 6.07404 - 11.66179 6.25401 25.02 ✎ F128 F128ZAS17 GOBIRAWA ZAMFARA - 11.66179 6.25401 - 11.70124 6.45459 24.97 ✎ F128 F128ZAS18 MAGAMI ZAMFARA - 11.70124 6.45459 - 11.71920 6.67074 25.07 ✎ F128 F128ZAS19 KONKOMBA ZAMFARA - 11.71920 6.67074 - 11.76256 6.86553 25.10 ✎ F128 F128ZAS20 - ZAMFARA - 11.76256 6.86553 - 11.82919 7.01837 19.75 ✎ F128 F128ZAS21 - ZAMFARA - 11.82919 7.01837 - 11.79128 7.05931 6.44 ✎ F128 F128ZAS22 UNGWAR MAKERA KATSINA - 11.79128 7.05931 - 11.70096 7.16321 16.02 ✎ F128 F128ZAS23 DAN BAWO KATSINA - 11.70096 7.16321 - 11.82684 7.32319 25.05 ✎ F128 F128ZAS24 KANKARA KATSINA - 11.82684 7.32319 - 11.92800 7.49357 25.05 ✎ F128 F128ZAS25 - KATSINA - 11.92800 7.49357 - 11.91675 7.66585 19.98 ✎ F128 F128ZAS26 - KATSINA - 11.91675 7.66585 - 11.97031 7.69136 6.60 ✎ F128 F128ZAS27 - KATSINA - 11.97031 7.69136 - 11.93115 7.82877 16.19 ✎ F128 F128KNS28 GANGARA KANO - 11.93115 7.82877 - 11.92295 7.89518 7.38 ✎ F128 F128KNS29 BUWANA KANO - 11.92295 7.89518 - 11.95635 8.11769 24.99 ✎ F128 F128KNS30 ZANGO KANO - 11.95635 8.11769 - 11.99837 8.34054 24.97 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.