# vishalmet/vibecoded-portfolio architecture

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

- Interactive diagram: https://gitdiagram.com/vishalmet/vibecoded-portfolio
- Repository: https://github.com/vishalmet/vibecoded-portfolio

## Overview

##### Project type and purpose
- This is a full-stack portfolio web application
- Frontend: React + Vite + TypeScript, serves a personal portfolio UI (About, Experience, Projects, Admin dashboard)
- Backend: Node.js + TypeScript + Express (implied by folder layout), providing RESTful APIs and file‐upload support
- Database: MongoDB for storing experiences and project metadata

##### File structure
- Top level
– client/ : React/Vite front-end code with pages, UI components, assets, environment config
– server/ : Node/TypeScript back-end code with config, database connection, middleware, models, routes, uploads folder
– package.json (root) orchestrates install and dev scripts for both sides
- client/ highlights
– src/pages/ : the routed UI pages (About, Experience, Projects, admin)
– src/components/ : reusable React components (Navbar, Footer, cursor effects, scroll behaviors)
– src/lib/utils.ts : shared utilities
– public/ : static assets, manifest, robots.txt, sitemap.xml
- server/ highlights
– src/config/db.ts : MongoDB connection logic
– src/middleware/upload.ts : handles multipart file uploads
– src/models/ : Mongoose (or equivalent) schemas for experience and project
– src/routes/ : Express route definitions for CRUD on experience, projects, admin actions
– uploads/projects/ : persisted project images or attachments

##### README for additional insights
- Scripts to install both sides and run in parallel (npm run dev, client, server)
- Environment variables used:
– Client: VITE_API_URL pointing to backend
– Server: PORT, NODE_ENV, MONGODB_URI

##### Detail without over-splitting
- Every major folder function (routes vs. middleware vs. models)
- Build/deploy artifacts (Vite, nodemon.json) only if they affect runtime behavior

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Frontend Layer
    subgraph "Frontend Layer"
        direction TB
        Browser["Browser"]:::frontend
        ReactApp["React App (Vite)"]:::frontend
        Pages["Routed UI Pages"]:::frontend
        Components["Reusable UI Components"]:::frontend
        Utils["Shared Frontend Utilities"]:::frontend
        Static["Public Static Assets"]:::frontend
        FEEnv["Frontend Environment Config"]:::config
        FEDeploy["Frontend Build & Deployment Config"]:::config
    end

    %% Backend Layer
    subgraph "Backend Layer"
        direction TB
        APIServer["API Server (Node.js + Express)"]:::backend
        DBConfig["MongoDB Connection Logic"]:::config
        UploadMW["File-Upload Middleware"]:::backend
        ExpRoutes["Experience CRUD Routes"]:::backend
        ProjRoutes["Project CRUD Routes"]:::backend
        AdminRoutes["Admin Routes"]:::backend
        ExpModel["Experience Schema/Model"]:::backend
        ProjModel["Project Schema/Model"]:::backend
        ServerEnv["Server Environment Config"]:::config
        SVDeploy["Server Build & Deployment Config"]:::config
        DevConfig["Server Development Config"]:::config
        FileStore["Local File Store for Project Assets"]:::data
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        MongoDB["MongoDB Database"]:::data
    end

    %% Connections - Frontend to Backend
    Browser --> ReactApp
    ReactApp -->|"calls API"| APIServer
    FEEnv --> ReactApp
    FEDeploy --> ReactApp

    %% Frontend internal
    ReactApp --> Pages
    ReactApp --> Components
    ReactApp --> Utils
    ReactApp --> Static

    %% Connections - Backend internals
    APIServer --> DBConfig
    APIServer --> ExpRoutes
    APIServer --> ProjRoutes
    APIServer --> AdminRoutes
    APIServer --> UploadMW
    APIServer --> ServerEnv
    APIServer --> SVDeploy
    APIServer --> DevConfig

    ExpRoutes --> ExpModel
    ProjRoutes --> ProjModel
    ExpModel --> MongoDB
    ProjModel --> MongoDB

    UploadMW --> FileStore
    ProjRoutes -->|"POST /projects (file upload)"| UploadMW

    %% Data layer connections
    APIServer --> MongoDB

    %% Click Events
    click ReactApp "https://github.com/vishalmet/vibecoded-portfolio/tree/main/client/src"
    click Pages "https://github.com/vishalmet/vibecoded-portfolio/tree/main/client/src/pages"
    click Components "https://github.com/vishalmet/vibecoded-portfolio/tree/main/client/src/components"
    click Utils "https://github.com/vishalmet/vibecoded-portfolio/blob/main/client/src/lib/utils.ts"
    click Static "https://github.com/vishalmet/vibecoded-portfolio/tree/main/client/public"
    click FEEnv "https://github.com/vishalmet/vibecoded-portfolio/blob/main/client/.env.example"
    click FEDeploy "https://github.com/vishalmet/vibecoded-portfolio/blob/main/client/vercel.json"
    click APIServer "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/index.ts"
    click DBConfig "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/config/db.ts"
    click UploadMW "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/middleware/upload.ts"
    click ExpRoutes "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/routes/experience.ts"
    click ProjRoutes "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/routes/project.ts"
    click AdminRoutes "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/routes/admin.ts"
    click ExpModel "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/models/experience.ts"
    click ProjModel "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/src/models/project.ts"
    click ServerEnv "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/.env.example"
    click SVDeploy "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/vercel.json"
    click DevConfig "https://github.com/vishalmet/vibecoded-portfolio/blob/main/server/nodemon.json"
    click FileStore "https://github.com/vishalmet/vibecoded-portfolio/tree/main/server/uploads/projects"

    %% Styles
    classDef frontend fill:#E0F7FA,stroke:#00796B,stroke-width:1px
    classDef backend fill:#E8F5E9,stroke:#2E7D32,stroke-width:1px
    classDef data fill:#FFF9C4,stroke:#F9A825,stroke-width:1px
    classDef config fill:#F3E5F5,stroke:#6A1B9A,stroke-width:1px
```
