# kannadasanb1969/smashpointmobile architecture

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

- Interactive diagram: https://gitdiagram.com/kannadasanb1969/smashpointmobile
- Repository: https://github.com/kannadasanb1969/smashpointmobile

## Overview

SmashPoint is a React Native badminton app for players, organizers, and administrators. Its main workflow is role-based sign-in, then discovering or managing tournaments, registering players, and following fixtures through live scoring and results. Separate branches cover Friendly Matches, player profiles and achievements, notifications, and administrator tournament review. The app’s feature APIs use a shared authenticated HTTP client; session state persists tokens and workspace selection in SecureStore. Connections reflect the README and SOURCE INDEX references; unsampled screens and feature implementations are represented only where their paths and capabilities are documented.

Main entry points: [`src/api/apiClient.ts`](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/apiClient.ts) (Authenticated API client), [`src/features/organizer/api.ts`](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/organizer/api.ts) (Organizer operations API), [`src/features/matches/MatchScreen.tsx`](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/matches/MatchScreen.tsx) (Live match screen), [`src/features/admin/api.ts`](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/admin/api.ts) (Admin API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity and API"]
  node_authscreens["Sign-in and workspace<br/>[login.tsx]"]
  node_session["Session state<br/>[authStore.ts]"]
  node_secure[("Secure session storage<br/>[secureStorage.ts]")]
  node_client["Authenticated API client<br/>[apiClient.ts]"]
end

subgraph group_player["Player workflows"]
  node_playerpages["Tournament discovery and registration<br/>[tournaments.tsx]"]
  node_playerapi["Player data API<br/>[api.ts]"]
  node_playerprofile["Player profile and achievements<br/>[profile.tsx]"]
  node_results["Tournament results"]
  node_friendlypages["Friendly Matches<br/>[friendly.tsx]"]
  node_friendlylogic["Friendly match operations<br/>[friendly.ts]"]
  node_matchscreen["Live match screen<br/>[MatchScreen.tsx]"]
  node_scoring["Match scoring<br/>[scoring.ts]"]
  node_realtimehook["Match realtime updates"]
  node_realtime["Realtime subscription<br/>[matchRealtime.ts]"]
  node_playernotifications["Player notifications<br/>[notifications.tsx]"]
end

subgraph group_organizer["Tournament operations"]
  node_organizerhome["Organizer dashboard<br/>[index.tsx]"]
  node_organizercreate["Tournament creation<br/>[create.tsx]"]
  node_organizerfixtures["Fixture management<br/>[fixtures.tsx]"]
  node_organizerregistrations["Registration management<br/>[registrations.tsx]"]
  node_organizerapi["Organizer operations API<br/>[api.ts]"]
end

subgraph group_admin["Administration"]
  node_adminreview["Tournament review<br/>[review.tsx]"]
  node_adminapi["Admin API<br/>[api.ts]"]
  node_adminhome["Admin workspace<br/>[index.tsx]"]
end

node_user(("Player or staff"))
node_backend{{"SmashPoint API"}}

node_user -->|"signs in"| node_authscreens
node_authscreens -->|"requests auth"| node_client
node_authscreens -->|"sets session"| node_session
node_session -->|"persists tokens"| node_secure
node_client -->|"reads tokens"| node_secure
node_client -->|"refreshes session"| node_session
node_client -->|"sends requests"| node_backend
node_playerpages -->|"loads player data"| node_playerapi
node_playerapi -->|"uses client"| node_client
node_playerpages -->|"shows results"| node_results
node_user -->|"manages profile"| node_playerprofile
node_user -->|"plays friendly matches"| node_friendlypages
node_friendlypages -->|"uses match operations"| node_friendlylogic
node_friendlylogic -->|"uses client"| node_client
node_matchscreen -->|"uses scoring"| node_scoring
node_matchscreen -->|"uses match operations"| node_friendlylogic
node_matchscreen -->|"uses match API"| node_organizerapi
node_matchscreen -->|"subscribes to updates"| node_realtimehook
node_realtimehook -->|"subscribes to match"| node_realtime
node_user -->|"follows live match"| node_matchscreen
node_user -->|"views notifications"| node_playernotifications
node_organizerhome -->|"loads tournaments"| node_organizerapi
node_organizercreate -->|"creates tournament"| node_organizerapi
node_organizerfixtures -.->|"manages fixtures"| node_organizerapi
node_organizerregistrations -.->|"manages registrations"| node_organizerapi
node_organizerapi -->|"uses client"| node_client
node_user -->|"opens admin workspace"| node_adminhome
node_adminhome -->|"loads admin data"| node_adminapi
node_adminreview -->|"reviews tournament"| node_adminapi
node_adminapi -->|"uses client"| node_client
node_adminapi -.->|"sends admin requests"| node_backend

click node_authscreens "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(auth)/login.tsx"
click node_session "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/store/authStore.ts"
click node_secure "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/services/secureStorage.ts"
click node_client "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/apiClient.ts"
click node_playerpages "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/tournaments.tsx"
click node_playerapi "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/api.ts"
click node_playerprofile "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/profile.tsx"
click node_results "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/tournamentResults.ts"
click node_friendlypages "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/friendly.tsx"
click node_friendlylogic "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/friendly.ts"
click node_matchscreen "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/matches/MatchScreen.tsx"
click node_scoring "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/scoring.ts"
click node_realtimehook "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/realtime/useMatchRealtime.ts"
click node_realtime "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/realtime/matchRealtime.ts"
click node_playernotifications "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/notifications.tsx"
click node_organizerhome "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/index.tsx"
click node_organizercreate "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/create.tsx"
click node_organizerfixtures "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/fixtures.tsx"
click node_organizerregistrations "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/registrations.tsx"
click node_organizerapi "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/organizer/api.ts"
click node_adminreview "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(admin)/review.tsx"
click node_adminapi "https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/admin/api.ts"
click node_adminhome "https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(admin)/index.tsx"

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_authscreens,node_session,node_secure,node_client toneBlue
class node_playerpages,node_playerapi,node_playerprofile,node_results,node_friendlypages,node_friendlylogic,node_matchscreen,node_scoring,node_realtimehook,node_realtime,node_playernotifications toneAmber
class node_organizerhome,node_organizercreate,node_organizerfixtures,node_organizerregistrations,node_organizerapi,node_backend toneMint
class node_adminreview,node_adminapi,node_adminhome toneRose
class node_user toneIndigo
```

## Components

### Identity and API

- [Sign-in and workspace](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(auth)/login.tsx): `app/(auth)/login.tsx`
- [Session state](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/store/authStore.ts): `src/store/authStore.ts`
- [Secure session storage](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/services/secureStorage.ts): `src/services/secureStorage.ts`
- [Authenticated API client](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/apiClient.ts): `src/api/apiClient.ts`

### Player workflows

- [Tournament discovery and registration](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/tournaments.tsx): `app/(player)/tournaments.tsx`
- [Player data API](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/api.ts): `src/features/player/api.ts`
- [Player profile and achievements](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/profile.tsx): `app/(player)/profile.tsx`
- [Tournament results](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/tournamentResults.ts): `src/features/player/tournamentResults.ts`
- [Friendly Matches](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/friendly.tsx): `app/(player)/friendly.tsx`
- [Friendly match operations](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/friendly.ts): `src/features/player/friendly.ts`
- [Live match screen](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/matches/MatchScreen.tsx): `src/features/matches/MatchScreen.tsx`
- [Match scoring](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/player/scoring.ts): `src/features/player/scoring.ts`
- [Match realtime updates](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/realtime/useMatchRealtime.ts): `src/api/realtime/useMatchRealtime.ts`
- [Realtime subscription](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/api/realtime/matchRealtime.ts): `src/api/realtime/matchRealtime.ts`
- [Player notifications](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(player)/notifications.tsx): `app/(player)/notifications.tsx`

### Tournament operations

- [Organizer dashboard](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/index.tsx): `app/(organizer)/index.tsx`
- [Tournament creation](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/create.tsx): `app/(organizer)/create.tsx`
- [Fixture management](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/fixtures.tsx): `app/(organizer)/fixtures.tsx`
- [Registration management](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(organizer)/registrations.tsx): `app/(organizer)/registrations.tsx`
- [Organizer operations API](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/organizer/api.ts): `src/features/organizer/api.ts`

### Administration

- [Tournament review](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(admin)/review.tsx): `app/(admin)/review.tsx`
- [Admin API](https://github.com/kannadasanb1969/smashpointmobile/blob/main/src/features/admin/api.ts): `src/features/admin/api.ts`
- [Admin workspace](https://github.com/kannadasanb1969/smashpointmobile/blob/main/app/(admin)/index.tsx): `app/(admin)/index.tsx`

### Other components

- **Player or staff**
- **SmashPoint API**

## Connections

- Player or staff → Sign-in and workspace: signs in (evidence: `README.md`)
- Sign-in and workspace → Authenticated API client: requests auth (evidence: `app/(auth)/login.tsx`)
- Sign-in and workspace → Session state: sets session (evidence: `app/(auth)/login.tsx`)
- Session state → Secure session storage: persists tokens (evidence: `src/store/authStore.ts`)
- Authenticated API client → Secure session storage: reads tokens (evidence: `src/api/apiClient.ts`)
- Authenticated API client → Session state: refreshes session (evidence: `src/api/apiClient.ts`)
- Authenticated API client → SmashPoint API: sends requests (evidence: `README.md`)
- Tournament discovery and registration → Player data API: loads player data (evidence: `app/(player)/tournaments.tsx`)
- Player data API → Authenticated API client: uses client (evidence: `src/features/player/api.ts`)
- Tournament discovery and registration → Tournament results: shows results (evidence: `app/(player)/tournaments.tsx`)
- Player or staff → Player profile and achievements: manages profile (evidence: `README.md`)
- Player or staff → Friendly Matches: plays friendly matches (evidence: `README.md`)
- Friendly Matches → Friendly match operations: uses match operations (evidence: `app/(player)/friendly.tsx`)
- Friendly match operations → Authenticated API client: uses client (evidence: `src/features/player/friendly.ts`)
- Live match screen → Match scoring: uses scoring (evidence: `src/features/matches/MatchScreen.tsx`)
- Live match screen → Friendly match operations: uses match operations (evidence: `src/features/matches/MatchScreen.tsx`)
- Live match screen → Organizer operations API: uses match API (evidence: `src/features/matches/MatchScreen.tsx`)
- Live match screen → Match realtime updates: subscribes to updates (evidence: `src/features/matches/MatchScreen.tsx`)
- Match realtime updates → Realtime subscription: subscribes to match (evidence: `src/api/realtime/useMatchRealtime.ts`)
- Player or staff → Live match screen: follows live match (evidence: `README.md`)
- Player or staff → Player notifications: views notifications (evidence: `README.md`)
- Organizer dashboard → Organizer operations API: loads tournaments (evidence: `app/(organizer)/index.tsx`)
- Tournament creation → Organizer operations API: creates tournament (evidence: `app/(organizer)/create.tsx`)
- Fixture management → Organizer operations API: manages fixtures
- Registration management → Organizer operations API: manages registrations
- Organizer operations API → Authenticated API client: uses client (evidence: `src/features/organizer/api.ts`)
- Player or staff → Admin workspace: opens admin workspace (evidence: `README.md`)
- Admin workspace → Admin API: loads admin data (evidence: `app/(admin)/index.tsx`)
- Tournament review → Admin API: reviews tournament (evidence: `app/(admin)/review.tsx`)
- Admin API → Authenticated API client: uses client (evidence: `src/features/admin/api.ts`)
- Admin API → SmashPoint API: sends admin requests
