How whooses/unimap works
Project type and purpose
• This is a full-stack mobile application named “Unimap” for sharing university event information.
• client/ holds an iOS SwiftUI app (MVVM)
• server/ holds a Python FastAPI service (routers → services → repository → DB)
• supabase/ holds database schema migrations + seed scripts (PostgreSQL)
• CI/CD is defined in .github/workflows/CICD.yml and the server is containerized via Dockerfile
a. Mobile client (SwiftUI app)
• Layers:
– UI (Pages, Components)
– ViewModels (AuthViewModel, ExplorePageVM, etc.)
– Services (NetworkService, EventService, etc.)
– Utilities (URLRequestBuilder, ImageLoader)
• External dependency: Auth0 (client/Unimap/Configs/Auth0.plist)
b. API server (FastAPI)
• Routers (users, events, bug_reports, event_reports)
• Dependencies (auth_dep, database_dep, etc.)
• Services (event_service, user_service, report services)
• Repository / DB layer (SQLAlchemy models + repository classes)
c. Database (PostgreSQL via Supabase)
• Schema managed by supabase/migrations
d. Authentication service (Auth0, issuing JWT tokens)
e. CI/CD pipeline (GitHub Actions)
f. Containerization (Dockerfile for server)
Relationships & data flows
• Mobile App → Auth0: OAuth/OpenID login → receives JWT
• Mobile App → FastAPI: HTTPS/JSON requests carrying JWT in header
• FastAPI → PostgreSQL (Supabase): query/ transaction via SQLAlchemy session
• FastAPI → Auth0 (token validation via dependencies/auth_dep)
• CI/CD Workflow → builds & pushes Docker image → deploys server → runs database migrations (supabase)
Architectural patterns & principles
• Client: MVVM (Views ↔ ViewModels ↔ Services)
• Server: Layered architecture (Routers → Business Services → Repository → Models)
• Use of dependency injection for database and auth deps in FastAPI
• Infrastructure as code for DB schema (supabase migrations)
• Container-first deployment via Docker