How gdg-cnu/netradar works
NetRadar is a taxi-driver service for viewing hourly-earnings forecasts, finding detour routes, recording a drive, and reviewing trip history; it also supports account, profile, and favorite-place management. The main flow runs from login and map exploration through route selection, drive events, and replay. The README documents the frontend-to-FastAPI contracts and demo/live modes. Source-index references and excerpts support the depicted module links; unsampled details are represented at subsystem level, and unverified external integrations are omitted or marked optional.
Main entry points: App.tsx App shell · main.py FastAPI app · routes.py Recommendations · api.ts API client
Components 32
Driver app
- App shell
front/src/App.tsx - Login
front/src/pages/LoginPage.tsx - Earnings map
front/src/pages/MapPage.tsx - Forecast views
front/src/components/map - Route planning
front/src/pages/RoutePage.tsx - Place search
front/src/components/route/PlaceSearch.tsx - Route results
front/src/components/route/RouteResults.tsx - Drive guidance
front/src/pages/DrivePage.tsx - Drive state
front/src/hooks/useDrive.ts - Trip replay
front/src/pages/ReplayPage.tsx - Profile
front/src/pages/MyPage.tsx - API client
front/src/services/api.ts - Route service
front/src/services/routes.ts - Forecast service
front/src/services/forecast.ts - Profile service
front/src/services/profile.ts - History service
front/src/services/history.ts
FastAPI services
- FastAPI app
backend/main.py - Forecast endpoint
backend/routers/forecast.py - Places endpoint
backend/routers/places.py - Recommendations
backend/routers/routes.py - Profile endpoint
backend/routers/profile.py - Trip events
backend/routers/trips.py - Route contracts
backend/schemas/route.py
Backend data
- Sample zones
backend/data/mock_zones.py - Sample places
backend/data/mock_places.py
Identity and storage
- Browser storage
front/src/utils/storage.ts - Session state
front/src/hooks/useAppSession.ts - Supabase client
backend/db/client.py - Token validation
backend/db/auth.py
External providers
- Supabase auth
front/src/services/auth.ts - Kakao Mobility
backend/kakao_mobility.py
Other components
- Taxi driver
Connections 45
- Taxi driver → App shell: opens
front/src/App.tsx - App shell → Session state: checks session
front/src/App.tsx - App shell → Login: shows when signed out
front/src/App.tsx - App shell → Earnings map: routes to
front/src/App.tsx - App shell → Route planning: routes to
front/src/App.tsx - App shell → Drive guidance: routes to
front/src/App.tsx - App shell → Trip replay: routes to
front/src/App.tsx - App shell → Profile: routes to
front/src/App.tsx - Session state → Supabase auth: reads session
front/src/hooks/useAppSession.ts - Session state → Browser storage: sets account scope
front/src/hooks/useAppSession.ts - Login → Supabase auth: authenticates
front/src/pages/LoginPage.tsx - Earnings map → Forecast views: renders
front/src/pages/MapPage.tsx - Earnings map → Forecast service: loads forecasts
front/src/pages/MapPage.tsx - Route planning → Place search: uses
front/src/pages/RoutePage.tsx - Route planning → Route results: renders
front/src/pages/RoutePage.tsx - Route results → Route service: requests routes
front/src/components/route/RouteResults.tsx - Route planning → Route service: searches routes
front/src/pages/RoutePage.tsx - Drive guidance → Drive state: uses
front/src/pages/DrivePage.tsx - Drive state → Route service: creates trips and events
front/src/hooks/useDrive.ts - Drive state → History service: saves completed trips
front/src/hooks/useDrive.ts - Drive state → Browser storage: persists state
front/src/hooks/useDrive.ts - Trip replay → History service: loads history
front/src/pages/ReplayPage.tsx - Profile → Profile service: loads and saves profile
front/src/pages/MyPage.tsx - Profile → Browser storage: stores preferences
front/src/pages/MyPage.tsx - Forecast service → API client: requests data
front/src/pages/MapPage.tsx - Route service → API client: requests routes and trips
front/src/services/routes.ts - History service → API client: requests history
front/src/services/history.ts - Profile service → API client: requests profile
front/src/pages/MyPage.tsx - API client → FastAPI app: calls API
README.md - FastAPI app → Forecast endpoint: mounts router
backend/main.py - FastAPI app → Places endpoint: mounts router
backend/main.py - FastAPI app → Recommendations: mounts router
backend/main.py - FastAPI app → Profile endpoint: mounts router
backend/main.py - FastAPI app → Trip events: mounts router
backend/main.py - Forecast endpoint → Sample zones: reads examples
backend/routers/forecast.py - Places endpoint → Sample places: reads examples
backend/routers/places.py - Recommendations → Sample places: selects candidates
backend/routers/routes.py - Recommendations → Sample zones: reads hourly rates
backend/routers/routes.py - Recommendations → Kakao Mobility: gets directions
backend/routers/routes.py - Recommendations → Route contracts: validates route data
backend/routers/routes.py - Profile endpoint → Token validation: validates user
backend/routers/profile.py - Trip events → Token validation: validates user
backend/routers/trips.py - Token validation → Supabase client: checks token
backend/db/auth.py - Profile endpoint → Supabase client: reads and writes profile
backend/routers/profile.py - Trip events → Supabase client: uses database client
backend/routers/trips.py