# ian-michaeloff/mentally architecture

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

- Interactive diagram: https://gitdiagram.com/ian-michaeloff/mentally
- Repository: https://github.com/ian-michaeloff/mentally

## Overview

##### Project type and purpose
- This is a front-end web application built with React, TypeScript and Vite.
- The multiple HTML templates (index.html, Registro_Alum.html, formulario-maestro.html, etc.) suggest a multi-page setup or a set of static pages that Vite will process and serve.
- Purpose: provide registration and recovery forms for “alumno” (student) and “maestro” (teacher).

##### File structure
- Top-level:
- package.json, package-lock.json → dependencies & scripts
- tsconfig.json + tsconfig.node.json → TypeScript compiler configuration
- vite.config.ts → Vite build/dev-server configuration
- .eslintrc.cjs → lint rules, ensuring code quality
- public/ → static assets (favicon, robots.txt, etc.)
- index.html and other .html files at root → entry points/templates for each page
- src/:
- main.tsx → application entry (hooks into index.html)
- App.tsx + CSS modules → core React components & styling
- assets/ and logos/ → images or other media
- No backend or API directories—pure front-end.

##### README
- Confirms usage of Vite with HMR via either plugin-react (Babel) or plugin-react-swc.
- Mentions ESLint config for TypeScript and React.
- No runtime API or database mentioned—this is a standalone SPA or static multi-page site.

##### Main components
a. Developer Workstation
- Code editor / terminal
- Git (clone/push/pull)
- Local Node.js + npm/yarn
b. Source Code
- React + TypeScript files (src/)
- HTML templates (root .html files)
- Static assets (public/, src/assets, src/logos)
- Config files (tsconfig, vite.config.ts, .eslintrc.cjs)
c. Build Toolchain
- Vite Dev Server
- HMR (Vite + plugin-react or plugin-react-swc)
- Serves on localhost:3000 (default)
- Production Bundler
- Vite’s Rollup under the hood
- Transpiler
- Babel or SWC via @vitejs/plugin-react or plugin-react-swc
- Linter
- ESLint + @typescript-eslint + react plugin
d. Runtime Environment
- Browser (Chrome, Firefox, etc.)
- Loads index.html or other pages → pulls JS/CSS bundles from the Vite server or static host
e. (Optional) Deployment Target
- Static file host (e.g., Netlify, Vercel, GitHub Pages)
- CI/CD pipeline (GitHub Actions, etc.)

##### Relationships and data flow
- Developer writes code → commits to Git → pushes to remote repo
- On “npm run dev”: Vite Dev Server watches src/ & public/ → compiles/transpiles on the fly → serves to Browser with HMR
- On “npm run build”: Vite bundles assets into dist/ → deploy to static host
- Browser requests HTML → Vite serves or host returns index.html + static pages → browser fetches JS/CSS → React hydrates DOM
- ESLint runs in pre-commit or CI to enforce code quality

##### Architectural patterns & design principles
- Component-based UI (React)
- Static multi-page or SPA with client-side routing (if implemented)
- Separation of concerns:
- src/ holds application logic
- public/ holds raw static assets
- Root .html files for page templates
- Config files separated at top level
- HMR for rapid developer feedback
- Type-checked linting for robustness

