# debangshucode/full-stack-web-application-creative-showcase architecture

> Architecture diagram of the GitHub repository debangshucode/full-stack-web-application-creative-showcase, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-02-11). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/debangshucode/full-stack-web-application-creative-showcase
- Repository: https://github.com/debangshucode/full-stack-web-application-creative-showcase

## Overview

##### Project type and purpose
- This is a modern full-stack Single Page Application (SPA) named “Creative Showcase.”
- Frontend: React + Vite + Tailwind CSS + OGL (WebGL hero effect).
- Backend: Supabase (Auth, PostgreSQL, Storage).
- Users can sign up/login, upload/manage images, view public galleries and profiles.

##### File structure
- Top-level files: package.json, Vite/TS/Tailwind configs, index.html.
- src/
- main.jsx & index.html → entry point, mounts React App.
- App.jsx → root router component.
- components/ → reusable UI (Header, Footer, HeroSection, ImageGrid, LightRays, ProtectedRoute, etc.).
- pages/ → route targets (LandingPage, LoginPage, SignUpPage, DashboardPage, PublicProfilePage).
- contexts/ → React Contexts (AuthContext for Supabase auth state, ThemeContext for dark/light).
- lib/supabase.js → initialized Supabase client.
- supabase/
- migrations/20251228083936_create_profiles_and_images_tables.sql → DB schema.
- .temp/ → local CLI metadata (project-ref, versions, URLs).
- Configuration: vite.config.ts, tsconfig*, tailwind.config.js, eslint.config.js, postcss.config.js.

##### README for architectural insights
- Confirms SPA with React Router, protected routes, RLS policies in the database.
- Supabase handles both authentication and data storage (Postgres + Storage buckets).
- DB triggers auto-create profiles on signup; RLS ensures row-level security.

##### Main components & relationships
a. Components
1. Client Browser (User’s device)
2. Static Host / CDN (e.g., Vercel) serving built SPA
3. React SPA
– React Router → route switching
– AuthContext → manages session with Supabase Auth
– ThemeContext → toggles dark/light mode
– Pages & Components → UI layers
4. Supabase Backend
– Authentication Service (GoTrue)
– PostgreSQL Database (profiles, images tables + RLS + triggers)
– Storage Bucket (images)
5. External Libraries/Services
– OGL (WebGL light rays)
– Toast notifications (react-hot-toast)
b. Relationships & Interactions
1. Browser → CDN: GET / → index.html + JS/CSS assets
2. React SPA → Supabase Auth: sign-up, login, session refresh
3. React SPA → Supabase DB:
– Query public galleries & user profiles (public RLS policy)
– Query/update user images in Dashboard (authenticated RLS policy)
4. React SPA → Supabase Storage:
– Upload image file → storage bucket
– Generate public URL → save to images table
– Delete image → remove from storage & DB
5. DB trigger → Auto-create profile row on new authenticated user
c. Architectural patterns & design principles
- SPA with client-side routing
- Context API for cross-cutting concerns (auth, theme)
- BaaS (Backend as a Service) via Supabase
- Row Level Security ensures authorization at data layer
- Component-based UI (atomic & page components)
d. Key technologies/frameworks
- React + React Router
- Vite bundler
- Tailwind CSS for styling
- Supabase (Auth, Postgres, Storage)
- OGL for WebGL effects
- react-hot-toast, lucide-react for UX

