# gaye-lamine/voyage-au-pays-des-histoires architecture

> Architecture diagram of the GitHub repository gaye-lamine/voyage-au-pays-des-histoires, 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/gaye-lamine/voyage-au-pays-des-histoires
- Repository: https://github.com/gaye-lamine/voyage-au-pays-des-histoires

## Overview

##### Project type and purpose
- This is a full-stack (mostly client-driven) Nuxt.js application (“Voyage au Pays des Histoires”) for interactive children’s storytelling.
- It uses a Vue-based front end (Nuxt) with server-side support in the `server/` folder, client-side state management in `stores/`, and is intended to be deployed on Netlify.

##### File structure
- Top-level:
- `app.vue`, `layouts/`, `pages/` → Nuxt front end
- `stores/` → Pinia or Vuex-style stores (game state)
- `server/` → TypeScript server APIs or server middleware
- `public/` → static assets (robots.txt, images, audio files?)
- `nuxt.config.ts`, `tsconfig.json`, `netlify.toml` → configuration and deployment
- Key patterns:
- Nuxt SSR/Static-Site Generation with routing under `pages/`
- Component/layout hierarchy under `layouts/` and root `app.vue`
- Single store module for game logic in `stores/game.ts`
- Likely serverless functions (Netlify) or Nuxt server endpoints under `server/`

##### README for additional insights
- Core features: interactive reading with Web Speech API, chapter navigation, comprehension quizzes
- Technology stack: Nuxt.js, Vue, TypeScript, Web Speech API, Netlify

a. Main Components
- Client Browser (end user)
- Nuxt Front-End App
- Page components (`pages/*.vue`)
- Layout (`layouts/default.vue`)
- Global store (`stores/game.ts`)
- Server/API Layer (`server/`)
- External Services
- Web Speech API (in-browser)
- Netlify Hosting & Build
- Static Content (`public/`)
b. Relationships & Interactions
- User ↔ Browser UI: navigates pages, interacts with quiz and controls
- UI → Store: reads/writes game state (current chapter, questions answered)
- UI → Server APIs: (if any) fetch story content or quiz data
- UI → Web Speech API: sends text for TTS, receives audio stream
- Build Process: Git → Netlify CI (via `netlify.toml`) → deploy static + serverless functions
c. Architectural Patterns
- Component-based MVC/MVVM in Nuxt/Vue
- Single-page application with server-side rendering or pre-rendering
- Central store (Pinia/Vuex) for state management
- Serverless functions or API endpoints under `server/`
d. Key Technologies
- Nuxt.js (Vue framework)
- TypeScript
- Web Speech API
- Netlify (hosting + serverless)

##### Detailed & Comprehensive Capture
- Global store module and how pages consume and mutate it
- If the `server/` folder contains custom endpoints, list them explicitly (e.g., `/api/getChapter`)
- That static story assets (text, audio) are served from `public/`
- That Netlify uses `netlify.toml` to route serverless functions and build the Nuxt app

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "User & Browser"
        USER["User"]:::external
        WEBSPEECH["Web Speech API"]:::external
    end

    subgraph "Frontend (Nuxt App)"
        APP["app.vue"]:::codeModule
        LAYOUT["layouts/default.vue"]:::codeModule
        HOME["pages/index.vue"]:::codeModule
        CHAR["pages/character-creation.vue"]:::codeModule
        STORY["pages/story.vue"]:::codeModule
        VICTORY["pages/victory.vue"]:::codeModule
        STORE["stores/game.ts"]:::codeModule
        STATIC["public/"]:::dataStore
        CONFIG["nuxt.config.ts"]:::codeModule
    end

    subgraph "Backend/API (Serverless)"
        SERVER["server/"]:::codeModule
        SERVERTS["server/tsconfig.json"]:::codeModule
    end

    subgraph "Deployment & CI/CD"
        GIT["Git Repository"]:::external
        NETLIFY["Netlify (Build & Hosting)"]:::external
        TOML["netlify.toml"]:::codeModule
        TSCONFIG["tsconfig.json"]:::codeModule
    end

    USER -->|"navigates/interacts"| HOME
    HOME -->|"uses layout"| LAYOUT
    LAYOUT -->|"wraps"| APP

    HOME -->|"reads/writes state"| STORE
    CHAR -->|"reads/writes state"| STORE
    STORY -->|"reads/writes state"| STORE
    VICTORY -->|"reads/writes state"| STORE

    HOME -->|"requests TTS"| WEBSPEECH
    CHAR -->|"requests TTS"| WEBSPEECH
    STORY -->|"requests TTS"| WEBSPEECH
    VICTORY -->|"requests TTS"| WEBSPEECH

    HOME -->|"fetch content"| SERVER
    CHAR -->|"fetch content"| SERVER
    STORY -->|"fetch content"| SERVER
    VICTORY -->|"fetch content"| SERVER

    SERVER -->|"serves static assets"| STATIC

    GIT -->|push| NETLIFY
    TOML -->|"configures"| NETLIFY
    NETLIFY -->|"deploys frontend"| APP
    NETLIFY -->|"deploys backend"| SERVER

    TSCONFIG -.->|"TypeScript config"| APP
    TSCONFIG -.->|"TypeScript config"| SERVER

    click APP "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/app.vue"
    click LAYOUT "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/layouts/default.vue"
    click HOME "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/pages/index.vue"
    click CHAR "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/pages/character-creation.vue"
    click STORY "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/pages/story.vue"
    click VICTORY "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/pages/victory.vue"
    click STORE "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/stores/game.ts"
    click SERVER "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/tree/master/server/"
    click SERVERTS "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/server/tsconfig.json"
    click STATIC "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/tree/master/public/"
    click CONFIG "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/nuxt.config.ts"
    click TOML "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/netlify.toml"
    click TSCONFIG "https://github.com/gaye-lamine/voyage-au-pays-des-histoires/blob/master/tsconfig.json"

    classDef codeModule fill:#cfe2ff,stroke:#0066cc
    classDef dataStore fill:#d9ead3,stroke:#6aa84f
    classDef external fill:#fce5cd,stroke:#e69138
```
