# crustaly/audemywebsite architecture

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

- Interactive diagram: https://gitdiagram.com/crustaly/audemywebsite
- Repository: https://github.com/crustaly/audemywebsite

## Overview

##### Project’s Main Layers
- Frontend: Built with Vue.js (as seen by .vue files under src/components, src/pages, etc.) and bundled with Vite. The frontend uses Tailwind CSS (tailwind.config.js) and PostCSS (postcss.config.js) for styling.
- Backend/API Layer: Found under src/pages/api (with files such as generate_audio.js, server.js, and test_db.js) that likely provide REST endpoints. These endpoints enable functionalities like dynamic audio generation and database testing.
- Database: Managed via Prisma, as indicated by the prisma directory with its migration scripts and the schema file (prisma/schema.prisma). This suggests Audemy uses Prisma ORM to interact with its underlying database.
- Assets & Multimedia: There is extensive use of audio assets, images, and video files stored under both public and src/assets directories. This rich media content supports the platform’s goal to provide accessible interactive experiences.
- Deployment/Configuration: Files like vercel.json and the presence of a .replit config indicate that the project might be deployed using serverless platforms (e.g., Vercel) and possibly used in a development environment like Replit.

##### Main Components
a. Client/Frontend:
- User Interface: Represent the Vue.js-based UI that handles user interactions. Indicate components such as Header, Footer, and various pages (Home, GameZone, AboutUs, Impact, etc.).
- Multimedia and Accessibility Features: Highlight components that handle interactive audio, speech recognition, and play audio functionalities (residing in src/Utilities and the public assets).
b. API/Backend Services:
- Middleware/Services: Indicate any additional processing layers (e.g., for converting speech-to-text or recording audio) based on files in the src/Utilities directory.
c. Database:
- Prisma Managed Data Store: Connect this to the API layer to denote how the application performs CRUD operations and manages migration scripts for schema evolution.
d. Asset Management:
- Content Delivery: A module or service that handles serving static assets (images, audio, video) residing in the public and src/assets directories.
e. External Services & Deployment:
- Deployment Platform: Include an external label for Vercel (using vercel.json), which suggests serverless deployment.
- Possibly mention cloud storage or CDN if assets are delivered over external services.

##### Relationships and Data Flow
- The UI loads multimedia and assets from the Assets component, which may be served statically.

##### Architectural Patterns and Design Principles
- Separation of Concerns: Clearly delineate the frontend (presentation layer), backend (API and business logic), and the database.
- Modular Design: Note that each page/component (like GameZone, AboutUs, Impact, etc.) encapsulates its functionality. This modularity is supported by the structured directories.
- Accessibility Focus: Emphasize that the design integrates features such as audio interaction and speech recognition to support accessibility for blind and visually impaired users.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Frontend Subgraph
    subgraph "Client Side (Frontend)"
        F1["Components (UI)"]:::frontend
        F2["Pages"]:::frontend
        F3["App.vue"]:::frontend
        F4["main.js"]:::frontend
        subgraph "Multimedia & Accessibility Utilities"
            U1["src Utilities"]:::frontend
            U2["public Utilities"]:::frontend
        end
    end

    %% Backend/API Subgraph
    subgraph "Backend/API Endpoints"
        A1["generate_audio.js"]:::backend
        A2["server.js"]:::backend
        A3["test_db.js"]:::backend
    end

    %% Database Subgraph
    subgraph "Database"
        D1["schema.prisma"]:::database
        D2["Migrations"]:::database
    end

    %% Assets & Multimedia Delivery Subgraph
    subgraph "Assets & Multimedia Delivery"
        AS1["Public Assets"]:::assets
        AS2["Source Assets"]:::assets
    end

    %% Deployment & Configuration Subgraph
    subgraph "Deployment & Configuration"
        DEP1["vercel.json"]:::deployment
        DEP2[".replit"]:::deployment
        DEP3["Tailwind Config"]:::deployment
        DEP4["PostCSS Config"]:::deployment
        DEP5["Vite Config"]:::deployment
        DEP6["Vue Config"]:::deployment
    end

    %% Relationships and Data Flow
    F2 -->|"apiCall"| A2
    A2 -->|"CRUD"| D1
    F2 -->|"loads"| AS1
    F1 -->|"renders"| AS2
    F2 -->|"utilizes"| U1
    F2 -->|"utilizes"| U2
    DEP1 -->|"deploys"| F2
    DEP1 -->|"deploys"| A2

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#004085,stroke-width:2px;
    classDef backend fill:#d4edda,stroke:#155724,stroke-width:2px;
    classDef database fill:#fff3cd,stroke:#856404,stroke-width:2px;
    classDef assets fill:#f8d7da,stroke:#721c24,stroke-width:2px;
    classDef deployment fill:#e2e3e5,stroke:#6c757d,stroke-width:2px;

    %% Click Events
    click F1 "https://github.com/crustaly/audemywebsite/tree/main/src/components"
    click F2 "https://github.com/crustaly/audemywebsite/tree/main/src/pages"
    click F3 "https://github.com/crustaly/audemywebsite/blob/main/src/App.vue"
    click F4 "https://github.com/crustaly/audemywebsite/blob/main/src/main.js"
    click U1 "https://github.com/crustaly/audemywebsite/tree/main/src/Utilities"
    click U2 "https://github.com/crustaly/audemywebsite/tree/main/public/Utilities"
    click A1 "https://github.com/crustaly/audemywebsite/blob/main/src/pages/api/generate_audio.js"
    click A2 "https://github.com/crustaly/audemywebsite/blob/main/src/pages/api/server.js"
    click A3 "https://github.com/crustaly/audemywebsite/blob/main/src/pages/api/test_db.js"
    click D1 "https://github.com/crustaly/audemywebsite/blob/main/prisma/schema.prisma"
    click D2 "https://github.com/crustaly/audemywebsite/tree/main/prisma/migrations"
    click AS1 "https://github.com/crustaly/audemywebsite/tree/main/public/assets"
    click AS2 "https://github.com/crustaly/audemywebsite/tree/main/src/assets"
    click DEP1 "https://github.com/crustaly/audemywebsite/blob/main/vercel.json"
    click DEP2 "https://github.com/crustaly/audemywebsite/blob/main/.replit"
    click DEP3 "https://github.com/crustaly/audemywebsite/blob/main/tailwind.config.js"
    click DEP4 "https://github.com/crustaly/audemywebsite/blob/main/postcss.config.js"
    click DEP5 "https://github.com/crustaly/audemywebsite/blob/main/vite.config.js"
    click DEP6 "https://github.com/crustaly/audemywebsite/blob/main/vue.config.js"
```
