# mohammedjaasir/upl architecture

> Architecture diagram of the GitHub repository mohammedjaasir/upl, 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/mohammedjaasir/upl
- Repository: https://github.com/mohammedjaasir/upl

## Overview

Miella Super League is a player-registration web app. A player enters personal details, completes a cricket profile and kit selection (including a photo), reviews the entries, and submits. The page coordinates step navigation, validation, and submission; the service uploads the photo and inserts the registration details into Supabase. The README documents the private photo bucket, insert-only table policies, and no readback. The graph reflects documented behavior and shown imports/calls; some component internals and backend wiring are not excerpted.

Main entry points: [`src/features/registration/RegistrationPage.tsx`](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/RegistrationPage.tsx) (Registration Page), [`src/features/registration/components/ProfileStep.tsx`](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ProfileStep.tsx) (Profile Step), [`src/services/registrationService.ts`](https://github.com/mohammedjaasir/upl/blob/main/src/services/registrationService.ts) (Registration Service), [`src/features/registration/validation.ts`](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/validation.ts) (Validation & Normalize)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_registration_flow["Registration Flow"]
  node_registration_page["Registration Page"]
  node_personal_step["Personal Info Step"]
  node_profile_step["Profile Step<br/>[ProfileStep.tsx]"]
  node_review_step["Review Step<br/>[ReviewStep.tsx]"]
  node_success_screen["Success Screen<br/>[SuccessScreen.tsx]"]
  node_step_indicator["Step Indicator<br/>[StepIndicator.tsx]"]
end

subgraph group_form_domain["Form Domain"]
  node_form_state["Form State"]
  node_validation["Validation &amp; Normalize<br/>[validation.ts]"]
  node_step_definitions["Step Definitions<br/>[steps.ts]"]
  node_field_controls["Field Controls<br/>[Field.tsx]"]
  node_choice_group["Choice Group<br/>[ChoiceGroup.tsx]"]
  node_kit_fields["Kit Fields<br/>[KitFields.tsx]"]
  node_photo_upload["Photo Upload<br/>[PhotoUpload.tsx]"]
  node_jersey_preview["Jersey Preview<br/>[JerseyPreview.tsx]"]
  node_photo_preview["Photo Preview<br/>[usePhotoPreview.ts]"]
  node_session_storage[("Session Draft")]
end

subgraph group_submission_backend["Submission Backend"]
  node_registration_service["Registration Service"]
  node_supabase_client["Supabase Client<br/>[supabase.ts]"]
  node_photo_bucket[("Photo Bucket")]
  node_registration_table[("Registration Table")]
end

subgraph group_persistence_setup["Persistence Setup"]
  node_migration_policies["Schema &amp; Policies"]
end

node_player(("Player"))

node_player -->|"enters details"| node_registration_page
node_registration_page -->|"renders"| node_personal_step
node_registration_page -->|"renders"| node_profile_step
node_registration_page -->|"renders"| node_review_step
node_registration_page -->|"renders"| node_success_screen
node_registration_page -->|"renders"| node_step_indicator
node_registration_page -->|"uses state"| node_form_state
node_registration_page -->|"creates preview"| node_photo_preview
node_registration_page -->|"routes fields"| node_step_definitions
node_registration_page -->|"builds payload"| node_validation
node_registration_page -->|"submits registration"| node_registration_service
node_form_state -->|"validates fields"| node_validation
node_form_state -->|"saves text draft"| node_session_storage
node_personal_step -->|"renders choices"| node_choice_group
node_personal_step -->|"renders fields"| node_field_controls
node_profile_step -->|"renders choices"| node_choice_group
node_profile_step -->|"renders kit inputs"| node_kit_fields
node_profile_step -->|"renders photo input"| node_photo_upload
node_profile_step -->|"renders preview"| node_jersey_preview
node_review_step -->|"formats review"| node_validation
node_photo_upload -->|"checks photo"| node_validation
node_registration_service -->|"gets client"| node_supabase_client
node_registration_service -->|"uploads photo"| node_photo_bucket
node_registration_service -->|"inserts details"| node_registration_table
node_migration_policies -->|"creates bucket"| node_photo_bucket
node_migration_policies -->|"creates table"| node_registration_table

click node_registration_page "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/RegistrationPage.tsx"
click node_personal_step "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/PersonalInfoStep.tsx"
click node_profile_step "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ProfileStep.tsx"
click node_review_step "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ReviewStep.tsx"
click node_success_screen "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/SuccessScreen.tsx"
click node_step_indicator "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/StepIndicator.tsx"
click node_form_state "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/useRegistrationForm.ts"
click node_validation "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/validation.ts"
click node_step_definitions "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/steps.ts"
click node_field_controls "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/Field.tsx"
click node_choice_group "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ChoiceGroup.tsx"
click node_kit_fields "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/KitFields.tsx"
click node_photo_upload "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/PhotoUpload.tsx"
click node_jersey_preview "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/JerseyPreview.tsx"
click node_photo_preview "https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/usePhotoPreview.ts"
click node_registration_service "https://github.com/mohammedjaasir/upl/blob/main/src/services/registrationService.ts"
click node_supabase_client "https://github.com/mohammedjaasir/upl/blob/main/src/lib/supabase.ts"
click node_migration_policies "https://github.com/mohammedjaasir/upl/blob/main/supabase/migrations/20261001000000_player_registrations.sql"

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_registration_page,node_personal_step,node_profile_step,node_review_step,node_success_screen,node_step_indicator toneBlue
class node_form_state,node_validation,node_step_definitions,node_field_controls,node_choice_group,node_kit_fields,node_photo_upload,node_jersey_preview,node_photo_preview,node_session_storage toneAmber
class node_registration_service,node_supabase_client,node_photo_bucket,node_registration_table toneMint
class node_migration_policies toneRose
class node_player toneIndigo
```

## Components

### Registration Flow

- [Registration Page](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/RegistrationPage.tsx): `src/features/registration/RegistrationPage.tsx`
- [Personal Info Step](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/PersonalInfoStep.tsx): `src/features/registration/components/PersonalInfoStep.tsx`
- [Profile Step](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ProfileStep.tsx): `src/features/registration/components/ProfileStep.tsx`
- [Review Step](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ReviewStep.tsx): `src/features/registration/components/ReviewStep.tsx`
- [Success Screen](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/SuccessScreen.tsx): `src/features/registration/components/SuccessScreen.tsx`
- [Step Indicator](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/StepIndicator.tsx): `src/features/registration/components/StepIndicator.tsx`

### Form Domain

- [Form State](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/useRegistrationForm.ts): `src/features/registration/useRegistrationForm.ts`
- [Validation & Normalize](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/validation.ts): `src/features/registration/validation.ts`
- [Step Definitions](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/steps.ts): `src/features/registration/steps.ts`
- [Field Controls](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/Field.tsx): `src/features/registration/components/Field.tsx`
- [Choice Group](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/ChoiceGroup.tsx): `src/features/registration/components/ChoiceGroup.tsx`
- [Kit Fields](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/KitFields.tsx): `src/features/registration/components/KitFields.tsx`
- [Photo Upload](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/PhotoUpload.tsx): `src/features/registration/components/PhotoUpload.tsx`
- [Jersey Preview](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/components/JerseyPreview.tsx): `src/features/registration/components/JerseyPreview.tsx`
- [Photo Preview](https://github.com/mohammedjaasir/upl/blob/main/src/features/registration/usePhotoPreview.ts): `src/features/registration/usePhotoPreview.ts`
- **Session Draft**

### Submission Backend

- [Registration Service](https://github.com/mohammedjaasir/upl/blob/main/src/services/registrationService.ts): `src/services/registrationService.ts`
- [Supabase Client](https://github.com/mohammedjaasir/upl/blob/main/src/lib/supabase.ts): `src/lib/supabase.ts`
- **Photo Bucket**
- **Registration Table**

### Persistence Setup

- [Schema & Policies](https://github.com/mohammedjaasir/upl/blob/main/supabase/migrations/20261001000000_player_registrations.sql): `supabase/migrations/20261001000000_player_registrations.sql`

### Other components

- **Player**

## Connections

- Player → Registration Page: enters details (evidence: `README.md`)
- Registration Page → Personal Info Step: renders (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Profile Step: renders (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Review Step: renders (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Success Screen: renders (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Step Indicator: renders (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Form State: uses state (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Photo Preview: creates preview (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Step Definitions: routes fields (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Validation & Normalize: builds payload (evidence: `src/features/registration/RegistrationPage.tsx`)
- Registration Page → Registration Service: submits registration (evidence: `src/features/registration/RegistrationPage.tsx`)
- Form State → Validation & Normalize: validates fields (evidence: `src/features/registration/useRegistrationForm.ts`)
- Form State → Session Draft: saves text draft (evidence: `src/features/registration/useRegistrationForm.ts`)
- Personal Info Step → Choice Group: renders choices (evidence: `src/features/registration/components/PersonalInfoStep.tsx`)
- Personal Info Step → Field Controls: renders fields (evidence: `src/features/registration/components/PersonalInfoStep.tsx`)
- Profile Step → Choice Group: renders choices (evidence: `src/features/registration/components/ProfileStep.tsx`)
- Profile Step → Kit Fields: renders kit inputs (evidence: `src/features/registration/components/ProfileStep.tsx`)
- Profile Step → Photo Upload: renders photo input (evidence: `src/features/registration/components/ProfileStep.tsx`)
- Profile Step → Jersey Preview: renders preview (evidence: `src/features/registration/components/ProfileStep.tsx`)
- Review Step → Validation & Normalize: formats review (evidence: `src/features/registration/components/ReviewStep.tsx`)
- Photo Upload → Validation & Normalize: checks photo (evidence: `src/features/registration/components/PhotoUpload.tsx`)
- Registration Service → Supabase Client: gets client (evidence: `src/services/registrationService.ts`)
- Registration Service → Photo Bucket: uploads photo (evidence: `README.md`)
- Registration Service → Registration Table: inserts details (evidence: `README.md`)
- Schema & Policies → Photo Bucket: creates bucket (evidence: `README.md`)
- Schema & Policies → Registration Table: creates table (evidence: `README.md`)
