# luak-leuven/luak-website architecture

> Architecture diagram of the GitHub repository luak-leuven/luak-website, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/luak-leuven/luak-website
- Repository: https://github.com/luak-leuven/luak-website

## Overview

##### Project Type and Purpose
- This is a full‑stack, content‑driven website (LUAK) built with Nuxt 3 for the frontend/SSR, Nuxt Content for markdown pages, TailwindCSS + DaisyUI for styling, and Supabase as a serverless backend (Postgres DB, Auth, Edge Functions). It’s deployed on Vercel.

##### File Structure Analysis
- Top‑level “pages”, “components”, “layouts”, “assets” – standard Nuxt 3 directory for routing, UI, and static assets.
- “content” holds markdown under subfolders (activities, info, news, pages, stories) consumed by @nuxt/content.
- “supabase” folder contains:
- “migrations” (SQL schema changes)
- “seed.sql” (initial data)
- “functions” (TypeScript edge functions living in Supabase for webhooks, CORS/shared utilities, Stripe integration).
- Config and build scripts: nuxt.config.ts, tailwind.config.js, tsconfig.json, .env.example, .devcontainer, Docker/VSCode setup.

##### README Insights
- Emphasizes tech stack, use of VSCode Dev Container or Codespaces, environment variables for Supabase, and Vercel deployment.

