# malikyakub/alisom-online-market architecture

> Architecture diagram of the GitHub repository malikyakub/alisom-online-market, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/malikyakub/alisom-online-market
- Repository: https://github.com/malikyakub/alisom-online-market

## Overview

##### Project type and purpose
- This is a full-stack e-commerce web application (“Alisom online market”) built as a single-page React/TypeScript front-end that uses Supabase as its backend (authentication, database, storage).
- The app provides both an Admin interface (product/category management, dashboards, customer listings) and a User interface (browsing, cart, checkout, account management).

##### File structure
- Top-level config: Dockerfile, .dockerignore, Vite config, tsconfig.json, package.json.
- Front-end code under `app/` – follows a Remix-style or React-Router folder-based routing convention (`app/routes/...`).
- UI components in `components/`; reusable hooks in `hooks/`; Supabase setup in `utils/supabase.ts`; static assets under `public/assets`.
- No custom backend code – the application relies entirely on the Supabase service.

##### README
- Focuses only on local setup and running the Vite dev server.

##### Main components
a. Client Application (React/TypeScript SPA)
- Routing Layer (app/routes) – Admin and User sub-routes
- UI Components library
- Business Logic/hooks layer (useAuth, useProducts, useUsers)
- Asset Delivery (public/assets)
b. Backend as a Service (Supabase)
- Authentication service
- PostgreSQL Database
- Storage (for images/assets if used)
c. DevOps / Deployment
- Vite dev server for local development
- Docker container (Dockerfile) for production build
- Hosting platform (e.g., Vercel, Netlify, self-hosted Docker)

##### Relationships and interactions
- Client → Supabase Auth: sign-up, login calls via Supabase SDK
- Client → Supabase Database: CRUD operations for products, categories, orders
- Client → Supabase Storage: optional fetch/upload of product images
- DevOps Pipeline → Docker build → Container Registry → Hosting

##### Architectural patterns & design principles
- Folder-based routing (React Router / Remix-style) to separate features
- Separation of concerns: UI in `components/`, data-fetch logic in `hooks/`, routing in `app/routes/`
- BaaS integration (no custom backend) for faster time-to-market and scalability
- Containerization for environment parity (local vs production)

##### Essential elements
- Component boundaries and labels

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Application
    subgraph "Client Application"
        direction TB
        ReactSPA["React SPA\n(app/routes + components + hooks)"]:::frontend
        RoutingLayer["Routing Layer\n(app/routes)"]:::frontend
        UIComponents["UI Components Library\n(components/)"]:::frontend
        HooksLayer["Business Logic / Hooks\n(hooks/)"]:::frontend
        AssetDelivery["Asset Delivery\n(public/assets/)"]:::frontend
    end

    %% Supabase BaaS
    subgraph "Supabase (BaaS Services)"
        direction TB
        SupabaseAuth["Supabase Auth"]:::backend
        SupabaseDB["Supabase Database\n(PostgreSQL)"]:::db
        SupabaseStorage["Supabase Storage"]:::backend
    end

    %% DevOps / Infrastructure
    subgraph "DevOps / Infrastructure"
        direction TB
        ViteDev["Vite Dev Server\n(vite.config.ts)"]:::infra
        DockerContainer["Docker Container\n(Dockerfile)"]:::infra
        Hosting["Hosting Platform"]:::infra
    end

    %% Project Config & Dependencies
    subgraph "Project Config & Dependencies"
        direction TB
        PackageJSON["package.json"]:::infra
        TSConfig["tsconfig.json"]:::infra
        GitIgnore[".gitignore"]:::infra
        Readme["README.md"]:::infra
    end

    %% Connections: Client to BaaS
    ReactSPA -->|"Auth SDK calls"| SupabaseAuth
    ReactSPA -->|"CRUD via SDK"| SupabaseDB
    ReactSPA -->|"Storage SDK calls"| SupabaseStorage

    %% DevOps flow
    ViteDev -->|"Local dev build"| ReactSPA
    DockerContainer -->|"Deploy container"| Hosting
    ViteDev -->|"Config loaded from"| PackageJSON

    %% Click Events
    click ReactSPA "https://github.com/malikyakub/alisom-online-market/tree/main/app/"
    click RoutingLayer "https://github.com/malikyakub/alisom-online-market/tree/main/app/routes/"
    click UIComponents "https://github.com/malikyakub/alisom-online-market/tree/main/components/"
    click HooksLayer "https://github.com/malikyakub/alisom-online-market/tree/main/hooks/"
    click AssetDelivery "https://github.com/malikyakub/alisom-online-market/tree/main/public/assets/"
    click SupabaseAuth "https://github.com/malikyakub/alisom-online-market/blob/main/utils/supabase.ts"
    click SupabaseDB "https://github.com/malikyakub/alisom-online-market/blob/main/utils/supabase.ts"
    click SupabaseStorage "https://github.com/malikyakub/alisom-online-market/blob/main/utils/supabase.ts"
    click ViteDev "https://github.com/malikyakub/alisom-online-market/blob/main/vite.config.ts"
    click DockerContainer "https://github.com/malikyakub/alisom-online-market/tree/main/Dockerfile"
    click PackageJSON "https://github.com/malikyakub/alisom-online-market/blob/main/package.json"
    click TSConfig "https://github.com/malikyakub/alisom-online-market/blob/main/tsconfig.json"
    click GitIgnore "https://github.com/malikyakub/alisom-online-market/blob/main/.gitignore"
    click Readme "https://github.com/malikyakub/alisom-online-market/blob/main/README.md"

    %% Styles
    classDef frontend fill:#bbdefb,stroke:#0d47a1,color:#0d47a1
    classDef backend fill:#e1bee7,stroke:#4a148c,color:#4a148c
    classDef db fill:#f3e5f5,stroke:#6a1b9a,color:#6a1b9a
    classDef infra fill:#cfd8dc,stroke:#37474f,color:#37474f
```
