# khalilsoft45/sala7li-support architecture

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

- Interactive diagram: https://gitdiagram.com/khalilsoft45/sala7li-support
- Repository: https://github.com/khalilsoft45/sala7li-support

## Overview

1. This repository is a full-stack service platform, not just a brochure site. The README describes an Angular/Nebular stack, but the actual codebase is a React/TypeScript app built with Vite, TanStack Router, Bun, Drizzle, and SQLite.

2. The app is split into two main experiences: a public-facing marketing site and a logged-in operational dashboard. The public site lives in the home and layout components, while the dashboard is organized under `src/routes/app.*` with pages for advice, diagnosis, payments, tickets, users, profile, settings, and reclamations.

3. Routing is file-based through TanStack Router. `src/routes/__root.tsx`, `src/routes/index.tsx`, and the `app.*` route files define the navigation structure, and `src/routeTree.gen.ts` is the generated route map that ties the whole client-side navigation together.

4. The landing page is assembled from reusable section components in `src/components/home` plus shared layout pieces like `Navbar` and `Footer`. This makes the public site modular: hero, services, testimonials, FAQ, contact, and about are independent UI blocks rather than one monolithic page.

5. Core product interactions are surfaced through a small set of feature components: `AuthModal`, `NewRequestDialog`, `RequestQueue`, and `Badges`. These appear to support user onboarding, request submission, and operational triage for the support workflow.

6. There is a clear admin/editor boundary. `src/components/admin/LandingPageEditor.tsx` and `ImageUpload.tsx` suggest the marketing content is editable from inside the app, with uploads managed separately from the rest of the UI.

7. Backend logic is concentrated in `src/server`. `requests.ts`, `settings.ts`, and `konnect.ts` appear to encapsulate the business operations for request handling, app configuration, and payment-provider integration respectively. The presence of `app.payments.tsx` and `app.payment-success.tsx` indicates a payment flow wired into that server layer.

8. Persistence is SQLite-based, with schema and migrations managed by Drizzle. `src/db/schema.ts`, `src/db/index.ts`, the SQL migrations, and the checked-in `sqlite.db` file show that the database is a first-class part of the repository and likely used both for development and the app’s main data model.

9. File uploads are handled as a separate path. `src/routes/api/upload.ts` provides the API entry point, and `public/uploads` is the target for stored media, which keeps uploaded assets web-servable without routing them through the app runtime.

10. External integration points matter here. `src/lib/supabase.ts` indicates Supabase is used for some backend service such as auth, storage, or data access, while `src/server/konnect.ts` suggests a payments integration. These are the main non-local services shaping the architecture.

11. Shared application state and cross-cutting concerns live in `src/lib`: `useApp.tsx` for app context/state, `defaultSettings.ts` for baseline configuration, `i18n.tsx` for localization, and `types.ts`/`utils.ts` for common helpers. The `src/components/ui` folder is a shadcn-style component library used across the whole interface.

12. Deployment/tooling is oriented around a modern TypeScript web stack: Bun for package/runtime management, Vite for building, Drizzle for schema migrations, and `wrangler.jsonc` suggesting Cloudflare deployment support. `components.json`, ESLint, Prettier, and `tsconfig.json` round out the repo as a tightly controlled frontend-plus-server application.

