# ridham2808/ironcore_gym architecture

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

- Interactive diagram: https://gitdiagram.com/ridham2808/ironcore_gym
- Repository: https://github.com/ridham2808/ironcore_gym

## Overview

##### Main Components

a) Frontend Layer:
- React-based Vite application
- Key modules: Authentication, Pages (Home, Blog, Services, etc.), Components
- Design/CSS modules
- Asset management

b) Backend Layer (Microservices):
- Authentication Service
- Blogs Service
- Wellness Service (BMI Calculator & Diet Plans)
- Database connections

c) External Services:
- Render (Hosting platform)
- AI Service (for diet plans)

**[Client Layer]**

**[API Gateway/Load Balancer]**

**[Backend Services Layer]**

**[Data Layer]**

##### Detailed Component Breakdown

Frontend (Top Layer):
- Sub-components:
- Authentication Module (login.jsx, signup.jsx, etc.)
- Core Pages (Home, Blog, Services, etc.)
- Shared Components (Navbar, Footer)
- Asset Management
- State Management

API Gateway (Middle Layer):
- Routing to different microservices
- Security/authentication flow

Backend Services (Service Layer):
- Authentication Service:
- User Management
- JWT Authentication
- Password Reset Flow
- Blogs Service:
- Article Management
- Content Delivery
- Wellness Service:
- BMI Calculator
- Diet Plan Generator
- User Details Management

Database Layer:
- MongoDB Collections
- Data Models (User, Wellness, Blogs)

##### Connection Flows

- External service interactions (bold lines)

##### Additional Elements

- Error handling
- Caching mechanisms
- Security layers
- Load balancing
- Monitoring and logging

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Client
        FE[Frontend Application]
        AM[Authentication Module]
        CP[Core Pages]
        SC[Shared Components]
        DC[Design/CSS Modules]
        
        FE --> AM
        FE --> CP
        FE --> SC
        FE --> DC
    end

    subgraph Gateway
        API[API Gateway/Load Balancer]:::gateway
        SEC[Security Layer]:::security
        
        API --> SEC
    end

    subgraph Services
        AS[Authentication Service]:::service
        BS[Blogs Service]:::service
        WS[Wellness Service]:::service
        
        subgraph AuthService
            UM[User Model]
            UC[User Controllers]
            UR[User Routes]
            AM2[Auth Middleware]
            
            UC --> UM
            UR --> UC
            AM2 --> UR
        end
        
        subgraph WellnessService
            WM[Wellness Model]
            BMI[BMI Calculator]
            DPG[Diet Plan Generator]
            
            WS --> WM
            WS --> BMI
            WS --> DPG
        end
    end

    subgraph Database
        DB[(MongoDB)]:::database
        DBC[Database Config]
    end

    subgraph External
        REN[Render Hosting]:::external
        AI[AI Service]:::external
    end

    %% Main Connections
    Client --> API
    API --> AS
    API --> BS
    API --> WS
    AS --> DB
    BS --> DB
    WS --> DB
    WS --> AI
    DBC --> DB

    %% Click Events
    click FE "https://github.com/Ridham2808/ironcore_gym/tree/main/Frontend/vite_app"
    click AM "https://github.com/Ridham2808/ironcore_gym/tree/main/Frontend/vite_app/src/Authentication"
    click CP "https://github.com/Ridham2808/ironcore_gym/tree/main/Frontend/vite_app/src/pages"
    click SC "https://github.com/Ridham2808/ironcore_gym/tree/main/Frontend/vite_app/src/components"
    click DC "https://github.com/Ridham2808/ironcore_gym/tree/main/Frontend/vite_app/src/design"
    click AS "https://github.com/Ridham2808/ironcore_gym/tree/main/Backend/User-Auth"
    click BS "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/Blogs/blogs.js"
    click WS "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/Wellness/wellness.js"
    click DBC "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/User-Auth/config/db.js"
    click UM "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/User-Auth/models/userModel.js"
    click AM2 "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/User-Auth/middleware/authMiddleware.js"
    click UC "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/User-Auth/controllers/userController.js"
    click UR "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/User-Auth/routes/userRoutes.js"
    click WM "https://github.com/Ridham2808/ironcore_gym/blob/main/Backend/Wellness/wellnessModel.js"

    %% Styling
    classDef gateway fill:#f9a,stroke:#333
    classDef service fill:#acf,stroke:#333
    classDef database fill:#fda,stroke:#333
    classDef external fill:#dad,stroke:#333
    classDef security fill:#faa,stroke:#333

    %% Legend
    subgraph Legend
        L1[Gateway]:::gateway
        L2[Service]:::service
        L3[Database]:::database
        L4[External Service]:::external
        L5[Security]:::security
    end
```
