# thetortillas/fourier-series-webapp-resources architecture

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

- Interactive diagram: https://gitdiagram.com/thetortillas/fourier-series-webapp-resources
- Repository: https://github.com/thetortillas/fourier-series-webapp-resources

## Overview

##### Project type and purpose
- This is a full-stack, web-based Fourier Series application (“Fourier-Series-WebApp”) plus a collection of related math/visualization demos.
- The Angular directory contains an SSR‐capable front-end. The Node directory contains one or more back-end APIs (e.g., “mini-fourier-api” and other quick endpoints). Additional folders (p5js, MathQuill, Canva, Integral_Linux, etc.) host static demos or computation scripts.

##### File structure
- Top-level “Angular/Frontend”: an Angular 10+ project with server.ts/main.server.ts (SSR), app modules, routes, page components (canva).
- Top-level “Node/mini-fourier-api”: an Express (or similar) service with controllers, routes, services, and Swagger config. Other Node subfolders (Efren API, FourierCoeff, Integral) appear as quick endpoints or experiments.
- “MathQuill”: local copy of MathQuill and tex2max transpiler libraries for math rendering and TeX→Maxima conversion.
- “p5js”: client-side DFT and plane demos using p5.js.
- “mcsima”: Maxima scripts for series expansions and integrals.
- “WebInterface”: static bilingual HTML entry points.
- No database folder—likely stateless backend or uses file/Maxima engine as “data store.”

##### Insights from README
- Project is in early consolidation: many standalone files/demos will be unified.
- Ultimate goal: a cohesive app where the front-end invokes computational back-end services, renders graphs, and displays formulas.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Front-End Layer
    subgraph "Front-End (Angular SSR)"
        direction TB
        SSR["Angular SSR Server"]:::frontend
        Browser["Browser Client"]:::frontend
        SSR -->|"renders pages"| Browser
    end

    %% API / Back-End Layer
    subgraph "API Layer & Services"
        direction TB
        APIGW["API Gateway"]:::backend
        MFAPI["mini-fourier-api Service"]:::backend
        Aux["Auxiliary Node Services"]:::backend
        Swagger["Swagger UI"]:::backend
        APIGW -->|"routes to core"| MFAPI
        APIGW -->|"routes to demos"| Aux
        MFAPI -->|"exposes docs"| Swagger
    end

    %% Computation Layer
    subgraph "Computation Engine"
        direction TB
        Maxima["Maxima Engine"]:::computation
        Tex2Max["tex2max Transpiler"]:::computation
        MFAPI -->|"invokes"| Tex2Max
        MFAPI -->|"spawns"| Maxima
    end

    %% Static & Demo Layer
    subgraph "Static & Demo Pages"
        direction TB
        P5["p5.js Demos"]:::static
        CanvasD["Canvas Static Demos"]:::static
        WebIntf["Static Bilingual Interface"]:::static
        LinuxInt["Integral_Linux Demo"]:::static
        Browser -->|"loads demos"| P5
        Browser -->|"loads demos"| CanvasD
        Browser -->|"loads pages"| WebIntf
        Browser -->|"loads demo"| LinuxInt
    end

    %% Data Flow
    Browser -->|"HTTP JSON"| APIGW
    MFAPI -->|"JSON/TeX"| Browser

    %% Click Events - Front-End
    click SSR "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Angular/Frontend/server.ts"
    click SSR "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Angular/Frontend/src/main.server.ts"
    click SSR "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Angular/Frontend/src/app/app.routes.ts"
    click SSR "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Angular/Frontend/src/app/app.config.server.ts"
    click Browser "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Angular/Frontend/src/app/pages/canva/canva.component.ts"

    %% Click Events - Back-End Core
    click MFAPI "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/mini-fourier-api/server.js"
    click MFAPI "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/mini-fourier-api/src/controllers/fourier.controller.js"
    click MFAPI "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/mini-fourier-api/src/routes/fourier.routes.js"
    click MFAPI "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/mini-fourier-api/src/services/maxima.service.js"
    click MFAPI "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/mini-fourier-api/src/swagger/swagger.config.js"

    %% Click Events - Auxiliary Services
    click Aux "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/Efren API/endpoints.js"
    click Aux "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/FourierCoeff/script.js"
    click Aux "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/FourierCoeff/public/index.html"
    click Aux "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/Integral/script.js"
    click Aux "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Node/Integral/public/index.html"

    %% Click Events - Computation Engine
    click Maxima "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/mcsima/*.wxm"
    click Maxima "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/mcsima/Maxima/Manual_de_Maxima.pdf"
    click Tex2Max "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/MathQuill/src/tex2max-1.3.1/src/index.js"
    click Tex2Max "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/MathQuill/src/tex2max-1.3.1/src/transpiler/maxima-transpiler.js"

    %% Click Events - Static Libraries & Demos
    click P5 "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/p5js/dft/sketch.js"
    click P5 "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/p5js/dft/fourier.js"
    click P5 "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/p5js/plane/script.js"
    click CanvasD "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Canva/canva discreto/index.html"
    click CanvasD "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Canva/canva_escala_eje_X/index.html"
    click WebIntf "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/WebInterface/index_en.html"
    click WebIntf "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/WebInterface/index_es.html"
    click LinuxInt "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Integral_Linux/public/index.html"
    click LinuxInt "https://github.com/thetortillas/fourier-series-webapp-resources/blob/main/Integral_Linux/script.js"

    %% Styles
    classDef frontend fill:#cce5ff,stroke:#3385ff,color:#000;
    classDef backend fill:#d4edda,stroke:#28a745,color:#000;
    classDef computation fill:#ffe5b4,stroke:#ff942e,color:#000;
    classDef static fill:#e2e3e5,stroke:#6c757d,color:#000;
```
