# georges999/wiqr architecture

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

- Interactive diagram: https://gitdiagram.com/georges999/wiqr
- Repository: https://github.com/georges999/wiqr

## Overview

##### Project Type and Purpose
- WiQr is a monorepo–styled, full-stack web application.
- Purpose: Provide offline-capable file–conversion tools and dynamic QR-code generation with analytics, all wrapped in an interactive Three.js UI.

##### File Structure
- Top-level:
- client/ — React + Vite frontend
- server/ — Node.js + Express backend
- client/src/components — key UI modules: FileConverter, QrCodeGenerator, Scene (Three.js)
- server/models — MongoDB schema for QR codes
- server/routes/qr.js — HTTP API endpoints for QR operations
- Root package.json — monorepo scripts to run both client and server concurrently

##### Extract Architectural Insights from the README
- Frontend stack: React, Vite, Tailwind, React-Three-Fiber, React-Dropzone
- Backend stack: Express, MongoDB, fluent-ffmpeg, sharp (for file conversion)
- Monorepo structure implies shared scripts and coordinated dev workflow

##### Main Components & Their Relationships
a. User & Browser
- Interacts with the React app
b. Frontend (client/)
- UI Components
– FileConverter.jsx (drag/drop + conversion requests)
– QrCodeGenerator.jsx (form input + QR display + analytics view)
– Scene.jsx (Three.js interactive canvas)
- Vite Dev Server / Production Static Host
c. API Layer
- Express.js server (server/index.js)
- Routes: /api/convert, /api/qr/*
d. File Conversion Service
- Libraries: fluent-ffmpeg, sharp, etc.
- Module (could be a separate service or part of Express)
e. QR Data Store
- MongoDB (server/models/QrCode.js)
- CRUD operations via Mongoose
f. Analytics & Tracking
- Express endpoints record each QR scan back into MongoDB
g. Optional File Storage
- Local filesystem or cloud (S3) for temporary storage of uploaded/converted files

##### Architectural Patterns & Design Principles
- Separation of Concerns: clearly split UI (React) and API (Express).
- Monorepo: shared dev tools, single CI/CD pipeline.
- Layered Architecture: Presentation (frontend), Application/API, Business Logic (conversion/QR services), Data (MongoDB).
- Componentization: each UI feature is its own React component; backend routes map one-to-one to services.

## Diagram (Mermaid)

```mermaid
flowchart TD
    classDef frontend fill:#cce5ff,stroke:#004085;
    classDef backend fill:#d4edda,stroke:#155724;
    classDef database fill:#fff3cd,stroke:#856404,shape:cylinder;
    classDef external fill:#e2e3e5,stroke:#6c757d;
    classDef misc fill:#f8d7da,stroke:#721c24;

    U["User/Browser"]:::external

    subgraph "Client (Frontend)"
        direction TB
        MainEntry["main.jsx"]:::frontend
        App["App.jsx"]:::frontend
        FC["FileConverter.jsx"]:::frontend
        QG["QrCodeGenerator.jsx"]:::frontend
        Scene["Scene.jsx"]:::frontend
        Vite["vite.config.js"]:::frontend
        Tailwind["tailwind.config.js"]:::frontend
    end

    subgraph "API Layer (Express)"
        direction TB
        API["server/index.js"]:::backend
        QRRoutes["qr.js"]:::backend
    end

    subgraph "Services"
        direction TB
        Conv["Conversion Service"]:::backend
        QRService["QR Code Service"]:::backend
    end

    DB["MongoDB (QrCode.js)"]:::database
    RootPkg["package.json"]:::misc
    ClientPkg["client/package.json"]:::misc
    ServerPkg["server/package.json"]:::misc
    Cloud["External Storage (S3/FS)"]:::external

    U -->|"interacts"| MainEntry
    MainEntry --> App
    App --> FC
    App --> QG
    App --> Scene
    App --> API
    API --> QRRoutes
    API --> Conv
    API --> QRService
    Conv --> Cloud
    QRService --> DB
    QRService --> Cloud
    API --> DB
    Cloud -.-> App

    click MainEntry "https://github.com/georges999/wiqr/blob/main/client/src/main.jsx"
    click App "https://github.com/georges999/wiqr/blob/main/client/src/App.jsx"
    click FC "https://github.com/georges999/wiqr/blob/main/client/src/components/FileConverter.jsx"
    click QG "https://github.com/georges999/wiqr/blob/main/client/src/components/QrCodeGenerator.jsx"
    click Scene "https://github.com/georges999/wiqr/blob/main/client/src/components/Scene.jsx"
    click Vite "https://github.com/georges999/wiqr/blob/main/client/vite.config.js"
    click Tailwind "https://github.com/georges999/wiqr/blob/main/client/tailwind.config.js"
    click API "https://github.com/georges999/wiqr/blob/main/server/index.js"
    click QRRoutes "https://github.com/georges999/wiqr/blob/main/server/routes/qr.js"
    click DB "https://github.com/georges999/wiqr/blob/main/server/models/QrCode.js"
    click RootPkg "https://github.com/georges999/wiqr/blob/main/package.json"
    click ClientPkg "https://github.com/georges999/wiqr/blob/main/client/package.json"
    click ServerPkg "https://github.com/georges999/wiqr/blob/main/server/package.json"
```
