# maximecloarec/projet-griffon-nuxt architecture

> Architecture diagram of the GitHub repository maximecloarec/projet-griffon-nuxt, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/maximecloarec/projet-griffon-nuxt
- Repository: https://github.com/maximecloarec/projet-griffon-nuxt

## Overview

##### Project type and purpose
- This is a Nuxt 3–based web application (Vue 3 + TypeScript + Pinia-like stores), using file-based routing and server‐side rendering (SSR).
- Its purpose is to serve a multi-page game/join site with authentication, client-side state management, and static asset delivery.

##### File structure
- Top-level “app” folder holds the entire front-end:
- pages/ → Route definitions (file-based routing)
- components/ → Reusable UI pieces
- middleware/ → auth guard logic for protected pages
- stores/ → Pinia store (user.ts) for user session and state
- assets/, public/ → Styling (CSS), SVGs, robots.txt, other static files
- utils/ → Shared TypeScript types
- nuxt.config.ts configures the framework (SSR, build, modules).
- No dedicated “backend/” folder—implies either purely client + SSR or reliance on external APIs for persistent data.

##### Key insights from README
- It’s a minimal Nuxt starter, intended for local dev (npm/ pnpm/ yarn/ bun), SSR dev server at localhost:3000, static/SSG preview, and production builds.
- No mention of built-in database or API routes—architecture centers on Nuxt’s SSR/SPA capabilities.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Browser" 
        direction TB
        Browser["Client Browser"]:::frontend
    end

    %% Server Layer
    subgraph "SSR Server (Node.js)" 
        direction TB
        Router["File-based Routing Layer"]:::server
        Middleware["Auth Middleware"]:::server
        AppRoot["Vue Application Root"]:::frontend
        Components["Vue Components & Views"]:::frontend
        Store["Pinia Store (user.ts)"]:::state
        Config["Nuxt Config (nuxt.config.ts)"]:::server
    end

    %% Assets Layer
    subgraph "Static Asset Server" 
        direction TB
        CSS["CSS Assets"]:::assets
        SVG["SVG Assets"]:::assets
        PublicFile["Public Static Files"]:::assets
    end

    %% External Services
    subgraph "External Services" 
        direction TB
        API["External API/DB"]:::external
    end

    %% Connections Client -> Server SSR
    Browser -->|"HTTP Request"| Router
    Router -->|"runs through"| Middleware
    Middleware -->|"loads"| AppRoot
    AppRoot -->|"renders"| Components
    Components -->|"injects state from"| Store
    Router -->|"uses config"| Config

    %% SSR Response to Client
    Components -->|"HTML + State"| Browser
    Browser -->|"hydration"| Components

    %% Client Runtime
    Browser -->|"dispatch/store actions"| Store
    Store -->|"API calls"| API
    Router -.->|"server-side API calls"| API

    %% Static Assets
    Browser -->|"fetch static assets"| CSS
    Browser -->|"fetch static assets"| SVG
    Browser -->|"fetch static files"| PublicFile

    %% Click Events
    click Router "https://github.com/maximecloarec/projet-griffon-nuxt/tree/main/app/pages/"
    click Middleware "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/app/middleware/auth.ts"
    click AppRoot "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/app/app.vue"
    click Components "https://github.com/maximecloarec/projet-griffon-nuxt/tree/main/app/components/"
    click Store "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/app/stores/user.ts"
    click CSS "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/app/assets/css/main.css"
    click SVG "https://github.com/maximecloarec/projet-griffon-nuxt/tree/main/app/assets/svg/"
    click PublicFile "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/public/robots.txt"
    click API "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/app/utils/types.ts"
    click Config "https://github.com/maximecloarec/projet-griffon-nuxt/blob/main/nuxt.config.ts"

    %% Styles
    classDef frontend fill:#D0E8FF,stroke:#037FFF,color:#000
    classDef server fill:#DFFFE0,stroke:#28A745,color:#000
    classDef state fill:#FFE8B0,stroke:#FFAA00,color:#000
    classDef assets fill:#F0F0F0,stroke:#888888,color:#000
    classDef external fill:#F8F0FF,stroke:#A020F0,color:#000,stroke-dasharray: 5 5
```