##### Final checklist
- Annotations calling out important config files (vite.config.ts, tsconfig.json, .eslintrc.cjs)

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Developer Environment
    subgraph "Developer Environment"
        Editor["Code Editor / Terminal"]:::dev
        Git["Git"]:::dev
        Node["Node.js & npm"]:::dev
    end

    %% Source Artifacts
    subgraph "Source Artifacts"
        Main["main.tsx"]:::artifact
        App["App.tsx"]:::artifact
        AppCSS["App.css"]:::artifact
        RegAlumCSS["RegistroAlum.css"]:::artifact
        RegMaesCSS["RegistroMaestro.css"]:::artifact
        FormalumCSS["formalum.css"]:::artifact
        FormmasterCSS["formmaster.css"]:::artifact
        RecupMasterCSS["recuperacionMaster.css"]:::artifact
        IndexCSS["index.css"]:::artifact
        ViteEnv["vite-env.d.ts"]:::artifact
        PUB["public/"]:::artifact
        ASSETS["src/assets/"]:::artifact
        LOGOS["src/logos/"]:::artifact
        HTML["HTML Templates"]:::artifact
    end

    %% Build Toolchain
    subgraph "Build Toolchain"
        ViteDev["Vite Dev Server"]:::build
        Transpiler["Transpiler (@vitejs/plugin-react-swc)"]:::build
        Linter["ESLint"]:::build
        Bundler["Rollup Bundler"]:::build
    end

    %% Config Files
    subgraph "Config Files"
        ViteConfig["vite.config.ts"]:::config
        TSConfig["tsconfig.json"]:::config
        NodeTS["tsconfig.node.json"]:::config
        ESLintConf[".eslintrc.cjs"]:::config
        PackageJSON["package.json"]:::config
        LockFile["package-lock.json"]:::config
        GitIgnore[".gitignore"]:::config
        README["README.md"]:::config
    end

    %% Runtime & Deployment
    subgraph "Runtime & Deployment"
        Browser["Browser"]:::runtime
        Host["Static Host (Netlify/Vercel)"]:::runtime
    end

    %% Data Flows
    Editor -->|writes code| Main
    Editor -->|writes code| App
    Editor -->|edits styles/assets| PUB
    Editor -->|edits styles/assets| ASSETS
    Editor -->|edits styles/assets| LOGOS
    Editor -->|edits HTML| HTML
    Editor -->|edits configs| ViteConfig
    Editor -->|edits configs| TSConfig
    Editor -->|edits configs| NodeTS
    Editor -->|edits configs| ESLintConf
    Editor -->|edits configs| PackageJSON
    Editor -->|edits configs| LockFile
    Editor -->|edits configs| GitIgnore
    Editor -->|edits docs| README

    Editor --> Git
    Git -->|push code| Host

    Node -->|runs| ViteDev
    Node -->|runs| Bundler
    ViteConfig -->|configures| ViteDev
    TSConfig -->|configures| Transpiler
    NodeTS -->|configures| Transpiler
    ESLintConf -->|configures| Linter
    PackageJSON -->|defines scripts| ViteDev
    PackageJSON -->|defines scripts| Bundler

    ViteDev -->|watch & serve| Main
    ViteDev -->|watch & serve| App
    ViteDev -->|transpile via| Transpiler
    ViteDev -->|lint code with| Linter
    ViteDev -->|HMR updates| Browser

    Bundler -->|bundle into dist| HTML
    Bundler -->|bundle into dist| Main
    Bundler -->|bundle into dist| App

    Bundler --> Host
    Host -->|serve HTML & assets| Browser
    Browser -->|HTTP GET| Host

    %% Click Events
    click Main "https://github.com/ian-michaeloff/mentally/blob/main/src/main.tsx"
    click App "https://github.com/ian-michaeloff/mentally/blob/main/src/App.tsx"
    click AppCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/App.css"
    click RegAlumCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/RegistroAlum.css"
    click RegMaesCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/RegistroMaestro.css"
    click FormalumCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/formalum.css"
    click FormmasterCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/formmaster.css"
    click RecupMasterCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/recuperacionMaster.css"
    click IndexCSS "https://github.com/ian-michaeloff/mentally/blob/main/src/index.css"
    click ViteEnv "https://github.com/ian-michaeloff/mentally/blob/main/src/vite-env.d.ts"
    click PUB "https://github.com/ian-michaeloff/mentally/tree/main/public/"
    click ASSETS "https://github.com/ian-michaeloff/mentally/tree/main/src/assets/"
    click LOGOS "https://github.com/ian-michaeloff/mentally/tree/main/src/logos/"
    click ViteConfig "https://github.com/ian-michaeloff/mentally/blob/main/vite.config.ts"
    click TSConfig "https://github.com/ian-michaeloff/mentally/blob/main/tsconfig.json"
    click NodeTS "https://github.com/ian-michaeloff/mentally/blob/main/tsconfig.node.json"
    click ESLintConf "https://github.com/ian-michaeloff/mentally/blob/main/.eslintrc.cjs"
    click PackageJSON "https://github.com/ian-michaeloff/mentally/blob/main/package.json"
    click LockFile "https://github.com/ian-michaeloff/mentally/blob/main/package-lock.json"
    click GitIgnore "https://github.com/ian-michaeloff/mentally/blob/main/.gitignore"
    click README "https://github.com/ian-michaeloff/mentally/blob/main/README.md"

    %% Styles
    classDef dev fill:#D0E6FF,stroke:#3B82F6,color:#1E3A8A;
    classDef build fill:#D1FAE5,stroke:#10B981,color:#064E3B;
    classDef artifact fill:#FEF3C7,stroke:#F59E0B,color:#92400E;
    classDef runtime fill:#FFE4E6,stroke:#EC4899,color:#9D174D;
    classDef config fill:#F3F4F6,stroke:#6B7280,color:#374151;
```
