# kevin-pro123/agenda architecture

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

- Interactive diagram: https://gitdiagram.com/kevin-pro123/agenda
- Repository: https://github.com/kevin-pro123/agenda

## Overview

##### Project type and purpose
- This is a serverless full-stack “Agenda” application built with React (TypeScript) on the front end and Supabase (Postgres + Auth) on the back end.
- Its core features are CRUD for contacts and appointments, backed by Supabase tables and migrations.

##### File structure
- Top-level:
- src/ – React entry points (main.tsx, App.tsx), components, styling, types, and a Supabase client in src/lib/supabase.ts
- supabase/ – SQL migrations for contacts and appointments
- config files – vite.config.ts, tsconfig*.json, tailwind.config.js, postcss.config.js, eslint.config.js
- index.html, package.json, .env (user-provided)
- The src/components folder contains UI pieces (AppointmentForm/List, ContactForm/List, AuthModal) following a component-based UI pattern.
- No custom backend code—Supabase is used as an external service for database and auth.

##### README
- Confirms environment variables: VITE_SUPABASE_URL and VITE_SUPABASE_ANON_KEY
- Standard install and dev commands: npm i, npm run dev

##### Final reminder
- Be exhaustive: capture all major pieces (UI, data library, services, config)
- Maintain readability: spacing, alignment, and consistent notation

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Tier
    subgraph "Frontend Tier"
        Browser["User Browser"]:::frontend
        Vite["Vite Dev Server / Static Host"]:::frontend
        IndexHTML["index.html"]:::frontend
        ReactApp["React Application"]:::frontend

        subgraph "Entry Points"
            MainTSX["src/main.tsx"]:::frontend
            AppTSX["src/App.tsx"]:::frontend
        end

        subgraph "UI Components"
            AppointmentForm["AppointmentForm Component"]:::frontend
            AppointmentList["AppointmentList Component"]:::frontend
            ContactForm["ContactForm Component"]:::frontend
            ContactList["ContactList Component"]:::frontend
            AuthModal["AuthModal Component"]:::frontend
        end

        subgraph "Styling & Assets"
            GlobalCSS["src/index.css"]:::config
            TailwindConfig["tailwind.config.js"]:::config
            PostCSSConfig["postcss.config.js"]:::config
        end
    end

    %% Build & Dev Tools
    subgraph "Build & Dev Tools"
        ViteConfig["vite.config.ts"]:::config
        TSConfig1["tsconfig.json"]:::config
        TSConfig2["tsconfig.app.json"]:::config
        TSConfig3["tsconfig.node.json"]:::config
        ESLint["eslint.config.js"]:::config
    end

    %% Data-access Layer
    subgraph "Data-access Layer"
        SupabaseClient["Supabase Client Library"]:::dataaccess
        Types["Type Definitions"]:::dataaccess
    end

    %% Backend Services (Supabase)
    subgraph "Backend Services (Supabase)"
        AuthService["Supabase Auth Service"]:::backend
        PostgresDB["Supabase Postgres DB"]:::backend
    end

    %% Migrations (Infra-as-Code)
    subgraph "Migrations (Infra-as-Code)"
        MigrateContacts["20251013211106_create_contacts_table.sql"]:::config
        MigrateAppointments["20251014215214_create_appointments_table.sql"]:::config
    end

    %% Connections
    Browser --> ReactApp
    Vite --> IndexHTML
    IndexHTML --> ReactApp
    MainTSX --> ReactApp
    AppTSX --> ReactApp
    ReactApp --> AppointmentForm
    ReactApp --> AppointmentList
    ReactApp --> ContactForm
    ReactApp --> ContactList
    ReactApp --> AuthModal
    ReactApp --> GlobalCSS
    ReactApp --> SupabaseClient
    SupabaseClient --> AuthService
    SupabaseClient --> PostgresDB
    Types --> SupabaseClient
    MigrateContacts --> PostgresDB
    MigrateAppointments --> PostgresDB
    ViteConfig --> Vite
    TSConfig1 --> Vite
    TSConfig2 --> Vite
    TSConfig3 --> Vite
    ESLint --> ReactApp

    %% Click Events
    click MainTSX "https://github.com/kevin-pro123/agenda/blob/main/src/main.tsx"
    click AppTSX "https://github.com/kevin-pro123/agenda/blob/main/src/App.tsx"
    click AppointmentForm "https://github.com/kevin-pro123/agenda/blob/main/src/components/AppointmentForm.tsx"
    click AppointmentList "https://github.com/kevin-pro123/agenda/blob/main/src/components/AppointmentList.tsx"
    click ContactForm "https://github.com/kevin-pro123/agenda/blob/main/src/components/ContactForm.tsx"
    click ContactList "https://github.com/kevin-pro123/agenda/blob/main/src/components/ContactList.tsx"
    click AuthModal "https://github.com/kevin-pro123/agenda/blob/main/src/components/AuthModal.tsx"
    click GlobalCSS "https://github.com/kevin-pro123/agenda/blob/main/src/index.css"
    click TailwindConfig "https://github.com/kevin-pro123/agenda/blob/main/tailwind.config.js"
    click PostCSSConfig "https://github.com/kevin-pro123/agenda/blob/main/postcss.config.js"
    click SupabaseClient "https://github.com/kevin-pro123/agenda/blob/main/src/lib/supabase.ts"
    click Types "https://github.com/kevin-pro123/agenda/blob/main/src/types/index.ts"
    click ViteConfig "https://github.com/kevin-pro123/agenda/blob/main/vite.config.ts"
    click TSConfig1 "https://github.com/kevin-pro123/agenda/blob/main/tsconfig.json"
    click TSConfig2 "https://github.com/kevin-pro123/agenda/blob/main/tsconfig.app.json"
    click TSConfig3 "https://github.com/kevin-pro123/agenda/blob/main/tsconfig.node.json"
    click ESLint "https://github.com/kevin-pro123/agenda/blob/main/eslint.config.js"
    click IndexHTML "https://github.com/kevin-pro123/agenda/blob/main/index.html"
    click MigrateContacts "https://github.com/kevin-pro123/agenda/blob/main/supabase/migrations/20251013211106_create_contacts_table.sql"
    click MigrateAppointments "https://github.com/kevin-pro123/agenda/blob/main/supabase/migrations/20251014215214_create_appointments_table.sql"

    %% Styles
    classDef frontend fill:#ADD8E6,stroke:#000,stroke-width:1px
    classDef dataaccess fill:#FFA500,stroke:#000,stroke-width:1px
    classDef backend fill:#90EE90,stroke:#000,stroke-width:1px
    classDef config fill:#D3D3D3,stroke:#000,stroke-width:1px
```
