# wafflestudio/hangsha-ios architecture

> Architecture diagram of the GitHub repository wafflestudio/hangsha-ios, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wafflestudio/hangsha-ios
- Repository: https://github.com/wafflestudio/hangsha-ios

## Overview

Hangsha is an Expo/React Native app for discovering Seoul National University campus events, with calendar and search as its main discovery workflow. Users browse or search events, refine results with filters, and open event details; authenticated users can bookmark events, save interests, and manage memos. The app also supports account onboarding, bug reports, and SNUTT timetable integration. The graph follows documented routing and sampled API/context relationships; unsampled screen wiring and some integrations are omitted where evidence is unavailable.

Main entry points: [`contexts/AuthProvider.tsx`](https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/AuthProvider.tsx) (Authentication), [`screens/SearchScreen.tsx`](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/SearchScreen.tsx) (Search screen), [`api/event.ts`](https://github.com/wafflestudio/hangsha-ios/blob/dev/api/event.ts) (Event API), [`app`](https://github.com/wafflestudio/hangsha-ios/tree/dev/app) (App routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discovery["Event discovery"]
  node_calendar["Calendar screen<br/>[CalendarScreen.tsx]"]
  node_search["Search screen<br/>[SearchScreen.tsx]"]
  node_filters["Event filters<br/>[FilterSheet.tsx]"]
  node_eventdata["Event data"]
  node_eventapi["Event API<br/>[event.ts]"]
  node_eventdetail["Event detail"]
  node_searchresults["Search results"]
  node_eventtypes["Event models<br/>[event.ts]"]
  node_eventdates["Calendar date utilities<br/>[dateFormatter.ts]"]
end

subgraph group_account["Accounts and preferences"]
  node_auth["Authentication<br/>[AuthProvider.tsx]"]
  node_authapi["Auth API<br/>[auth.ts]"]
  node_socialauth["Social sign-in<br/>[socialAuth.ts]"]
  node_tokenservice["Token service<br/>[tokenService.ts]"]
  node_userdata["User data"]
  node_userapi["User API<br/>[user.ts]"]
  node_signup["Signup screens<br/>[SignupScreen.tsx]"]
  node_onboarding["Onboarding screens"]
  node_mypage["Profile screen<br/>[MyPageScreen.tsx]"]
end

subgraph group_timetable["Timetable"]
  node_timetable["Timetable screen"]
  node_timetablecontext["Timetable state"]
  node_snutt["SNUTT integration<br/>[snuttTimetable.ts]"]
end

subgraph group_platform["App services"]
  node_router["App routes"]
  node_securestore[("Secure token storage")]
  node_bugreport["Bug reports<br/>[BugReportForm.tsx]"]
  node_bugcontext["Bug report state"]
end

node_user(("App user"))
node_backend[("Hangsha API service")]

node_user -->|"opens"| node_router
node_router -->|"routes to"| node_calendar
node_router -->|"routes to"| node_search
node_search -->|"queries"| node_eventdata
node_search -->|"shows"| node_filters
node_filters -->|"loads options"| node_eventdata
node_eventdata -->|"fetches"| node_eventapi
node_eventapi -.->|"requests events"| node_backend
node_search -->|"renders"| node_searchresults
node_searchresults -->|"formats dates"| node_eventdates
node_eventapi -->|"maps event data"| node_eventtypes
node_user -.->|"signs in"| node_auth
node_auth -->|"gets provider credentials"| node_socialauth
node_auth -->|"authenticates"| node_authapi
node_authapi -.->|"requests account"| node_backend
node_auth -->|"stores tokens"| node_tokenservice
node_tokenservice -->|"persists tokens"| node_securestore
node_userdata -->|"checks session"| node_auth
node_userdata -->|"loads and mutates"| node_userapi
node_userapi -.->|"requests user data"| node_backend
node_signup -.->|"uses account flow"| node_auth
node_onboarding -.->|"sets up account"| node_auth
node_mypage -.->|"manages user data"| node_userdata
node_bugreport -->|"uses report state"| node_bugcontext
node_user -.->|"manages schedule"| node_timetable
node_timetable -.->|"uses timetable state"| node_timetablecontext
node_timetablecontext -.->|"integrates with"| node_snutt

click node_router "https://github.com/wafflestudio/hangsha-ios/tree/dev/app"
click node_calendar "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/CalendarScreen.tsx"
click node_search "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/SearchScreen.tsx"
click node_filters "https://github.com/wafflestudio/hangsha-ios/blob/dev/components/calendar/FilterSheet.tsx"
click node_eventdata "https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/EventDataContext.tsx"
click node_eventapi "https://github.com/wafflestudio/hangsha-ios/blob/dev/api/event.ts"
click node_eventdetail "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/EventDetailScreen.tsx"
click node_searchresults "https://github.com/wafflestudio/hangsha-ios/blob/dev/components/search/SearchResultCard.tsx"
click node_eventtypes "https://github.com/wafflestudio/hangsha-ios/blob/dev/types/event.ts"
click node_eventdates "https://github.com/wafflestudio/hangsha-ios/blob/dev/util/calendar/dateFormatter.ts"
click node_auth "https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/AuthProvider.tsx"
click node_authapi "https://github.com/wafflestudio/hangsha-ios/blob/dev/api/auth.ts"
click node_socialauth "https://github.com/wafflestudio/hangsha-ios/blob/dev/api/socialAuth.ts"
click node_tokenservice "https://github.com/wafflestudio/hangsha-ios/blob/dev/api/tokenService.ts"
click node_userdata "https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/UserDataContext.tsx"
click node_userapi "https://github.com/wafflestudio/hangsha-ios/blob/dev/api/user.ts"
click node_signup "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/SignupScreen.tsx"
click node_onboarding "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/InterestOnboardingScreen.tsx"
click node_mypage "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/MyPageScreen.tsx"
click node_bugreport "https://github.com/wafflestudio/hangsha-ios/blob/dev/components/bug-report/BugReportForm.tsx"
click node_bugcontext "https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/BugReportContext.tsx"
click node_timetable "https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/TimetableScreen.tsx"
click node_timetablecontext "https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/TimetableContext.tsx"
click node_snutt "https://github.com/wafflestudio/hangsha-ios/blob/dev/util/timetable/snuttTimetable.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_calendar,node_search,node_filters,node_eventdata,node_eventapi,node_eventdetail,node_searchresults,node_eventtypes,node_eventdates,node_user toneBlue
class node_auth,node_authapi,node_socialauth,node_tokenservice,node_userdata,node_userapi,node_signup,node_onboarding,node_mypage,node_backend toneAmber
class node_timetable,node_timetablecontext,node_snutt toneMint
class node_router,node_securestore,node_bugreport,node_bugcontext toneRose
```

## Components

### Event discovery

- [Calendar screen](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/CalendarScreen.tsx): `screens/CalendarScreen.tsx`
- [Search screen](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/SearchScreen.tsx): `screens/SearchScreen.tsx`
- [Event filters](https://github.com/wafflestudio/hangsha-ios/blob/dev/components/calendar/FilterSheet.tsx): `components/calendar/FilterSheet.tsx`
- [Event data](https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/EventDataContext.tsx): `contexts/EventDataContext.tsx`
- [Event API](https://github.com/wafflestudio/hangsha-ios/blob/dev/api/event.ts): `api/event.ts`
- [Event detail](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/EventDetailScreen.tsx): `screens/EventDetailScreen.tsx`
- [Search results](https://github.com/wafflestudio/hangsha-ios/blob/dev/components/search/SearchResultCard.tsx): `components/search/SearchResultCard.tsx`
- [Event models](https://github.com/wafflestudio/hangsha-ios/blob/dev/types/event.ts): `types/event.ts`
- [Calendar date utilities](https://github.com/wafflestudio/hangsha-ios/blob/dev/util/calendar/dateFormatter.ts): `util/calendar/dateFormatter.ts`

### Accounts and preferences

- [Authentication](https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/AuthProvider.tsx): `contexts/AuthProvider.tsx`
- [Auth API](https://github.com/wafflestudio/hangsha-ios/blob/dev/api/auth.ts): `api/auth.ts`
- [Social sign-in](https://github.com/wafflestudio/hangsha-ios/blob/dev/api/socialAuth.ts): `api/socialAuth.ts`
- [Token service](https://github.com/wafflestudio/hangsha-ios/blob/dev/api/tokenService.ts): `api/tokenService.ts`
- [User data](https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/UserDataContext.tsx): `contexts/UserDataContext.tsx`
- [User API](https://github.com/wafflestudio/hangsha-ios/blob/dev/api/user.ts): `api/user.ts`
- [Signup screens](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/SignupScreen.tsx): `screens/SignupScreen.tsx`
- [Onboarding screens](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/InterestOnboardingScreen.tsx): `screens/InterestOnboardingScreen.tsx`
- [Profile screen](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/MyPageScreen.tsx): `screens/MyPageScreen.tsx`

### Timetable

- [Timetable screen](https://github.com/wafflestudio/hangsha-ios/blob/dev/screens/TimetableScreen.tsx): `screens/TimetableScreen.tsx`
- [Timetable state](https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/TimetableContext.tsx): `contexts/TimetableContext.tsx`
- [SNUTT integration](https://github.com/wafflestudio/hangsha-ios/blob/dev/util/timetable/snuttTimetable.ts): `util/timetable/snuttTimetable.ts`

### App services

- [App routes](https://github.com/wafflestudio/hangsha-ios/tree/dev/app): `app`
- **Secure token storage**
- [Bug reports](https://github.com/wafflestudio/hangsha-ios/blob/dev/components/bug-report/BugReportForm.tsx): `components/bug-report/BugReportForm.tsx`
- [Bug report state](https://github.com/wafflestudio/hangsha-ios/blob/dev/contexts/BugReportContext.tsx): `contexts/BugReportContext.tsx`

### Other components

- **App user**
- **Hangsha API service**

## Connections

- App user → App routes: opens (evidence: `README.md`)
- App routes → Calendar screen: routes to (evidence: `app/calendar/index.tsx`)
- App routes → Search screen: routes to (evidence: `app/search.tsx`)
- Search screen → Event data: queries (evidence: `screens/SearchScreen.tsx`)
- Search screen → Event filters: shows (evidence: `screens/SearchScreen.tsx`)
- Event filters → Event data: loads options (evidence: `components/calendar/FilterSheet.tsx`)
- Event data → Event API: fetches (evidence: `contexts/EventDataContext.tsx`)
- Event API → Hangsha API service: requests events (evidence: `README.md`)
- Search screen → Search results: renders (evidence: `screens/SearchScreen.tsx`)
- Search results → Calendar date utilities: formats dates (evidence: `components/search/SearchResultCard.tsx`)
- Event API → Event models: maps event data (evidence: `api/event.ts`)
- App user → Authentication: signs in
- Authentication → Social sign-in: gets provider credentials (evidence: `contexts/AuthProvider.tsx`)
- Authentication → Auth API: authenticates (evidence: `contexts/AuthProvider.tsx`)
- Auth API → Hangsha API service: requests account (evidence: `README.md`)
- Authentication → Token service: stores tokens (evidence: `contexts/AuthProvider.tsx`)
- Token service → Secure token storage: persists tokens (evidence: `api/tokenService.ts`)
- User data → Authentication: checks session (evidence: `contexts/UserDataContext.tsx`)
- User data → User API: loads and mutates (evidence: `contexts/UserDataContext.tsx`)
- User API → Hangsha API service: requests user data (evidence: `README.md`)
- Signup screens → Authentication: uses account flow
- Onboarding screens → Authentication: sets up account
- Profile screen → User data: manages user data
- Bug reports → Bug report state: uses report state (evidence: `components/bug-report/BugReportForm.tsx`)
- App user → Timetable screen: manages schedule
- Timetable screen → Timetable state: uses timetable state
- Timetable state → SNUTT integration: integrates with
