# imsaurabh1/masterthesis_aiplanningsoftwarerepository architecture

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

- Interactive diagram: https://gitdiagram.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository
- Repository: https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository

## Overview

##### Project type and purpose
- This is a full-stack web application (“AI Planning Software Repository”) that provides a React-based UI for users to discover, filter, sort, and add metadata about AI planning tools.
- The backend is a Node.js/Express REST API with a MySQL database, plus an email service (Nodemailer) to send confirmations.

##### File structure
- Top-level directories:
- backend/ – Express app (app.js), configuration (config/db.js), models (toolsModel.js), routes (tools.js), service layer (toolAddService, toolSearchService, etc.), utilities (emailUtils), and tests.
- frontend/ – React app (src/components, hooks, tests), styling (Tailwind CSS, CSS files), config (Babel, PostCSS), public assets, and build config.
- db/ – SQL schema for MySQL.
- docker-compose.yml – Defines three containers: frontend, backend, mysql_db.
- Architectural pattern in backend: layered approach (Routes → Services → Models → Database).
- Frontend follows a component/hook structure with a clear separation of UI, state, and side-effects (fetching).

##### README for additional insights
- Confirms Docker containerization, tech versions, port mapping (3000 for frontend, 5000 for backend, MySQL on standard port).
- Describes testing stacks (Jest/RTL for frontend; Mocha/Chai/Sinon/Supertest for backend).
- Mentions Material-UI inputs and Tailwind CSS for styling.

##### Detailed capture of essential architectural elements
- Within the backend container, break out:
- app.js (entry point) → config/db.js → models → services → routes → utils
- Within the frontend container, group:
- src/components (UI elements), src/hooks (data logic), public folder (static assets)
- Port mappings from Docker Compose (3000:3000, 5000:5000, 3306:3306).
- Denote network connections as defined in docker-compose.yml.

## Diagram (Mermaid)

```mermaid
flowchart TD
  DC["Docker Compose"]:::orchestrator

  subgraph "Frontend Container"
    direction TB
    FE_DF["Dockerfile"]:::frontend
    FE_PJ["package.json"]:::frontend
    FE_BR[".babelrc"]:::frontend
    FE_PC["postcss.config.js"]:::frontend
    subgraph "React App"
      direction TB
      FE_APP["App.js"]:::frontend
      FE_CM["src/components"]:::frontend
      FE_HK["src/hooks"]:::frontend
      FE_PUB["public"]:::frontend
      subgraph "Tests"
        FE_T1["AddTool.test.js"]:::frontend_test
        FE_T2["App.test.js"]:::frontend_test
        FE_T3["Sidebar.test.js"]:::frontend_test
      end
    end
  end

  subgraph "Backend Container"
    direction TB
    BE_DF["Dockerfile"]:::backend
    BE_PJ["package.json"]:::backend
    BE_APP["app.js"]:::backend
    subgraph "Config"
      BE_DB_CFG["config/db.js"]:::backend
    end
    subgraph "Models"
      BE_MODEL["models/toolsModel.js"]:::backend
    end
    subgraph "Services"
      BE_S1["toolAddService.js"]:::backend
      BE_S2["toolBasicRetrievalService.js"]:::backend
      BE_S3["toolFilterService.js"]:::backend
      BE_S4["toolSearchService.js"]:::backend
      BE_S5["toolSortService.js"]:::backend
      BE_S6["emailService.js"]:::backend
    end
    subgraph "Routes"
      BE_ROUTE["routes/tools.js"]:::backend
    end
    subgraph "Utils"
      BE_UTIL["utils/emailUtils.js"]:::backend
    end
    subgraph "Tests"
      BE_T1["toolsModel.test.js"]:::backend_test
      BE_T2["toolsRoutes.test.js"]:::backend_test
      BE_T3["toolsService.test.js"]:::backend_test
    end
  end

  subgraph "MySQL Database"
    direction TB
    DB["MySQL Container"]:::database
    SCHEMA["db/ai_planning_softwares.sql"]:::database
  end

  ES["External Email Service (SMTP)"]:::email

  Browser["Client Browser"]:::browser

  Browser -->|"HTTP 3000"| FE_APP
  FE_APP -->|"REST API 5000"| BE_ROUTE
  BE_ROUTE -->|"calls Service"| BE_S1
  BE_ROUTE --> BE_S2
  BE_ROUTE --> BE_S3
  BE_ROUTE --> BE_S4
  BE_ROUTE --> BE_S5
  BE_S1 --> BE_MODEL
  BE_S2 --> BE_MODEL
  BE_S3 --> BE_MODEL
  BE_S4 --> BE_MODEL
  BE_S5 --> BE_MODEL
  BE_S6 --> BE_UTIL
  BE_S1 --> BE_S6
  BE_ROUTE --> BE_S6
  BE_MODEL -->|"SQL"| DB
  BE_S6 -->|"SMTP"| ES

  DC --> FE_DF
  DC --> BE_DF
  DC --> DB

  click FE_CM "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/tree/main/frontend/src/components/"
  click FE_HK "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/tree/main/frontend/src/hooks/"
  click FE_APP "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/src/App.js"
  click FE_DF "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/tree/main/frontend/Dockerfile"
  click FE_PJ "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/package.json"
  click FE_BR "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/.babelrc"
  click FE_PC "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/postcss.config.js"
  click BE_DF "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/tree/main/backend/Dockerfile"
  click BE_PJ "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/package.json"
  click BE_APP "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/app.js"
  click BE_ROUTE "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/routes/tools.js"
  click BE_S1 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/services/toolAddService.js"
  click BE_S2 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/services/toolBasicRetrievalService.js"
  click BE_S3 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/services/toolFilterService.js"
  click BE_S4 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/services/toolSearchService.js"
  click BE_S5 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/services/toolSortService.js"
  click BE_S6 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/services/emailService.js"
  click BE_MODEL "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/models/toolsModel.js"
  click BE_DB_CFG "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/config/db.js"
  click SCHEMA "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/db/ai_planning_softwares.sql"
  click BE_UTIL "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/utils/emailUtils.js"
  click FE_T1 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/src/__tests__/AddTool.test.js"
  click FE_T2 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/src/__tests__/App.test.js"
  click FE_T3 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/frontend/src/__tests__/Sidebar.test.js"
  click BE_T1 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/test/toolsModel.test.js"
  click BE_T2 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/test/toolsRoutes.test.js"
  click BE_T3 "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/backend/test/toolsService.test.js"
  click DC "https://github.com/imsaurabh1/masterthesis_aiplanningsoftwarerepository/blob/main/docker-compose.yml"

  classDef frontend fill:#daf1fc,stroke:#0277bd,stroke-width:2px
  classDef backend fill:#d0f0c0,stroke:#388e3c,stroke-width:2px
  classDef database fill:#ffe0b2,stroke:#fb8c00,stroke-width:2px
  classDef email fill:#e1bee7,stroke:#8e24aa,stroke-width:2px
  classDef orchestrator fill:#f5f5f5,stroke:#757575,stroke-width:2px
  classDef browser fill:#e3f2fd,stroke:#42a5f5,stroke-width:2px
  classDef frontend_test fill:#fff3e0,stroke:#fb8c00,stroke-width:1px,stroke-dasharray:5 5
  classDef backend_test fill:#f1f8e9,stroke:#689f38,stroke-width:1px,stroke-dasharray:5 5
```