a. Main Components
- Browser / Client UI (Nuxt 3 pages + components)
- Nuxt Server (SSR / SSG on Vercel) + @nuxt/content engine
- Supabase Backend
– Postgres Database
– Auth service
– Edge Functions (Stripe webhook, other server‑side logic)
- External Services: Stripe (payment), Vercel CDN
- Content repository (local markdown files)
b. Interactions
– Browser ↔️ Nuxt Server via HTTP/HTTPS (SSR or fetch calls)
– Nuxt Server (or client) ↔️ Supabase Client SDK for Auth, CRUD, real‑time
– Stripe → Supabase Edge Function (webhook) → Postgres
– CI/CD (GitHub → Vercel) deploying code + static assets
c. Architectural Patterns
– Jamstack/SSR hybrid: static content + server‑side rendering for dynamic pages
– Serverless functions for payment/webhooks
– Content‑driven routing (markdown file → route)
– Modular Vue component-based UI
d. Key Technologies
– Frontend: Nuxt 3, Vue 3, TailwindCSS + DaisyUI
– Content: @nuxt/content reading markdown under “content/”
– Backend: Supabase (Postgres, Auth, Edge Functions in TypeScript)
– Deployment: Vercel (SSR + static hosting)
– Dev: Docker / VSCode Dev Container, TypeScript, ESLint, Prettier

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Browser/Client UI"]:::frontend
        Components["components/"]:::frontend
        Pages["pages/"]:::frontend
        NuxtServer["Nuxt Server (SSR/SSG)"]:::frontend
        ContentEngine["@nuxt/content engine"]:::frontend
        Styling["TailwindCSS + DaisyUI"]:::frontend
    end

    %% Content Repository
    subgraph "Content Repository"
        direction TB
        ContentDir["content/"]:::frontend
        Activities["content/activities/"]:::frontend
        Info["content/info/"]:::frontend
        News["content/news/"]:::frontend
        PagesContent["content/pages/"]:::frontend
        Stories["content/stories/"]:::frontend
    end

    %% Backend Layer
    subgraph "Supabase Backend"
        direction TB
        Auth["Supabase Auth"]:::backend
        DB["Supabase Postgres DB"]:::db
        EdgeFns["Edge Functions"]:::backend
    end

    %% CI/CD and External Services
    subgraph "External Services"
        direction TB
        GitHubCI["GitHub Actions / Vercel CI/CD"]:::external
        VercelCDN["Vercel CDN"]:::external
        Stripe["Stripe"]:::external
    end

    %% Connections
    Browser -->|"HTTP/HTTPS"| NuxtServer
    NuxtServer -->|"serves SSR/SSG"| Browser
    NuxtServer -->|"uses"| ContentEngine
    ContentEngine -->|"reads markdown"| ContentDir
    ContentDir --> Activities
    ContentDir --> Info
    ContentDir --> News
    ContentDir --> PagesContent
    ContentDir --> Stories

    NuxtServer -->|"SDK calls"| Auth
    NuxtServer -->|"queries"| DB
    Browser -->|"SDK calls"| Auth
    Browser -->|"SDK calls"| DB

    Stripe -->|"webhook"| EdgeFns
    EdgeFns -->|"writes/reads"| DB
    EdgeFns -->|"auth uses"| Auth

    GitHubCI -->|"deploys"| VercelCDN
    VercelCDN -->|"hosts SSR & static"| NuxtServer

    Styling --> NuxtServer

    %% Click Events
    click Components "https://github.com/luak-leuven/luak-website/tree/master/components/"
    click Pages "https://github.com/luak-leuven/luak-website/tree/master/pages/"
    click nuxtConfig "https://github.com/luak-leuven/luak-website/blob/master/nuxt.config.ts"
    click AppVue "https://github.com/luak-leuven/luak-website/blob/master/app.vue"
    click ContentDir "https://github.com/luak-leuven/luak-website/tree/master/content/"
    click Activities "https://github.com/luak-leuven/luak-website/tree/master/content/activities/"
    click Info "https://github.com/luak-leuven/luak-website/tree/master/content/info/"
    click News "https://github.com/luak-leuven/luak-website/tree/master/content/news/"
    click PagesContent "https://github.com/luak-leuven/luak-website/tree/master/content/pages/"
    click Stories "https://github.com/luak-leuven/luak-website/tree/master/content/stories/"
    click TailwindConfig "https://github.com/luak-leuven/luak-website/blob/master/tailwind.config.js"
    click MainCSS "https://github.com/luak-leuven/luak-website/blob/master/assets/css/main.scss"
    click Migrations "https://github.com/luak-leuven/luak-website/tree/master/supabase/migrations/"
    click SeedSQL "https://github.com/luak-leuven/luak-website/blob/master/supabase/seed.sql"
    click AuthConfig "https://github.com/luak-leuven/luak-website/blob/master/supabase/config.toml"
    click EdgeFns "https://github.com/luak-leuven/luak-website/tree/master/supabase/functions/"
    click StripeWebhook "https://github.com/luak-leuven/luak-website/blob/master/supabase/functions/stripe-webhook/index.ts"
    click SharedStripe "https://github.com/luak-leuven/luak-website/blob/master/supabase/functions/_shared/stripe.ts"
    click SharedCORS "https://github.com/luak-leuven/luak-website/blob/master/supabase/functions/_shared/cors.ts"
    click GitHubCI "https://github.com/luak-leuven/luak-website/tree/master/.github/"
    click Utils "https://github.com/luak-leuven/luak-website/tree/master/utils/"
    click Types "https://github.com/luak-leuven/luak-website/tree/master/types/"
    click YupSchemas "https://github.com/luak-leuven/luak-website/tree/master/yup_schemas/"
    click DevContainer "https://github.com/luak-leuven/luak-website/tree/master/.devcontainer/"
    click EnvExample "https://github.com/luak-leuven/luak-website/blob/master/.env.example"
    click TsConfig "https://github.com/luak-leuven/luak-website/blob/master/tsconfig.json"
    click ESLint "https://github.com/luak-leuven/luak-website/blob/master/eslint.config.mjs"
    click Prettier "https://github.com/luak-leuven/luak-website/blob/master/.prettierrc"
    click Npmrc "https://github.com/luak-leuven/luak-website/blob/master/.npmrc"

    %% Styles
    classDef frontend fill:#BBDEFB,stroke:#1E88E5,color:#0D47A1
    classDef backend fill:#C8E6C9,stroke:#43A047,color:#1B5E20
    classDef external fill:#FFE0B2,stroke:#FB8C00,color:#E65100
    classDef db fill:#E1BEE7,stroke:#8E24AA,color:#4A148C
```
