# manthansubhash01/projectport architecture

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

- Interactive diagram: https://gitdiagram.com/manthansubhash01/projectport
- Repository: https://github.com/manthansubhash01/projectport

## Overview

##### Project type and purpose
- This is a full-stack web application called “ProjectPort,” designed to let users submit, showcase, and browse peer projects in real time.
- The frontend is a React/Vite single-page app. The backend is a Node.js/Express REST API, backed by a database and integrating with an external OpenAI helper.

##### File structure
- Top-level folders:
- Backend – contains config, models, controllers, routes, middleware, utils, and server.js
- Frontend/ideavault – a Vite-powered React application with components, styles, and deployment config (vercel.json)
- Backend pattern: classic MVC (models in `models/`, controllers in `controllers/`, routes in `routes/`, middleware in `middleware/`, utilities in `utils/`)
- Config files: `Backend/config/dbConnection.js` (DB setup), `vite.config.js` and `vercel.json` (frontend build/deploy)

##### README for additional insights
- Very brief: confirms the real-time “submit/showcase/explore” workflow but no low-level architecture details.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Frontend Layer"
        direction TB
        Browser["User Browser"]:::frontend
        ReactSPA["React SPA"]:::frontend
        Components["UI Components"]:::frontend
        Entry["main.jsx"]:::frontend
        AppShell["App.jsx"]:::frontend
        ViteConfig["vite.config.js"]:::frontend
        Vercel["vercel.json"]:::frontend
    end

    subgraph "Backend Layer"
        direction TB
        Server["server.js"]:::backend
        Config["dbConnection.js"]:::backend
        Auth["authMiddleware.js"]:::backend
        OpenAIUtil["openaiHelper.js"]:::backend
        subgraph "Routes"
            direction TB
            ProjectRoutes["projectRoutes.js"]:::backend
            AdminRoutes["adminRoutes.js"]:::backend
        end
        subgraph "Controllers"
            direction TB
            ProjectCtrl["projectController.js"]:::backend
            AdminCtrl["adminController.js"]:::backend
        end
        subgraph "Models"
            direction TB
            ProjectModel["project.js"]:::backend
            AdminModel["Admin.js"]:::backend
        end
    end

    subgraph "Database"
        direction TB
        MongoDB["MongoDB (Mongoose)"]:::database
    end

    subgraph "External Services"
        direction TB
        OpenAI["OpenAI Service"]:::external
    end

    Browser --> ReactSPA
    ReactSPA -->|"HTTP/HTTPS"| Server
    Server --> Config
    Server --> ProjectRoutes
    Server --> AdminRoutes
    ProjectRoutes -->|"calls"| ProjectCtrl
    AdminRoutes -->|"calls"| AdminCtrl
    ProjectCtrl -->|"uses Model"| ProjectModel
    AdminCtrl -->|"uses Model"| AdminModel
    ProjectCtrl -->|"calls util"| OpenAIUtil
    OpenAIUtil -->|"API Request"| OpenAI
    ProjectModel -->|"CRUD"| MongoDB
    AdminModel -->|"CRUD"| MongoDB

    click ReactSPA "https://github.com/manthansubhash01/projectport/tree/main/Frontend/ideavault/src"
    click Components "https://github.com/manthansubhash01/projectport/tree/main/Frontend/ideavault/src/components"
    click Entry "https://github.com/manthansubhash01/projectport/blob/main/Frontend/ideavault/src/main.jsx"
    click AppShell "https://github.com/manthansubhash01/projectport/blob/main/Frontend/ideavault/src/App.jsx"
    click ViteConfig "https://github.com/manthansubhash01/projectport/blob/main/Frontend/ideavault/vite.config.js"
    click Vercel "https://github.com/manthansubhash01/projectport/blob/main/Frontend/ideavault/vercel.json"
    click Server "https://github.com/manthansubhash01/projectport/blob/main/Backend/server.js"
    click Config "https://github.com/manthansubhash01/projectport/blob/main/Backend/config/dbConnection.js"
    click Auth "https://github.com/manthansubhash01/projectport/blob/main/Backend/middleware/authMiddleware.js"
    click OpenAIUtil "https://github.com/manthansubhash01/projectport/blob/main/Backend/utils/openaiHelper.js"
    click ProjectModel "https://github.com/manthansubhash01/projectport/blob/main/Backend/models/project.js"
    click AdminModel "https://github.com/manthansubhash01/projectport/blob/main/Backend/models/Admin.js"
    click ProjectCtrl "https://github.com/manthansubhash01/projectport/blob/main/Backend/controllers/projectController.js"
    click AdminCtrl "https://github.com/manthansubhash01/projectport/blob/main/Backend/controllers/adminController.js"
    click ProjectRoutes "https://github.com/manthansubhash01/projectport/blob/main/Backend/routes/projectRoutes.js"
    click AdminRoutes "https://github.com/manthansubhash01/projectport/blob/main/Backend/routes/adminRoutes.js"

    classDef frontend fill:#D0E8FF,stroke:#005B9F,color:#000;
    classDef backend fill:#E0F7E9,stroke:#2E7D32,color:#000;
    classDef database fill:#FFE7C0,stroke:#EF6C00,color:#000;
    classDef external fill:#F3E5F5,stroke:#6A1B9A,color:#000;
```