Main entry points: [`src/routes/app.advice.tsx`](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.advice.tsx) (App pages), [`src/routeTree.gen.ts`](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routeTree.gen.ts) (Route tree), [`src/routes/index.tsx`](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/index.tsx) (Home page), [`src/routes/app.index.tsx`](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.index.tsx) (Dashboard home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_g_public["Public site"]
  node_n_public_home["Home page<br/>Landing route<br/>[index.tsx]"]
  node_n_public_layout["Navbar/Footer<br/>Public layout<br/>[Navbar.tsx]"]
  node_n_home_sections["Home sections<br/>Marketing blocks<br/>[HeroSection.tsx]"]
end

subgraph group_g_app["Dashboard"]
  node_n_app_shell["App shell<br/>Dashboard shell<br/>[AppShell.tsx]"]
  node_n_app_index["Dashboard home<br/>Dashboard route<br/>[app.index.tsx]"]
  node_n_workflow_ops["Ops workflow<br/>Support workflow UI<br/>[RequestQueue.tsx]"]
  node_n_auth_modal["Auth modal<br/>Onboarding UI<br/>[AuthModal.tsx]"]
  node_n_new_request["New request<br/>Request intake UI"]
  node_n_admin_tools["Admin tools<br/>Content admin UI"]
  node_n_app_routes["App pages<br/>Dashboard routes<br/>[app.advice.tsx]"]
  node_n_payment_flow["Payments<br/>Payment route flow<br/>[app.payments.tsx]"]
end

subgraph group_g_backend["Server logic"]
  node_n_upload_api["Upload API<br/>HTTP endpoint<br/>[upload.ts]"]
  node_n_server_requests["Requests<br/>Server module<br/>[requests.ts]"]
  node_n_server_settings["Settings<br/>Server module<br/>[settings.ts]"]
  node_n_server_konnect["Konnect<br/>Payments integration<br/>[konnect.ts]"]
  node_n_shared_supabase["Supabase<br/>External service client<br/>[supabase.ts]"]
end

subgraph group_g_data["Data layer"]
  node_n_db_schema["Schema<br/>[schema.ts]"]
  node_n_db_index[("DB access<br/>Database client<br/>[index.ts]")]
  node_n_migrations["Migrations"]
end

subgraph group_g_shared["Shared UI"]
  node_n_root_router["Router<br/>[router.tsx]"]
  node_n_route_tree["Route tree<br/>Generated routes<br/>[routeTree.gen.ts]"]
  node_n_root_route["Root route<br/>App shell route<br/>[__root.tsx]"]
  node_n_shared_state["App state<br/>Context/state<br/>[useApp.tsx]"]
  node_n_shared_i18n["i18n<br/>Localization<br/>[i18n.tsx]"]
  node_n_shared_ui["UI kit<br/>Component library<br/>[button.tsx]"]
end

node_n_root_router -->|"loads"| node_n_route_tree
node_n_route_tree -->|"includes"| node_n_root_route
node_n_route_tree -->|"includes"| node_n_public_home
node_n_route_tree -->|"includes"| node_n_app_routes
node_n_root_route -->|"wraps"| node_n_public_layout
node_n_public_home -->|"composes"| node_n_home_sections
node_n_public_layout -.->|"surrounds"| node_n_home_sections
node_n_app_routes -->|"uses"| node_n_app_shell
node_n_app_shell -->|"hosts"| node_n_app_index
node_n_app_index -->|"surfaces"| node_n_workflow_ops
node_n_workflow_ops -->|"opens"| node_n_auth_modal
node_n_workflow_ops -->|"creates"| node_n_new_request
node_n_app_routes -->|"includes"| node_n_payment_flow
node_n_payment_flow -->|"calls"| node_n_server_konnect
node_n_payment_flow -.->|"updates"| node_n_server_requests
node_n_admin_tools -->|"uploads"| node_n_upload_api
node_n_upload_api -.->|"integrates"| node_n_shared_supabase
node_n_server_requests -->|"persists"| node_n_db_index
node_n_server_settings -->|"persists"| node_n_db_index
node_n_db_index -->|"uses"| node_n_db_schema
node_n_db_schema -->|"evolves"| node_n_migrations
node_n_shared_state -.->|"coordinates"| node_n_shared_i18n
node_n_shared_state -.->|"feeds"| node_n_shared_ui
node_n_public_home -.->|"renders with"| node_n_shared_ui
node_n_app_index -.->|"renders with"| node_n_shared_ui
node_n_app_routes -->|"uses"| node_n_shared_state
node_n_app_routes -.->|"reads"| node_n_server_settings

click node_n_root_router "https://github.com/khalilsoft45/sala7li-support/blob/master/src/router.tsx"
click node_n_route_tree "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routeTree.gen.ts"
click node_n_root_route "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/__root.tsx"
click node_n_public_home "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/index.tsx"
click node_n_public_layout "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/layout/Navbar.tsx"
click node_n_home_sections "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/home/HeroSection.tsx"
click node_n_app_shell "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/AppShell.tsx"
click node_n_app_index "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.index.tsx"
click node_n_workflow_ops "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/RequestQueue.tsx"
click node_n_auth_modal "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/AuthModal.tsx"
click node_n_new_request "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/NewRequestDialog.tsx"
click node_n_admin_tools "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/admin/LandingPageEditor.tsx"
click node_n_app_routes "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.advice.tsx"
click node_n_payment_flow "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.payments.tsx"
click node_n_upload_api "https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/api/upload.ts"
click node_n_server_requests "https://github.com/khalilsoft45/sala7li-support/blob/master/src/server/requests.ts"
click node_n_server_settings "https://github.com/khalilsoft45/sala7li-support/blob/master/src/server/settings.ts"
click node_n_server_konnect "https://github.com/khalilsoft45/sala7li-support/blob/master/src/server/konnect.ts"
click node_n_db_schema "https://github.com/khalilsoft45/sala7li-support/blob/master/src/db/schema.ts"
click node_n_db_index "https://github.com/khalilsoft45/sala7li-support/blob/master/src/db/index.ts"
click node_n_migrations "https://github.com/khalilsoft45/sala7li-support/blob/master/src/db/migrations/0000_chief_prism.sql"
click node_n_shared_state "https://github.com/khalilsoft45/sala7li-support/blob/master/src/lib/useApp.tsx"
click node_n_shared_i18n "https://github.com/khalilsoft45/sala7li-support/blob/master/src/lib/i18n.tsx"
click node_n_shared_supabase "https://github.com/khalilsoft45/sala7li-support/blob/master/src/lib/supabase.ts"
click node_n_shared_ui "https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/ui/button.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_n_public_home,node_n_public_layout,node_n_home_sections toneBlue
class node_n_app_shell,node_n_app_index,node_n_workflow_ops,node_n_auth_modal,node_n_new_request,node_n_admin_tools,node_n_app_routes,node_n_payment_flow toneAmber
class node_n_upload_api,node_n_server_requests,node_n_server_settings,node_n_server_konnect,node_n_shared_supabase toneMint
class node_n_db_schema,node_n_db_index,node_n_migrations toneRose
class node_n_root_router,node_n_route_tree,node_n_root_route,node_n_shared_state,node_n_shared_i18n,node_n_shared_ui toneIndigo
```

## Components

### Public site

Marketing-facing pages and shared layout pieces.

- [Home page](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/index.tsx): Landing route · Public entry page for the marketing experience. · `src/routes/index.tsx`
- [Navbar/Footer](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/layout/Navbar.tsx): Public layout · Shared chrome for the marketing site. · `src/components/layout/Navbar.tsx`
- [Home sections](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/home/HeroSection.tsx): Marketing blocks · Reusable hero, services, testimonials, FAQ, contact, and about sections. · `src/components/home/HeroSection.tsx`

### Dashboard

Authenticated operational routes and product workflows.

- [App shell](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/AppShell.tsx): Dashboard shell · Shared authenticated frame around operational pages. · `src/components/AppShell.tsx`
- [Dashboard home](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.index.tsx): Dashboard route · Main logged-in landing page. · `src/routes/app.index.tsx`
- [Ops workflow](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/RequestQueue.tsx): Support workflow UI · Request intake, queueing, and status signaling components. · `src/components/RequestQueue.tsx`
- [Auth modal](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/AuthModal.tsx): Onboarding UI · Login or sign-up entry for user access. · `src/components/AuthModal.tsx`
- [New request](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/NewRequestDialog.tsx): Request intake UI · Dialog for creating support or service requests. · `src/components/NewRequestDialog.tsx`
- [Admin tools](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/admin/LandingPageEditor.tsx): Content admin UI · Editor and upload path for managed landing-page content. · `src/components/admin/LandingPageEditor.tsx`
- [App pages](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.advice.tsx): Dashboard routes · Operational routes for advice, diagnosis, payments, tickets, users, profile, settings, and reclamations. · `src/routes/app.advice.tsx`
- [Payments](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/app.payments.tsx): Payment route flow · Client payment pages, including success handling. · `src/routes/app.payments.tsx`

### Server logic

Business operations and external integrations.

- [Upload API](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/api/upload.ts): HTTP endpoint · Server route for handling file uploads. · `src/routes/api/upload.ts`
- [Requests](https://github.com/khalilsoft45/sala7li-support/blob/master/src/server/requests.ts): Server module · Core request-handling business logic. · `src/server/requests.ts`
- [Settings](https://github.com/khalilsoft45/sala7li-support/blob/master/src/server/settings.ts): Server module · Application configuration and settings logic. · `src/server/settings.ts`
- [Konnect](https://github.com/khalilsoft45/sala7li-support/blob/master/src/server/konnect.ts): Payments integration · External payment-provider integration. · `src/server/konnect.ts`
- [Supabase](https://github.com/khalilsoft45/sala7li-support/blob/master/src/lib/supabase.ts): External service client · Client for a managed backend service. · `src/lib/supabase.ts`

### Data layer

SQLite persistence, schema, and migrations.

- [Schema](https://github.com/khalilsoft45/sala7li-support/blob/master/src/db/schema.ts): Drizzle schema · Database models and table definitions. · `src/db/schema.ts`
- [DB access](https://github.com/khalilsoft45/sala7li-support/blob/master/src/db/index.ts): Database client · Database connection and persistence entry point. · `src/db/index.ts`
- [Migrations](https://github.com/khalilsoft45/sala7li-support/blob/master/src/db/migrations/0000_chief_prism.sql): SQL migrations · Versioned SQLite migration set. · `src/db/migrations/0000_chief_prism.sql`

### Shared UI

Reusable application state, utilities, and component library.

- [Router](https://github.com/khalilsoft45/sala7li-support/blob/master/src/router.tsx): TanStack Router setup · Client-side navigation entry and route composition. · `src/router.tsx`
- [Route tree](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routeTree.gen.ts): Generated routes · Generated route map that wires the file-based routes together. · `src/routeTree.gen.ts`
- [Root route](https://github.com/khalilsoft45/sala7li-support/blob/master/src/routes/__root.tsx): App shell route · Top-level route wrapper for the client app. · `src/routes/__root.tsx`
- [App state](https://github.com/khalilsoft45/sala7li-support/blob/master/src/lib/useApp.tsx): Context/state · Cross-cutting application context and shared state. · `src/lib/useApp.tsx`
- [i18n](https://github.com/khalilsoft45/sala7li-support/blob/master/src/lib/i18n.tsx): Localization · Translation and locale support. · `src/lib/i18n.tsx`
- [UI kit](https://github.com/khalilsoft45/sala7li-support/blob/master/src/components/ui/button.tsx): Component library · Reusable shadcn-style UI primitives used across the app. · `src/components/ui/button.tsx`

## Connections

- Router → Route tree: loads · Router uses the generated route map.
- Route tree → Root route: includes · Generated tree binds the root route.
- Route tree → Home page: includes · Generated tree binds the landing page route.
- Route tree → App pages: includes · Generated tree binds dashboard routes.
- Root route → Navbar/Footer: wraps · Root route provides shared public chrome.
- Home page → Home sections: composes · Landing page is built from modular section components.
- Navbar/Footer → Home sections: surrounds · Navbar and footer frame the public sections.
- App pages → App shell: uses · Operational routes are rendered inside the app shell.
- App shell → Dashboard home: hosts · App shell contains the dashboard home.
- Dashboard home → Ops workflow: surfaces · Dashboard home exposes request and queue workflows.
- Ops workflow → Auth modal: opens · Auth entry is part of the user onboarding flow.
- Ops workflow → New request: creates · Requests are submitted through the new-request dialog.
- App pages → Payments: includes · Dedicated routes handle payment interactions.
- Payments → Konnect: calls · Payment pages depend on the payment-provider integration.
- Payments → Requests: updates · Payments connect back to operational request logic.
- Admin tools → Upload API: uploads · Content editing uses the upload endpoint for media assets.
- Upload API → Supabase: integrates · Upload handling may rely on external backend services.
- Requests → DB access: persists · Request operations read and write through the database layer.
- Settings → DB access: persists · Settings are stored through the database layer.
- DB access → Schema: uses · Database access is driven by the schema definitions.
- Schema → Migrations: evolves · Migrations maintain the schema over time.
- App state → i18n: coordinates · Shared app state works alongside localization.
- App state → UI kit: feeds · UI primitives are used throughout the application stateful screens.
- Home page → UI kit: renders with · Landing content uses the shared UI kit.
- Dashboard home → UI kit: renders with · Dashboard screens are built from shared UI primitives.
- App pages → App state: uses · Operational pages share common app context.
- App pages → Settings: reads · Dashboard pages depend on application settings.
