# team-waggle/frontend-v2 architecture

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

- Interactive diagram: https://gitdiagram.com/team-waggle/frontend-v2
- Repository: https://github.com/team-waggle/frontend-v2

## Overview

This is a React/TypeScript collaboration platform for discovering project opportunities, managing teams and applications, maintaining profiles, and messaging collaborators. Users enter through routed pages; the main search workflow gathers keyword, role, and skill filters, then applies them to opportunity discovery. From a post, users can apply, while team managers handle applicants and team status. Authentication and realtime messaging are shared application services. The README is a Vite template and does not document product behavior; some page-to-data connections are therefore omitted where the supplied source does not establish them.

Main entry points: [`src/router.tsx`](https://github.com/team-waggle/frontend-v2/blob/main/src/router.tsx) (Route map), [`src/hooks/useStompClient.ts`](https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useStompClient.ts) (Realtime client), [`src/App.tsx`](https://github.com/team-waggle/frontend-v2/blob/main/src/App.tsx) (App shell), [`src/stores/authStore.ts`](https://github.com/team-waggle/frontend-v2/blob/main/src/stores/authStore.ts) (Auth state)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_navigation["App and routing"]
  node_app["App shell<br/>[App.tsx]"]
  node_router["Route map<br/>[router.tsx]"]
  node_route_loaders["Route loaders<br/>[routeLoaders.ts]"]
  node_auth["Authentication<br/>[useAuth.ts]"]
  node_auth_api["Auth API<br/>[auth.ts]"]
  node_auth_store["Auth state<br/>[authStore.ts]"]
end

subgraph group_discovery["Opportunity discovery"]
  node_search_ui["Search controls<br/>[MainSearch.tsx]"]
  node_search_filters["Search filters"]
  node_main_page["Opportunity feed<br/>[MainPage.tsx]"]
  node_post_detail["Post detail<br/>[PostDetailPage.tsx]"]
  node_post_data["Post data hooks<br/>[usePost.ts]"]
  node_post_api["Post API<br/>[post.ts]"]
end

subgraph group_teams["Teams and profiles"]
  node_team_applicants["Applicant management"]
  node_team_hooks["Team data hooks<br/>[useTeam.ts]"]
  node_team_api["Team API<br/>[team.ts]"]
  node_profile["Profile pages<br/>[ProfilePage.tsx]"]
end

subgraph group_messaging["Messaging and services"]
  node_message_page["Message page<br/>[MessagePage.tsx]"]
  node_realtime["Realtime client<br/>[useStompClient.ts]"]
  node_message_api["Message API<br/>[message.ts]"]
  node_message_store["Message state<br/>[messageStore.ts]"]
end

node_user(("Collaborator"))
node_backend{{"Platform services"}}

node_user -->|"opens routes"| node_router
node_router -->|"renders shell"| node_app
node_router -->|"routes to"| node_main_page
node_router -->|"routes to"| node_post_detail
node_router -->|"routes to"| node_team_applicants
node_router -->|"routes to"| node_profile
node_router -->|"routes to"| node_message_page
node_router -->|"loads route data"| node_route_loaders
node_app -->|"reads auth state"| node_auth_store
node_app -->|"starts connection"| node_realtime
node_auth -->|"calls"| node_auth_api
node_auth -->|"updates state"| node_auth_store
node_search_ui -->|"uses filters"| node_search_filters
node_post_detail -->|"uses post hooks"| node_post_data
node_team_applicants -->|"uses team hooks"| node_team_hooks
node_team_hooks -->|"calls"| node_team_api
node_realtime -->|"reads token"| node_auth_store
node_realtime -->|"gets socket token"| node_message_api
node_realtime -->|"updates messages"| node_message_store
node_realtime -.->|"publishes messages"| node_backend

click node_app "https://github.com/team-waggle/frontend-v2/blob/main/src/App.tsx"
click node_router "https://github.com/team-waggle/frontend-v2/blob/main/src/router.tsx"
click node_route_loaders "https://github.com/team-waggle/frontend-v2/blob/main/src/loaders/routeLoaders.ts"
click node_auth "https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useAuth.ts"
click node_auth_api "https://github.com/team-waggle/frontend-v2/blob/main/src/api/auth.ts"
click node_auth_store "https://github.com/team-waggle/frontend-v2/blob/main/src/stores/authStore.ts"
click node_search_ui "https://github.com/team-waggle/frontend-v2/blob/main/src/components/Main/MainSearch/MainSearch.tsx"
click node_search_filters "https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useSearchFilters.ts"
click node_main_page "https://github.com/team-waggle/frontend-v2/blob/main/src/pages/MainPage.tsx"
click node_post_detail "https://github.com/team-waggle/frontend-v2/blob/main/src/pages/PostDetailPage.tsx"
click node_post_data "https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/usePost.ts"
click node_post_api "https://github.com/team-waggle/frontend-v2/blob/main/src/api/post.ts"
click node_team_applicants "https://github.com/team-waggle/frontend-v2/blob/main/src/pages/TeamApplicantPage.tsx"
click node_team_hooks "https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useTeam.ts"
click node_team_api "https://github.com/team-waggle/frontend-v2/blob/main/src/api/team.ts"
click node_profile "https://github.com/team-waggle/frontend-v2/blob/main/src/pages/ProfilePage.tsx"
click node_message_page "https://github.com/team-waggle/frontend-v2/blob/main/src/pages/MessagePage.tsx"
click node_realtime "https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useStompClient.ts"
click node_message_api "https://github.com/team-waggle/frontend-v2/blob/main/src/api/message.ts"
click node_message_store "https://github.com/team-waggle/frontend-v2/blob/main/src/stores/messageStore.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_app,node_router,node_route_loaders,node_auth,node_auth_api,node_auth_store toneBlue
class node_search_ui,node_search_filters,node_main_page,node_post_detail,node_post_data,node_post_api toneAmber
class node_team_applicants,node_team_hooks,node_team_api,node_profile toneMint
class node_message_page,node_realtime,node_message_api,node_message_store toneRose
class node_user,node_backend toneIndigo
```

## Components

### App and routing

- [App shell](https://github.com/team-waggle/frontend-v2/blob/main/src/App.tsx): `src/App.tsx`
- [Route map](https://github.com/team-waggle/frontend-v2/blob/main/src/router.tsx): `src/router.tsx`
- [Route loaders](https://github.com/team-waggle/frontend-v2/blob/main/src/loaders/routeLoaders.ts): `src/loaders/routeLoaders.ts`
- [Authentication](https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useAuth.ts): `src/hooks/useAuth.ts`
- [Auth API](https://github.com/team-waggle/frontend-v2/blob/main/src/api/auth.ts): `src/api/auth.ts`
- [Auth state](https://github.com/team-waggle/frontend-v2/blob/main/src/stores/authStore.ts): `src/stores/authStore.ts`

### Opportunity discovery

- [Search controls](https://github.com/team-waggle/frontend-v2/blob/main/src/components/Main/MainSearch/MainSearch.tsx): `src/components/Main/MainSearch/MainSearch.tsx`
- [Search filters](https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useSearchFilters.ts): `src/hooks/useSearchFilters.ts`
- [Opportunity feed](https://github.com/team-waggle/frontend-v2/blob/main/src/pages/MainPage.tsx): `src/pages/MainPage.tsx`
- [Post detail](https://github.com/team-waggle/frontend-v2/blob/main/src/pages/PostDetailPage.tsx): `src/pages/PostDetailPage.tsx`
- [Post data hooks](https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/usePost.ts): `src/hooks/usePost.ts`
- [Post API](https://github.com/team-waggle/frontend-v2/blob/main/src/api/post.ts): `src/api/post.ts`

### Teams and profiles

- [Applicant management](https://github.com/team-waggle/frontend-v2/blob/main/src/pages/TeamApplicantPage.tsx): `src/pages/TeamApplicantPage.tsx`
- [Team data hooks](https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useTeam.ts): `src/hooks/useTeam.ts`
- [Team API](https://github.com/team-waggle/frontend-v2/blob/main/src/api/team.ts): `src/api/team.ts`
- [Profile pages](https://github.com/team-waggle/frontend-v2/blob/main/src/pages/ProfilePage.tsx): `src/pages/ProfilePage.tsx`

### Messaging and services

- [Message page](https://github.com/team-waggle/frontend-v2/blob/main/src/pages/MessagePage.tsx): `src/pages/MessagePage.tsx`
- [Realtime client](https://github.com/team-waggle/frontend-v2/blob/main/src/hooks/useStompClient.ts): `src/hooks/useStompClient.ts`
- [Message API](https://github.com/team-waggle/frontend-v2/blob/main/src/api/message.ts): `src/api/message.ts`
- [Message state](https://github.com/team-waggle/frontend-v2/blob/main/src/stores/messageStore.ts): `src/stores/messageStore.ts`

### Other components

- **Collaborator**
- **Platform services**

## Connections

- Collaborator → Route map: opens routes (evidence: `src/router.tsx`)
- Route map → App shell: renders shell (evidence: `src/router.tsx`)
- Route map → Opportunity feed: routes to (evidence: `src/router.tsx`)
- Route map → Post detail: routes to (evidence: `src/router.tsx`)
- Route map → Applicant management: routes to (evidence: `src/router.tsx`)
- Route map → Profile pages: routes to (evidence: `src/router.tsx`)
- Route map → Message page: routes to (evidence: `src/router.tsx`)
- Route map → Route loaders: loads route data (evidence: `src/router.tsx`)
- App shell → Auth state: reads auth state (evidence: `src/App.tsx`)
- App shell → Realtime client: starts connection (evidence: `src/App.tsx`)
- Authentication → Auth API: calls (evidence: `src/hooks/useAuth.ts`)
- Authentication → Auth state: updates state (evidence: `src/hooks/useAuth.ts`)
- Search controls → Search filters: uses filters (evidence: `src/components/Main/MainSearch/MainSearch.tsx`)
- Post detail → Post data hooks: uses post hooks (evidence: `src/pages/PostDetailPage.tsx`)
- Applicant management → Team data hooks: uses team hooks (evidence: `src/pages/TeamApplicantPage.tsx`)
- Team data hooks → Team API: calls (evidence: `src/hooks/useTeam.ts`)
- Realtime client → Auth state: reads token (evidence: `src/hooks/useStompClient.ts`)
- Realtime client → Message API: gets socket token (evidence: `src/hooks/useStompClient.ts`)
- Realtime client → Message state: updates messages (evidence: `src/hooks/useStompClient.ts`)
- Realtime client → Platform services: publishes messages
