# rubenkaksh/khelam architecture

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

- Interactive diagram: https://gitdiagram.com/rubenkaksh/khelam
- Repository: https://github.com/rubenkaksh/khelam

## Overview

Khelam is a Flutter starter template with a themed authentication baseline, mockable auth and API examples, local storage, and a theme preview; the tree also shows a booking feature. README documents the intended layered feature workflow. The sampled source contains platform launch wrappers rather than Dart runtime code, so feature wiring and external-service details are not verified; uncertain links are omitted.

Main entry points: [`lib/app.dart`](https://github.com/rubenkaksh/khelam/blob/main/lib/app.dart) (App Shell), [`lib/features/home/views/home_view.dart`](https://github.com/rubenkaksh/khelam/blob/main/lib/features/home/views/home_view.dart) (Home View), [`lib/features/theme_preview/views/theme_preview_view.dart`](https://github.com/rubenkaksh/khelam/blob/main/lib/features/theme_preview/views/theme_preview_view.dart) (Theme Preview), [`lib/main.dart`](https://github.com/rubenkaksh/khelam/blob/main/lib/main.dart) (App Entry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application"]
  node_app_entry["App Entry<br/>[main.dart]"]
  node_app_shell["App Shell<br/>[app.dart]"]
  node_router["App Router<br/>[app_router.dart]"]
  node_home["Home View<br/>[home_view.dart]"]
end

subgraph group_auth["Authentication"]
  node_login["Login And Register<br/>[login_view.dart]"]
  node_auth_state["Auth State<br/>[auth_cubit.dart]"]
  node_auth_service["Auth Service<br/>[auth_service.dart]"]
  node_auth_api["Auth API"]
  node_token_store["Auth Token Store"]
end

subgraph group_booking["Booking"]
  node_booking_turf["Turf Selection"]
  node_turf_state["Turf Selection State"]
  node_turf_repository["Turf Repository"]
  node_turf_api["Turf API Repository"]
  node_schedule["Schedule View<br/>[schedule_view.dart]"]
  node_schedule_state["Schedule State"]
  node_booking_api["Booking API"]
end

subgraph group_shared["Shared UI And Storage"]
  node_theme_preview["Theme Preview"]
  node_app_theme["App Theme<br/>[app_theme.dart]"]
  node_preferences["Preferences<br/>[preferences.dart]"]
  node_preferences_impl["Preferences Adapter"]
end

node_user(("User"))

node_user -->|"uses"| node_login
node_user -->|"uses"| node_home
node_app_entry -->|"starts"| node_app_shell
node_app_shell -->|"configures"| node_router
node_user -->|"selects turf"| node_booking_turf
node_user -->|"views schedule"| node_schedule
node_home -->|"opens preview"| node_theme_preview
node_theme_preview -->|"uses theme"| node_app_theme

click node_app_entry "https://github.com/rubenkaksh/khelam/blob/main/lib/main.dart"
click node_app_shell "https://github.com/rubenkaksh/khelam/blob/main/lib/app.dart"
click node_router "https://github.com/rubenkaksh/khelam/blob/main/lib/ui/navigation/app_router.dart"
click node_home "https://github.com/rubenkaksh/khelam/blob/main/lib/features/home/views/home_view.dart"
click node_login "https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/views/login_view.dart"
click node_auth_state "https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/bloc/auth_cubit.dart"
click node_auth_service "https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/auth_service.dart"
click node_auth_api "https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/data/auth_api_service.dart"
click node_token_store "https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/data/auth_token_store.dart"
click node_booking_turf "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/views/turf_selection_view.dart"
click node_turf_state "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/bloc/turf_selection_cubit.dart"
click node_turf_repository "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/data/turfs_repository.dart"
click node_turf_api "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/data/turfs_api_repository.dart"
click node_schedule "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/views/schedule_view.dart"
click node_schedule_state "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/bloc/schedule_cubit.dart"
click node_booking_api "https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/data/booking_api_service.dart"
click node_theme_preview "https://github.com/rubenkaksh/khelam/blob/main/lib/features/theme_preview/views/theme_preview_view.dart"
click node_app_theme "https://github.com/rubenkaksh/khelam/blob/main/lib/ui/core/app_theme.dart"
click node_preferences "https://github.com/rubenkaksh/khelam/blob/main/lib/data/storage/preferences.dart"
click node_preferences_impl "https://github.com/rubenkaksh/khelam/blob/main/lib/data/storage/preferences_impl.dart"

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_entry,node_app_shell,node_router,node_home,node_user toneBlue
class node_login,node_auth_state,node_auth_service,node_auth_api,node_token_store toneAmber
class node_booking_turf,node_turf_state,node_turf_repository,node_turf_api,node_schedule,node_schedule_state,node_booking_api toneMint
class node_theme_preview,node_app_theme,node_preferences,node_preferences_impl toneRose
```

## Components

### Application

- [App Entry](https://github.com/rubenkaksh/khelam/blob/main/lib/main.dart): `lib/main.dart`
- [App Shell](https://github.com/rubenkaksh/khelam/blob/main/lib/app.dart): `lib/app.dart`
- [App Router](https://github.com/rubenkaksh/khelam/blob/main/lib/ui/navigation/app_router.dart): `lib/ui/navigation/app_router.dart`
- [Home View](https://github.com/rubenkaksh/khelam/blob/main/lib/features/home/views/home_view.dart): `lib/features/home/views/home_view.dart`

### Authentication

- [Login And Register](https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/views/login_view.dart): `lib/features/auth/views/login_view.dart`
- [Auth State](https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/bloc/auth_cubit.dart): `lib/features/auth/bloc/auth_cubit.dart`
- [Auth Service](https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/auth_service.dart): `lib/features/auth/auth_service.dart`
- [Auth API](https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/data/auth_api_service.dart): `lib/features/auth/data/auth_api_service.dart`
- [Auth Token Store](https://github.com/rubenkaksh/khelam/blob/main/lib/features/auth/data/auth_token_store.dart): `lib/features/auth/data/auth_token_store.dart`

### Booking

- [Turf Selection](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/views/turf_selection_view.dart): `lib/features/booking/views/turf_selection_view.dart`
- [Turf Selection State](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/bloc/turf_selection_cubit.dart): `lib/features/booking/bloc/turf_selection_cubit.dart`
- [Turf Repository](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/data/turfs_repository.dart): `lib/features/booking/data/turfs_repository.dart`
- [Turf API Repository](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/data/turfs_api_repository.dart): `lib/features/booking/data/turfs_api_repository.dart`
- [Schedule View](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/views/schedule_view.dart): `lib/features/booking/views/schedule_view.dart`
- [Schedule State](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/bloc/schedule_cubit.dart): `lib/features/booking/bloc/schedule_cubit.dart`
- [Booking API](https://github.com/rubenkaksh/khelam/blob/main/lib/features/booking/data/booking_api_service.dart): `lib/features/booking/data/booking_api_service.dart`

### Shared UI And Storage

- [Theme Preview](https://github.com/rubenkaksh/khelam/blob/main/lib/features/theme_preview/views/theme_preview_view.dart): `lib/features/theme_preview/views/theme_preview_view.dart`
- [App Theme](https://github.com/rubenkaksh/khelam/blob/main/lib/ui/core/app_theme.dart): `lib/ui/core/app_theme.dart`
- [Preferences](https://github.com/rubenkaksh/khelam/blob/main/lib/data/storage/preferences.dart): `lib/data/storage/preferences.dart`
- [Preferences Adapter](https://github.com/rubenkaksh/khelam/blob/main/lib/data/storage/preferences_impl.dart): `lib/data/storage/preferences_impl.dart`

### Other components

- **User**

## Connections

- User → Login And Register: uses
- User → Home View: uses
- App Entry → App Shell: starts
- App Shell → App Router: configures
- User → Turf Selection: selects turf
- User → Schedule View: views schedule
- Home View → Theme Preview: opens preview
- Theme Preview → App Theme: uses theme