##### Essential details to capture
- Separation of concerns: hosting vs. client vs. backend services
- Contexts and routing within the SPA
- Supabase’s multiple roles (Auth, DB, Storage, RLS)
- Data-flow for image upload/download and profile creation

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Client & CDN"
        Browser["Client Browser"]:::client
        CDN["Static Host / CDN"]:::client
    end

    Browser -->|"GET /"| CDN
    CDN -->|"serves assets"| ReactSPA

    subgraph "React SPA"
        Main["Entry Point"]:::frontend
        Router["Root Router\n(src/App.jsx)"]:::frontend
        AuthCtx["AuthContext"]:::frontend
        ThemeCtx["ThemeContext"]:::frontend
        ProtectedRoute["ProtectedRoute"]:::frontend
        Header["Header"]:::frontend
        Footer["Footer"]:::frontend
        Hero["HeroSection"]:::frontend
        LightRays["LightRays"]:::frontend
        ImageGrid["ImageGrid"]:::frontend
        ImageCard["ImageCard"]:::frontend
        FullViewer["FullScreenViewer"]:::frontend
        LandingPage["LandingPage"]:::frontend
        LoginPage["LoginPage"]:::frontend
        SignUpPage["SignUpPage"]:::frontend
        DashboardPage["DashboardPage"]:::frontend
        PublicProfilePage["PublicProfilePage"]:::frontend
        SupabaseClient["Supabase Client Init"]:::frontend
    end

    Main --> ReactSPA
    ReactSPA --> Router
    Router --> LandingPage
    Router --> LoginPage
    Router --> SignUpPage
    Router --> DashboardPage
    Router --> PublicProfilePage

    ReactSPA --> AuthCtx
    ReactSPA --> ThemeCtx
    ReactSPA --> Header
    ReactSPA --> Footer
    LandingPage --> Hero
    Hero --> LightRays
    LandingPage --> ImageGrid
    ImageGrid --> ImageCard
    ImageCard --> FullViewer
    ReactSPA --> SupabaseClient

    subgraph "Supabase Backend"
        AuthService["Auth Service (GoTrue)"]:::backend
        Database["Postgres DB"]:::db
        Storage["Storage Bucket"]:::db
    end

    ReactSPA -->|"signUp(),signIn()"| AuthService
    AuthService -->|"DB trigger creates profile"| Database
    ReactSPA -->|"getImages(),getProfiles()"| Database
    ReactSPA -->|"uploadImage()"| Storage
    ReactSPA -->|"deleteImage()"| Storage
    Storage -->|"file metadata"| Database

    subgraph "Configuration Files"
        Vite["vite.config.ts"]:::config
        Tailwind["tailwind.config.js"]:::config
        PostCSS["postcss.config.js"]:::config
        ESLint["eslint.config.js"]:::config
        TSConfig["tsconfig*.json"]:::config
    end

    click Main "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/main.jsx"
    click Router "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/App.jsx"
    click AuthCtx "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/contexts/AuthContext.jsx"
    click ThemeCtx "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/contexts/ThemeContext.jsx"
    click ProtectedRoute "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/ProtectedRoute.jsx"
    click Header "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/Header.jsx"
    click Footer "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/Footer.jsx"
    click Hero "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/HeroSection.jsx"
    click LightRays "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/LightRays.jsx"
    click ImageGrid "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/ImageGrid.jsx"
    click ImageCard "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/ImageCard.jsx"
    click FullViewer "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/components/FullScreenViewer.jsx"
    click LandingPage "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/pages/LandingPage.jsx"
    click LoginPage "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/pages/LoginPage.jsx"
    click SignUpPage "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/pages/SignUpPage.jsx"
    click DashboardPage "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/pages/DashboardPage.jsx"
    click PublicProfilePage "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/pages/PublicProfilePage.jsx"
    click SupabaseClient "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/src/lib/supabase.js"
    click Database "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/supabase/migrations/20251228083936_create_profiles_and_images_tables.sql"
    click Vite "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/vite.config.ts"
    click Tailwind "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/tailwind.config.js"
    click PostCSS "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/postcss.config.js"
    click ESLint "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/eslint.config.js"
    click TSConfig "https://github.com/debangshucode/full-stack-web-application-creative-showcase/blob/main/tsconfig.json"
    
    classDef client fill:#cce5ff,stroke:#004085,color:#004085;
    classDef frontend fill:#d4edda,stroke:#155724,color:#155724;
    classDef backend fill:#fff3cd,stroke:#856404,color:#856404;
    classDef db fill:#e2e3e5,stroke:#6c757d,color:#6c757d;
    classDef config fill:#f8f9fa,stroke:#343a40,color:#343a40;
```
