# mohitagrawal16/contentcrew architecture

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

- Interactive diagram: https://gitdiagram.com/mohitagrawal16/contentcrew
- Repository: https://github.com/mohitagrawal16/contentcrew

## Overview

##### Project type and purpose
- This is a full-stack web application (“ContentCrew”) for collaborative content creation and review.
- Frontend: React.js + Redux Toolkit + Tailwind CSS
- Backend: Node.js + Express.js with an MVC structure
- Database: MongoDB
- External services: Cloudinary for file storage, JWT/bcrypt for auth, Vercel for deployment

##### File structure
- Top-level separation:
- Backend/ – contains an Express MVC service
- Frontend/ – contains a React SPA with components, pages, store, utils
- Backend directory highlights:
- src/controllers – REST controllers (user, workspace, post, task)
- src/models – Mongoose schemas
- src/routes – route definitions mapping to controllers
- src/middlewares – auth, file-upload (Multer), route guards
- src/db/db.js – MongoDB connection
- src/utils – error handling, API responses, Cloudinary config
- Frontend directory highlights:
- src/components – reusable UI (Sidebar, Task, Post, PrivateRoute, etc.)
- src/pages – route-mapped views (Home, Login, Profile, WorkspaceDetails, etc.)
- src/store – Redux slices (authSlice) and store setup
- src/utils/apiClient.js – Axios wrapper for calling backend APIs

##### README for additional insights
- Features: workspaces, task assignment, post review
- Tech stack confirms MVC backend and Redux-managed SPA
- Deployment on Vercel implies separate hosting for frontend and backend

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Client Layer
    subgraph "Client Layer"
        direction TB
        Browser["User Browser / React SPA"]:::client
        Entry["main.jsx & App.jsx"]:::client
        Components["UI Components"]:::client
        Pages["Pages"]:::client
        Store["Redux Store & Slices"]:::client
        ApiClient["API Client (Axios)"]:::client
        Browser --> Entry
        Entry --> Components
        Components --> Pages
        Pages --> Store
        Store --> ApiClient
    end

    %% API Layer
    subgraph "API Layer"
        direction TB
        AppServer["Express.js API"]:::server
        Controllers["Controllers"]:::server
        Routes["Routes"]:::server
        Models["Models"]:::server
        AuthMW["JWT Auth Middleware"]:::middleware
        MulterMW["File Upload Middleware"]:::middleware
        CloudUtils["Cloudinary Utils"]:::middleware
        ErrorUtils["Error Handling & API Response Utils"]:::server
        DBConn["DB Connection (db.js)"]:::server
        Const["App Constants"]:::server

        AppServer --> Controllers
        AppServer --> Routes
        AppServer --> Models
        AppServer --> AuthMW
        AppServer --> MulterMW
        AppServer --> ErrorUtils
        AppServer --> DBConn
        AppServer --> Const
    end

    %% Data Layer
    subgraph "Data Layer"
        direction TB
        MongoDB["MongoDB (Mongoose ODM)"]:::db
        Cloudinary["Cloudinary"]:::external
    end

    %% Deployment Layer
    subgraph "Deployment Layer"
        direction TB
        VercelFE["Frontend Deployment"]:::deploy
        VercelBE["Backend Deployment"]:::deploy
    end

    %% Connections
    ApiClient -->|"REST calls / JSON"| AppServer
    AppServer -->|"CRUD via Mongoose"| MongoDB
    AppServer -->|"File upload via Multer+SDK"| Cloudinary
    VercelFE -.-> Browser
    VercelBE -.-> AppServer

    %% Click Events
    click Browser "https://github.com/mohitagrawal16/contentcrew/tree/main/Frontend/src"
    click Entry "https://github.com/mohitagrawal16/contentcrew/blob/main/Frontend/src/main.jsx"
    click Components "https://github.com/mohitagrawal16/contentcrew/tree/main/Frontend/src/components"
    click Pages "https://github.com/mohitagrawal16/contentcrew/tree/main/Frontend/src/pages"
    click Store "https://github.com/mohitagrawal16/contentcrew/blob/main/Frontend/src/store/store.js"
    click ApiClient "https://github.com/mohitagrawal16/contentcrew/blob/main/Frontend/src/utils/apiClient.js"
    click AppServer "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/app.js"
    click Controllers "https://github.com/mohitagrawal16/contentcrew/tree/main/Backend/src/controllers"
    click Routes "https://github.com/mohitagrawal16/contentcrew/tree/main/Backend/src/routes"
    click Models "https://github.com/mohitagrawal16/contentcrew/tree/main/Backend/src/models"
    click AuthMW "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/middlewares/auth.middleware.js"
    click MulterMW "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/middlewares/multer.middleware.js"
    click CloudUtils "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/utils/cloudinary.js"
    click ErrorUtils "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/utils/ApiError.js"
    click DBConn "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/db/db.js"
    click Const "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/src/constants.js"
    click VercelFE "https://github.com/mohitagrawal16/contentcrew/blob/main/Frontend/vercel.json"
    click VercelBE "https://github.com/mohitagrawal16/contentcrew/blob/main/Backend/vercel.json"

    %% Styles
    classDef client fill:#cce5ff,stroke:#0066cc,color:#003366;
    classDef server fill:#d4edda,stroke:#28a745,color:#155724;
    classDef middleware fill:#fff3cd,stroke:#ffc107,color:#856404,stroke-dasharray: 5 5;
    classDef db fill:#e2e3e5,stroke:#6c757d,color:#343a40,stroke-dasharray: 2 2;
    classDef external fill:#ffe5b4,stroke:#ff8c00,color:#8b4513,stroke-dasharray: 5 5;
    classDef deploy fill:#f0f0f0,stroke:#888888,color:#333333,stroke-dasharray: 2 2;
```
