# velzanava/lumine-backend architecture

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

- Interactive diagram: https://gitdiagram.com/velzanava/lumine-backend
- Repository: https://github.com/velzanava/lumine-backend

## Overview

Lumine Backend is a REST API for the Lumine Android/Unity AR jewelry try-on app. The main client workflow is to browse jewelry and retrieve item details for an AR try-on, then submit a rating; the API also handles authentication, profiles and favorites, catalog administration, and feedback summaries. Supabase provides authentication, database access, and image storage. The startup wiring and several controller excerpts are available; edges for unsampled controller behavior are omitted.

Main entry points: [`Program.cs`](https://github.com/velzanava/lumine-backend/blob/main/Program.cs) (API host), [`Services/SupabaseService.cs`](https://github.com/velzanava/lumine-backend/blob/main/Services/SupabaseService.cs) (Supabase client), [`Controllers/ProfileController.cs`](https://github.com/velzanava/lumine-backend/blob/main/Controllers/ProfileController.cs) (Profile and favorites), [`Controllers/AdminController.cs`](https://github.com/velzanava/lumine-backend/blob/main/Controllers/AdminController.cs) (User administration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["API workflows"]
  node_host["API host<br/>[Program.cs]"]
  node_auth["Authentication<br/>[AuthController.cs]"]
  node_profile["Profile and favorites"]
  node_jewelry["Jewelry catalog"]
  node_admin["User administration<br/>[AdminController.cs]"]
  node_evaluation["Try-on evaluation"]
end

subgraph group_services["Backend services"]
  node_jewelry_service["Catalog operations<br/>[JewelryService.cs]"]
  node_supabase_client["Supabase client<br/>[SupabaseService.cs]"]
end

subgraph group_models["Data contracts"]
  node_auth_models["Auth contracts<br/>[AuthModels.cs]"]
  node_profile_models["Profile and favorite records<br/>[ProfileModels.cs]"]
  node_jewelry_model["Jewelry record<br/>[Jewelry.cs]"]
  node_evaluation_models["Evaluation records"]
end

subgraph group_supabase["Supabase platform"]
  node_supabase_auth["Supabase Auth"]
  node_database[("Postgres database")]
  node_storage[("Supabase Storage")]
end

node_android(("Android app"))
node_admin_user(("Admin"))

node_host -->|"initializes"| node_supabase_client
node_host -->|"maps routes"| node_auth
node_host -->|"maps routes"| node_profile
node_host -->|"maps routes"| node_jewelry
node_host -->|"maps routes"| node_admin
node_host -->|"maps routes"| node_evaluation
node_android -->|"sends auth requests"| node_auth
node_android -->|"requests profile"| node_profile
node_android -->|"browses catalog"| node_jewelry
node_android -->|"submits rating"| node_evaluation
node_admin_user -->|"manages users"| node_admin
node_auth -->|"calls auth API"| node_supabase_auth
node_auth -->|"signs in"| node_supabase_client
node_profile -->|"reads and writes"| node_supabase_client
node_profile -->|"updates profiles"| node_database
node_profile -->|"uploads avatar"| node_storage
node_jewelry -->|"calls catalog operations"| node_jewelry_service
node_jewelry_service -->|"gets client"| node_supabase_client
node_supabase_client -->|"accesses records"| node_database
node_jewelry -->|"uploads jewelry image"| node_storage
node_admin -->|"manages auth users"| node_supabase_auth
node_admin -->|"reads and deletes records"| node_supabase_client
node_admin -->|"deletes avatar"| node_storage
node_evaluation -->|"reads and inserts"| node_supabase_client

click node_host "https://github.com/velzanava/lumine-backend/blob/main/Program.cs"
click node_auth "https://github.com/velzanava/lumine-backend/blob/main/Controllers/AuthController.cs"
click node_profile "https://github.com/velzanava/lumine-backend/blob/main/Controllers/ProfileController.cs"
click node_jewelry "https://github.com/velzanava/lumine-backend/blob/main/Controllers/JewelryController.cs"
click node_admin "https://github.com/velzanava/lumine-backend/blob/main/Controllers/AdminController.cs"
click node_evaluation "https://github.com/velzanava/lumine-backend/blob/main/Controllers/EvaluationController.cs"
click node_jewelry_service "https://github.com/velzanava/lumine-backend/blob/main/Services/JewelryService.cs"
click node_supabase_client "https://github.com/velzanava/lumine-backend/blob/main/Services/SupabaseService.cs"
click node_auth_models "https://github.com/velzanava/lumine-backend/blob/main/Models/AuthModels.cs"
click node_profile_models "https://github.com/velzanava/lumine-backend/blob/main/Models/ProfileModels.cs"
click node_jewelry_model "https://github.com/velzanava/lumine-backend/blob/main/Models/Jewelry.cs"
click node_evaluation_models "https://github.com/velzanava/lumine-backend/blob/main/Models/EvaluationModels.cs"

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_host,node_auth,node_profile,node_jewelry,node_admin,node_evaluation toneBlue
class node_jewelry_service,node_supabase_client toneAmber
class node_auth_models,node_profile_models,node_jewelry_model,node_evaluation_models toneMint
class node_supabase_auth,node_database,node_storage toneRose
class node_android,node_admin_user toneIndigo
```

## Components

### API workflows

- [API host](https://github.com/velzanava/lumine-backend/blob/main/Program.cs): `Program.cs`
- [Authentication](https://github.com/velzanava/lumine-backend/blob/main/Controllers/AuthController.cs): `Controllers/AuthController.cs`
- [Profile and favorites](https://github.com/velzanava/lumine-backend/blob/main/Controllers/ProfileController.cs): `Controllers/ProfileController.cs`
- [Jewelry catalog](https://github.com/velzanava/lumine-backend/blob/main/Controllers/JewelryController.cs): `Controllers/JewelryController.cs`
- [User administration](https://github.com/velzanava/lumine-backend/blob/main/Controllers/AdminController.cs): `Controllers/AdminController.cs`
- [Try-on evaluation](https://github.com/velzanava/lumine-backend/blob/main/Controllers/EvaluationController.cs): `Controllers/EvaluationController.cs`

### Backend services

- [Catalog operations](https://github.com/velzanava/lumine-backend/blob/main/Services/JewelryService.cs): `Services/JewelryService.cs`
- [Supabase client](https://github.com/velzanava/lumine-backend/blob/main/Services/SupabaseService.cs): `Services/SupabaseService.cs`

### Data contracts

- [Auth contracts](https://github.com/velzanava/lumine-backend/blob/main/Models/AuthModels.cs): `Models/AuthModels.cs`
- [Profile and favorite records](https://github.com/velzanava/lumine-backend/blob/main/Models/ProfileModels.cs): `Models/ProfileModels.cs`
- [Jewelry record](https://github.com/velzanava/lumine-backend/blob/main/Models/Jewelry.cs): `Models/Jewelry.cs`
- [Evaluation records](https://github.com/velzanava/lumine-backend/blob/main/Models/EvaluationModels.cs): `Models/EvaluationModels.cs`

### Supabase platform

- **Supabase Auth**
- **Postgres database**
- **Supabase Storage**

### Other components

- **Android app**
- **Admin**

## Connections

- API host → Supabase client: initializes
- API host → Authentication: maps routes
- API host → Profile and favorites: maps routes
- API host → Jewelry catalog: maps routes
- API host → User administration: maps routes
- API host → Try-on evaluation: maps routes
- Android app → Authentication: sends auth requests
- Android app → Profile and favorites: requests profile
- Android app → Jewelry catalog: browses catalog
- Android app → Try-on evaluation: submits rating
- Admin → User administration: manages users
- Authentication → Supabase Auth: calls auth API
- Authentication → Supabase client: signs in
- Profile and favorites → Supabase client: reads and writes
- Profile and favorites → Postgres database: updates profiles
- Profile and favorites → Supabase Storage: uploads avatar
- Jewelry catalog → Catalog operations: calls catalog operations
- Catalog operations → Supabase client: gets client
- Supabase client → Postgres database: accesses records
- Jewelry catalog → Supabase Storage: uploads jewelry image
- User administration → Supabase Auth: manages auth users
- User administration → Supabase client: reads and deletes records
- User administration → Supabase Storage: deletes avatar
- Try-on evaluation → Supabase client: reads and inserts
