Segments (1252) Delete Previous Page 17 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) ✎ F130 F130BAS10 Dambam BAUCHI - 11.65948 10.65073 - 11.71351 10.92132 30.88 ✎ F130 F130YOS11 Lelai YOBE - 11.71351 10.92132 - 11.71678 11.04549 21.15 ✎ F131 F131YOS01 Lelai YOBE - 11.70704 11.10283 - 11.84688 10.94330 24.96 ✎ F131 F131YOS02 - YOBE - 11.84688 10.94330 - 11.88517 10.81624 15.16 ✎ F131 F131BAS03 Zindiwa BAUCHI - 11.88517 10.81624 - 11.93617 10.74414 9.79 ✎ F131 F131BAS04 Lafia BAUCHI - 11.93617 10.74414 - 12.04197 10.57536 24.95 ✎ F131 F131BAS05 Gamawa BAUCHI - 12.04197 10.57536 - 12.22342 10.45537 25.00 ✎ F131 F131BAS06 Katagum BAUCHI - 12.22342 10.45537 - 12.31191 10.26542 25.00 ✎ F131 F131BAS07 - BAUCHI - 12.31191 10.26542 - 12.31371 10.19655 7.83 ✎ F131 F131JIS08 malamawa Kiri JIGAWA - 12.31371 10.19655 - 12.26233 10.05025 17.09 ✎ F131 F131JIS09 Keffin Hausa JIGAWA - 12.26233 10.05025 - 12.21134 9.83138 24.95 ✎ F131 F131JIS10 Dagazo JIGAWA - 12.21134 9.83138 - 12.09727 9.64439 24.95 ✎ F131 F131JIS11 Auma JIGAWA - 12.09727 9.64439 - 12.04906 9.43170 24.95 ✎ F131 F131JIS12 Chaichai JIGAWA - 12.04906 9.43170 - 12.00125 9.22492 23.49 ✎ F131 F131KNS13 Ajingi KANO - 12.00125 9.22492 - 11.91627 9.02725 26.41 ✎ F131 F131KNS14 Gaya KANO - 11.91627 9.02725 - 11.79512 8.83682 26.58 ✎ F132 F132KES01 Jega KEBBI - 12.34106 4.20094 - 12.22632 4.37335 23.32 ✎ F132 F132KES02 Bawanka KEBBI/SOKOTO - 12.18064 4.36765 - 12.15827 4.55268 20.59 ✎ F132 F132SOS03 Asarara Kaura SOKOTO - 12.14728 4.59125 - 12.10963 4.80839 24.98 ✎ F132 F132SOS04 - SOKOTO/ZAMFARA - 12.10963 4.80839 - 12.07850 4.86490 7.20 ✎ F132 F132ZAS05 Bundum ZAMFARA - 12.07872 4.86457 - 12.01367 5.00921 24.95 ✎ F132 F132ZAS06 Gummi ZAMFARA - 12.01367 5.00921 - 12.02002 5.22835 24.97 ✎ F132 F132ZAS07 Gayawa ZAMFARA - 12.02002 5.22835 - 11.99215 5.44486 24.96 ✎ F132 F132ZAS08 Kainya Hill ZAMFARA - 11.99215 5.44486 - 12.00840 5.66453 24.99 ✎ F132 F132ZAS09 Gada Mayya ZAMFARA - 12.00840 5.66453 - 12.03751 5.86492 24.96 ✎ F132 F132ZAS10 Anka ZAMFARA - 12.03751 5.86492 - 12.18338 6.02092 24.96 ✎ F132 F132ZAS11 Bobo ZAMFARA - 12.18338 6.02092 - 12.28536 6.18813 24.94 ✎ F132 F132ZAS12 Maiinchi ZAMFARA - 12.28536 6.18813 - 12.35208 6.26791 11.74 ✎ F133 F133KES01 Goru KEBBI - 11.85539 3.65577 - 12.06613 3.70818 24.96 ✎ F133 F133KES02 Maiyam KEBBI - 12.06613 3.70818 - 12.26073 3.72655 24.95 ✎ F133 F133KES03 Nageda KEBBI - 12.26073 3.72655 - 12.47763 3.76288 24.95 ✎ F133 F133KES04 Kaingiwa KEBBI - 12.47763 3.76288 - 12.60413 3.94174 24.96 ✎ F133 F133KES05 Kurfaida KEBBI - 12.60413 3.94174 - 12.72391 4.13064 24.98 ✎ F133 F133KES06 Karamin Tago KEBBI - 12.72391 4.13064 - 12.73675 4.35544 24.95 ✎ F133 F133KES07 Lailaba KEBBI - 12.73675 4.35544 - 12.74474 4.51972 24.95 ✎ F133 F133KES08 Kamfani KEBBI - 12.74474 4.51972 - 12.70372 4.71766 23.79 ✎ F133 F133KES09 Sainyinan Daji KEBBI/SOKOTO - 12.70372 4.71766 - 12.72804 4.93571 24.97 ✎ F133 F133SOS10 Yabo SOKOTO - 12.72804 4.93571 - 12.76329 5.07893 16.39 ✎ F135 F135BOS01 Kukawa BORNO Default 12.92447 13.55761 Default 13.02128 13.75076 0.00 ✎ F135 F135BOS02 Baga BORNO Default 13.02128 13.75076 Default 13.09726 13.82523 0.00 ✎ F136 F136KTS01 Eaguwa KATSINA - 12.44528 7.48034 - 12.47318 7.68642 24.95 ✎ F136 F136KTS02 Tafashiya KATSINA - 12.47318 7.68642 - 12.55280 7.83760 21.66 ✎ F137 F137ZAS01 Barakeji ZAMFARA - 12.63525 6.59422 - 12.76895 6.76618 24.97 ✎ F137 F137ZAS02 Kashebawa ZAMFARA - 12.76895 6.76618 - 12.90900 6.91953 24.95 ✎ F137 F137ZAS03 Gidan Baure ZAMFARA/KATSINA - 12.90900 6.91953 - 13.00836 7.09743 24.95 ✎ F137 F137KTS04 Djibia KATSINA - 13.00836 7.09743 - 13.10731 7.26602 22.45 ✎ F138 F138SOS01 ACHIDA SOKOTO - 13.10117 5.27148 - 13.21078 5.46630 24.96 ✎ F138 F138SOS02 AWAKACA SOKOTO - 13.21078 5.46630 - 13.33212 5.63871 24.97 ✎ F138 F138SOS03 GORONYO SOKOTO - 13.33212 5.63871 - 13.47342 5.76799 24.97 ✎ F138 F138SOS04 YERIMAWA SOKOTO - 13.47342 5.76799 - 13.46731 5.98123 24.95 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.