# hitg010/quantamind architecture

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

- Interactive diagram: https://gitdiagram.com/hitg010/quantamind
- Repository: https://github.com/hitg010/quantamind

## Overview

##### Project type and purpose
- From the README and file tree, QuantaMind is a full-stack, web-based mental health companion. It comprises a central Node.js/Express application plus two specialized sub-services: a Python/Flask “Journal” service and a Node.js “Meditation” service. It delivers static assets (CSS/JS) to the browser, dynamic pages (EJS/HTML templates), mini-games, articles, and analytics.

##### File structure
- Top-level directories and files:
- Public/ – all front-end asset folders and files (CSS/JS, images) organized by feature (quotes, games, journal, meditate, etc.)
- views/ – server-side templates (EJS or HTML) for rendering pages
- index.js & server.js (root) – main Node.js/Express entry points (likely index.js is primary; server.js may be legacy or auxiliary)
- journal/ – Python Flask app (app.py, templates, static) for journaling functionality
- meditation/ – Node.js microservice (server.js, package.json, node_modules) for guided meditation features
- package.json (root) and package-lock.json – dependencies for the main Node app
- vercel.json – deployment configuration

##### README for additional insights
- QuantaMind is deployed on localhost:3000 using Node index.js
- It aims to be user-centric and integrates multiple modules (journal, games, analytics) under one umbrella

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Client Layer
    Client["Web Browser"]:::client
    Client -->|"HTTP Requests"| MainServer
    Client -->|"Fetch Static Assets"| Static

    %% Main Server Layer
    subgraph "Main Application Server" 
        direction TB
        MainServer["Node.js/Express"]:::node
        IndexJS["index.js"]:::node
        ServerJS["server.js"]:::node
        RootPkg["package.json"]:::node
        RootLock["package-lock.json"]:::node
    end
    Client --> MainServer
    MainServer -->|"Serves Static"| Static
    MainServer -->|"Renders Templates"| Views
    MainServer -->|"POST /journal/entry\nGET /journal/history"| JournalService
    MainServer -->|"GET /meditate/session\nPOST /meditate/progress"| MeditationService

    %% Static Assets
    Static["Static Assets\n(Public/)"]:::static

    %% Templates Layer
    Views["Templates\n(views/)"]:::static

    %% Journal Microservice
    subgraph "Journal Microservice" 
        direction TB
        JournalService["Python/Flask Service"]:::python
        AppPy["app.py"]:::python
        JournalStatic["static/"]:::static
        JournalTemplates["templates/"]:::static
    end

    %% Meditation Microservice
    subgraph "Meditation Microservice"
        direction TB
        MeditationService["Node.js Service"]:::node
        MedServer["server.js"]:::node
        MedPkg["package.json"]:::node
        MedLock["package-lock.json"]:::node
        MedNodeMod["node_modules/"]:::node
    end

    %% Deployment
    Deploy["Vercel Deployment\n(vercel.json)"]:::deploy

    %% Flows
    JournalService --> AppPy
    JournalService --> JournalStatic
    JournalService --> JournalTemplates
    MeditationService --> MedServer
    MeditationService --> MedPkg
    MeditationService --> MedLock
    MeditationService --> MedNodeMod

    MainServer --> Deploy

    %% Click Events
    click Static "https://github.com/hitg010/quantamind/tree/master/Public/"
    click IndexJS "https://github.com/hitg010/quantamind/blob/master/index.js"
    click ServerJS "https://github.com/hitg010/quantamind/blob/master/server.js"
    click RootPkg "https://github.com/hitg010/quantamind/blob/master/package.json"
    click RootLock "https://github.com/hitg010/quantamind/blob/master/package-lock.json"
    click Views "https://github.com/hitg010/quantamind/tree/master/views/"
    click AppPy "https://github.com/hitg010/quantamind/blob/master/journal/app.py"
    click JournalStatic "https://github.com/hitg010/quantamind/tree/master/journal/static/"
    click JournalTemplates "https://github.com/hitg010/quantamind/tree/master/journal/templates/"
    click MedServer "https://github.com/hitg010/quantamind/blob/master/meditation/server.js"
    click MedPkg "https://github.com/hitg010/quantamind/blob/master/meditation/package.json"
    click MedLock "https://github.com/hitg010/quantamind/blob/master/meditation/package-lock.json"
    click MedNodeMod "https://github.com/hitg010/quantamind/tree/master/meditation/node_modules/"
    click Deploy "https://github.com/hitg010/quantamind/blob/master/vercel.json"

    %% Styles
    classDef client fill:#FFA500,color:#000;
    classDef node fill:#ADD8E6,color:#000;
    classDef python fill:#98FB98,color:#000;
    classDef static fill:#D3D3D3,color:#000;
    classDef deploy fill:#F0E68C,color:#000;
```
