# avoqato2/restyle architecture

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

- Interactive diagram: https://gitdiagram.com/avoqato2/restyle
- Repository: https://github.com/avoqato2/restyle

## Overview

ReStyle is an Ionic/Angular mobile wardrobe and outfit-planning app backed by Supabase. Users enter through routed authentication, then use wardrobe and styling features; the README also describes background removal and personalized outfit suggestions. The graph includes the documented feature branches, but their page-to-service wiring is not established by the excerpts, so those links are left unverified. Sampled source supports the app bootstrap, auth callback flow, and profile/garment data access; unsampled service details are not inferred.

Main entry points: [`frontend/src/app/supabase/services/auth/auth.service.ts`](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth.service.ts) (Auth service), [`frontend/src/app/app.routes.ts`](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/app.routes.ts) (App routes), [`frontend/src/app/supabase/supabase.client.ts`](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/supabase.client.ts) (Supabase client), [`frontend/src/app/supabase/services/outfit.service.ts`](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/outfit.service.ts) (Outfit service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["App navigation"]
  node_bootstrap["App bootstrap<br/>[main.ts]"]
  node_routes["App routes<br/>[app.routes.ts]"]
  node_app_component["Root app<br/>[app.component.ts]"]
end

subgraph group_auth["Identity"]
  node_auth_form["Login and signup<br/>[auth-form.page.ts]"]
  node_auth_service["Auth service<br/>[auth.service.ts]"]
  node_auth_callback["Callback parsing<br/>[auth-callback.ts]"]
  node_auth_errors["Auth errors<br/>[auth-errors.ts]"]
  node_auth_urls["Auth URLs<br/>[auth-urls.ts]"]
  node_auth_guards["Auth guards<br/>[guards.ts]"]
  node_confirmation["Email confirmation"]
end

subgraph group_wardrobe["Wardrobe and outfits"]
  node_home["Home<br/>[home.page.ts]"]
  node_wardrobe_page["Digital wardrobe<br/>[garderobe.page.ts]"]
  node_styling_page["Styling<br/>[styling.page.ts]"]
  node_looks_page["Looks<br/>[looks.page.ts]"]
  node_photo_service["Photo processing<br/>[photo.service.ts]"]
end

subgraph group_data["Data access"]
  node_garment_service["Garment service<br/>[garment.service.ts]"]
  node_outfit_service["Outfit service<br/>[outfit.service.ts]"]
  node_profile_service["Profile service<br/>[profile.service.ts]"]
  node_supabase_client["Supabase client<br/>[supabase.client.ts]"]
  node_db_types["Database types<br/>[supabase.types.ts]"]
end

node_user(("Mobile user"))
node_supabase[("Supabase backend")]
node_image_processing{{"Background removal"}}
node_recommendations{{"Outfit suggestions"}}

node_user -->|"opens app"| node_bootstrap
node_bootstrap -->|"registers routes"| node_routes
node_bootstrap -->|"starts"| node_app_component
node_routes -->|"routes to"| node_auth_form
node_routes -->|"routes to"| node_home
node_routes -->|"routes to"| node_wardrobe_page
node_routes -->|"routes to"| node_styling_page
node_routes -->|"routes to"| node_looks_page
node_routes -->|"routes to"| node_confirmation
node_auth_form -->|"authenticates with"| node_auth_service
node_auth_guards -->|"checks session"| node_auth_service
node_app_component -->|"handles callbacks"| node_auth_service
node_auth_service -->|"parses callback"| node_auth_callback
node_auth_service -->|"maps errors"| node_auth_errors
node_auth_service -->|"builds links"| node_auth_urls
node_auth_service -->|"uses client"| node_supabase_client
node_home -->|"loads profile"| node_profile_service
node_garment_service -->|"uses client"| node_supabase_client
node_profile_service -->|"uses client"| node_supabase_client
node_outfit_service -->|"uses client"| node_supabase_client
node_supabase_client -->|"types client"| node_db_types
node_auth_service -.->|"auth requests"| node_supabase
node_garment_service -->|"reads and writes"| node_supabase
node_profile_service -->|"reads and writes"| node_supabase
node_outfit_service -.->|"reads and writes"| node_supabase
node_wardrobe_page -.->|"manages garments"| node_garment_service
node_styling_page -.->|"uses outfits"| node_outfit_service
node_looks_page -.->|"uses outfits"| node_outfit_service
node_photo_service -.->|"removes backgrounds"| node_image_processing
node_styling_page -.->|"shows suggestions"| node_recommendations

click node_bootstrap "https://github.com/avoqato2/restyle/blob/main/frontend/src/main.ts"
click node_routes "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/app.routes.ts"
click node_app_component "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/app.component.ts"
click node_auth_form "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/auth/auth-form/auth-form.page.ts"
click node_auth_service "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth.service.ts"
click node_auth_callback "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth-callback.ts"
click node_auth_errors "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth-errors.ts"
click node_auth_urls "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth-urls.ts"
click node_auth_guards "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/guards.ts"
click node_confirmation "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/auth/confirmation-mail/confirmation-mail.page.ts"
click node_home "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/home/home.page.ts"
click node_wardrobe_page "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/garderobe/garderobe.page.ts"
click node_styling_page "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/styling/styling.page.ts"
click node_looks_page "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/looks/looks.page.ts"
click node_photo_service "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/services/photo.service.ts"
click node_garment_service "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/garment.service.ts"
click node_outfit_service "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/outfit.service.ts"
click node_profile_service "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/profile.service.ts"
click node_supabase_client "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/supabase.client.ts"
click node_db_types "https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/supabase.types.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_bootstrap,node_routes,node_app_component,node_user toneBlue
class node_auth_form,node_auth_service,node_auth_callback,node_auth_errors,node_auth_urls,node_auth_guards,node_confirmation,node_supabase toneAmber
class node_home,node_wardrobe_page,node_styling_page,node_looks_page,node_photo_service toneMint
class node_garment_service,node_outfit_service,node_profile_service,node_supabase_client,node_db_types,node_image_processing toneRose
class node_recommendations toneIndigo
```

## Components

### App navigation

- [App bootstrap](https://github.com/avoqato2/restyle/blob/main/frontend/src/main.ts): `frontend/src/main.ts`
- [App routes](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/app.routes.ts): `frontend/src/app/app.routes.ts`
- [Root app](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/app.component.ts): `frontend/src/app/app.component.ts`

### Identity

- [Login and signup](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/auth/auth-form/auth-form.page.ts): `frontend/src/app/pages/auth/auth-form/auth-form.page.ts`
- [Auth service](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth.service.ts): `frontend/src/app/supabase/services/auth/auth.service.ts`
- [Callback parsing](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth-callback.ts): `frontend/src/app/supabase/services/auth/auth-callback.ts`
- [Auth errors](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth-errors.ts): `frontend/src/app/supabase/services/auth/auth-errors.ts`
- [Auth URLs](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/auth-urls.ts): `frontend/src/app/supabase/services/auth/auth-urls.ts`
- [Auth guards](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/auth/guards.ts): `frontend/src/app/supabase/services/auth/guards.ts`
- [Email confirmation](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/auth/confirmation-mail/confirmation-mail.page.ts): `frontend/src/app/pages/auth/confirmation-mail/confirmation-mail.page.ts`

### Wardrobe and outfits

- [Home](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/home/home.page.ts): `frontend/src/app/pages/home/home.page.ts`
- [Digital wardrobe](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/garderobe/garderobe.page.ts): `frontend/src/app/pages/garderobe/garderobe.page.ts`
- [Styling](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/styling/styling.page.ts): `frontend/src/app/pages/styling/styling.page.ts`
- [Looks](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/pages/looks/looks.page.ts): `frontend/src/app/pages/looks/looks.page.ts`
- [Photo processing](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/services/photo.service.ts): `frontend/src/app/services/photo.service.ts`

### Data access

- [Garment service](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/garment.service.ts): `frontend/src/app/supabase/services/garment.service.ts`
- [Outfit service](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/outfit.service.ts): `frontend/src/app/supabase/services/outfit.service.ts`
- [Profile service](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/services/profile.service.ts): `frontend/src/app/supabase/services/profile.service.ts`
- [Supabase client](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/supabase.client.ts): `frontend/src/app/supabase/supabase.client.ts`
- [Database types](https://github.com/avoqato2/restyle/blob/main/frontend/src/app/supabase/supabase.types.ts): `frontend/src/app/supabase/supabase.types.ts`

### Other components

- **Mobile user**
- **Supabase backend**
- **Background removal**
- **Outfit suggestions**

## Connections

- Mobile user → App bootstrap: opens app (evidence: `frontend/src/main.ts`)
- App bootstrap → App routes: registers routes (evidence: `frontend/src/main.ts`)
- App bootstrap → Root app: starts (evidence: `frontend/src/main.ts`)
- App routes → Login and signup: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Home: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Digital wardrobe: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Styling: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Looks: routes to (evidence: `frontend/src/app/app.routes.ts`)
- App routes → Email confirmation: routes to (evidence: `frontend/src/app/app.routes.ts`)
- Login and signup → Auth service: authenticates with (evidence: `frontend/src/app/pages/auth/auth-form/auth-form.page.ts`)
- Auth guards → Auth service: checks session (evidence: `frontend/src/app/supabase/services/auth/guards.ts`)
- Root app → Auth service: handles callbacks (evidence: `frontend/src/app/app.component.ts`)
- Auth service → Callback parsing: parses callback (evidence: `frontend/src/app/supabase/services/auth/auth.service.ts`)
- Auth service → Auth errors: maps errors (evidence: `frontend/src/app/supabase/services/auth/auth.service.ts`)
- Auth service → Auth URLs: builds links (evidence: `frontend/src/app/supabase/services/auth/auth.service.ts`)
- Auth service → Supabase client: uses client (evidence: `frontend/src/app/supabase/services/auth/auth.service.ts`)
- Home → Profile service: loads profile (evidence: `frontend/src/app/pages/home/home.page.ts`)
- Garment service → Supabase client: uses client (evidence: `frontend/src/app/supabase/services/garment.service.ts`)
- Profile service → Supabase client: uses client (evidence: `frontend/src/app/supabase/services/profile.service.ts`)
- Outfit service → Supabase client: uses client (evidence: `frontend/src/app/supabase/services/outfit.service.ts`)
- Supabase client → Database types: types client (evidence: `frontend/src/app/supabase/supabase.client.ts`)
- Auth service → Supabase backend: auth requests
- Garment service → Supabase backend: reads and writes (evidence: `frontend/src/app/supabase/services/garment.service.ts`)
- Profile service → Supabase backend: reads and writes (evidence: `frontend/src/app/supabase/services/profile.service.ts`)
- Outfit service → Supabase backend: reads and writes
- Digital wardrobe → Garment service: manages garments
- Styling → Outfit service: uses outfits
- Looks → Outfit service: uses outfits
- Photo processing → Background removal: removes backgrounds
- Styling → Outfit suggestions: shows suggestions
