How sapirshenkor/citystrata works
CityStrata is an evacuation-planning decision-support platform: users explore urban data, submit family or community needs, and receive map-based relocation recommendations. The documented flow combines macro cluster matching, tactical spatial/vector analysis, and a grounded report. The graph also preserves the family listing, municipal analytics, and POI/hotel management branches. Relationships for unsampled endpoint and frontend subsystems follow explicit README capabilities or router references; internal details not shown in excerpts are kept at subsystem level.
Main entry points: api.js API client · database.py Database connection pool · router.py API routes · property_listings.py Family and listing APIs
Components 31
Planning experience
- Web application
frontend/src/App.jsx - Interactive map
frontend/src/MapApp.tsx - Map data queries
frontend/src/hooks/useMapData.ts - Recommendation panel
frontend/src/components/Recommendations/RecommendationsPanel.jsx - Family portal
frontend/src/family_portal/FamilyDashboard.tsx - Family queries
frontend/src/family_portal/hooks/useFamilyQueries.ts - Municipal dashboard
frontend/src/user_dashboard/DashboardContainer.tsx - POI management
frontend/src/poi_management/PointOfInterestManagement.tsx - Hotel management
frontend/src/hotels_management/HotelManagementPage.tsx - API client
frontend/src/services/api.js
API and access
- API application
backend/app/main.py - API routes
backend/app/api/router.py - Authentication API
backend/app/api/endpoints/auth.py - Identity and roles
backend/app/core/auth.py - Family and listing APIs
backend/app/api/endpoints/property_listings.py - Urban data APIs
backend/app/api/endpoints/statistical_areas.py - Recommendation API
backend/app/api/endpoints/matching.py
Recommendation intelligence
- Tactical pipeline service
backend/app/services/tactical_pipeline.py - Macro cluster matching
backend/app/agents/matchingAgent.py - Urban clustering
backend/ML/clustering.py - Tactical agents
backend/mcp/tactical_agent.py - Family agent
backend/mcp/family_agent.py - Community agent
backend/mcp/multi_family_agent.py - Spatial and vector tools
backend/mcp/mcp_server.py
Urban data and records
- Spatial and vector database
- Database connection pool
backend/app/core/database.py - Supabase authentication
- Family and community records
backend/app/models/evacuee_family_profiles.py - POI and urban records
backend/app/models/poi_generic.py - Property listings
backend/app/models/property_listing.py
Other components
- Planner or family
Connections 42
- Planner or family → Web application: uses
- Web application → Interactive map: routes to
frontend/src/App.jsx - Web application → Family portal: routes to
frontend/src/App.jsx - Planner or family → Recommendation panel: submits needs
- Interactive map → Map data queries: loads layers
- Map data queries → API client: requests data
frontend/src/hooks/useMapData.ts - Family portal → Family queries: loads records
frontend/src/family_portal/hooks/useFamilyQueries.ts - Family queries → API client: requests records
frontend/src/family_portal/hooks/useFamilyQueries.ts - Recommendation panel → API client: requests recommendations
- Municipal dashboard → API client: loads analytics
- POI management → API client: manages POIs
- Hotel management → API client: manages hotels
- API client → API application: REST requests
- API application → Database connection pool: initializes pool
backend/app/main.py - API application → API routes: mounts routes
backend/app/main.py - API routes → Authentication API: registers
backend/app/api/router.py - API routes → Family and listing APIs: registers
backend/app/api/router.py - API routes → Urban data APIs: registers
backend/app/api/router.py - API routes → Recommendation API: registers
backend/app/api/router.py - Authentication API → Supabase authentication: authenticates
backend/app/api/endpoints/auth.py - Authentication API → Database connection pool: reads and writes
backend/app/api/endpoints/auth.py - Identity and roles → Supabase authentication: validates token
backend/app/core/auth.py - Identity and roles → Database connection pool: loads user
backend/app/core/auth.py - Family and listing APIs → Identity and roles: checks access
backend/app/api/endpoints/property_listings.py - Family and listing APIs → Database connection pool: reads and writes
backend/app/api/endpoints/property_listings.py - Database connection pool → Spatial and vector database: connects
backend/app/core/database.py - Urban data APIs → Database connection pool: queries urban data
- Recommendation API → Macro cluster matching: selects cluster
- Recommendation API → Tactical pipeline service: starts tactical run
- Macro cluster matching → Spatial and vector database: uses cluster profiles
- Tactical pipeline service → Tactical agents: delegates pipeline
backend/app/services/tactical_pipeline.py - Tactical agents → Family agent: dispatches family run
backend/mcp/tactical_agent.py - Tactical agents → Community agent: dispatches community run
backend/mcp/tactical_agent.py - Family agent → Spatial and vector tools: uses tools
- Community agent → Spatial and vector tools: uses tools
- Spatial and vector tools → Spatial and vector database: queries spatial and vector data
- Urban clustering → Spatial and vector database: clusters area features
- Family and listing APIs → Family and community records: persists profiles
- Family and listing APIs → Property listings: persists listings
backend/app/api/endpoints/property_listings.py - Urban data APIs → POI and urban records: serves urban layers
- Family agent → Spatial and vector database: persists report
- Community agent → Spatial and vector database: persists report