# shreya22-prog/version-control-platform architecture

> Architecture diagram of the GitHub repository shreya22-prog/version-control-platform, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/shreya22-prog/version-control-platform
- Repository: https://github.com/shreya22-prog/version-control-platform

## Overview

This MERN GitHub replica combines a web interface for account, profile, repository, and issue management with a custom command-line version-control workflow. The CLI initializes repositories, stages files, commits, pushes and pulls commits to S3, and can revert to a commit. The sampled backend shows Express routes dispatching to controllers, which persist users, repositories, and issues. The frontend source sampled includes routing and page components, but does not establish how those pages call the backend; those links are omitted.

Main entry points: [`backend-main/index.js`](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/index.js) (Server and CLI entry), [`frontend-main/src/Routes.jsx`](https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/Routes.jsx) (Page routing), [`backend-main/routes/main.router.js`](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/main.router.js) (Main router), [`backend-main/controllers/repoController.js`](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/repoController.js) (Repository management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web interface"]
  node_routes_ui["Page routing<br/>[Routes.jsx]"]
  node_auth_ui["Login and signup"]
  node_dashboard["Dashboard<br/>[Dashboard.jsx]"]
  node_profile["User profile<br/>[Profile.jsx]"]
  node_heatmap["Activity heatmap<br/>[HeatMap.jsx]"]
end

subgraph group_api["HTTP API"]
  node_main_router["Main router<br/>[main.router.js]"]
  node_user_routes["User routes<br/>[user.router.js]"]
  node_repo_routes["Repository routes<br/>[repo.router.js]"]
  node_issue_routes["Issue routes<br/>[issue.router.js]"]
  node_user_controller["User management<br/>[userController.js]"]
  node_repo_controller["Repository management<br/>[repoController.js]"]
  node_issue_controller["Issue management<br/>[issueController.js]"]
end

subgraph group_vcs["Version control"]
  node_server_entry["Server and CLI entry<br/>[index.js]"]
  node_init["Initialize repository<br/>[init.js]"]
  node_add["Stage file<br/>[add.js]"]
  node_commit["Create commit<br/>[commit.js]"]
  node_push["Push commits<br/>[push.js]"]
  node_pull["Pull commits<br/>[pull.js]"]
  node_revert["Revert commit<br/>[revert.js]"]
end

subgraph group_state["Persistence"]
  node_users[("User records<br/>[userModel.js]")]
  node_repositories[("Repository records<br/>[repoModel.js]")]
  node_issues[("Issue records<br/>[issueModel.js]")]
end

node_browser(("Browser user"))
node_http_client(("API caller"))
node_cli_user(("CLI user"))
node_mongo[("MongoDB")]
node_s3[("AWS S3")]

node_browser -->|"opens pages"| node_routes_ui
node_routes_ui -->|"routes to"| node_auth_ui
node_routes_ui -->|"routes to"| node_dashboard
node_routes_ui -->|"routes to"| node_profile
node_profile -->|"renders"| node_heatmap
node_http_client -->|"sends requests"| node_main_router
node_main_router -->|"mounts"| node_user_routes
node_main_router -->|"mounts"| node_repo_routes
node_main_router -->|"mounts"| node_issue_routes
node_user_routes -->|"dispatches"| node_user_controller
node_repo_routes -->|"dispatches"| node_repo_controller
node_issue_routes -->|"dispatches"| node_issue_controller
node_user_controller -->|"reads and writes"| node_mongo
node_repo_controller -->|"reads and writes"| node_repositories
node_repo_controller -->|"populates owner"| node_users
node_repo_controller -->|"populates issues"| node_issues
node_issue_controller -->|"reads and writes"| node_issues
node_cli_user -->|"runs commands"| node_server_entry
node_server_entry -->|"dispatches init"| node_init
node_server_entry -->|"dispatches add"| node_add
node_server_entry -->|"dispatches commit"| node_commit
node_server_entry -->|"dispatches push"| node_push
node_server_entry -->|"dispatches pull"| node_pull
node_server_entry -->|"dispatches revert"| node_revert
node_push -->|"uploads commits"| node_s3
node_pull -->|"downloads commits"| node_s3

click node_routes_ui "https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/Routes.jsx"
click node_auth_ui "https://github.com/shreya22-prog/version-control-platform/tree/main/frontend-main/src/components/auth"
click node_dashboard "https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/components/dashboard/Dashboard.jsx"
click node_profile "https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/components/user/Profile.jsx"
click node_heatmap "https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/components/user/HeatMap.jsx"
click node_main_router "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/main.router.js"
click node_user_routes "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/user.router.js"
click node_repo_routes "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/repo.router.js"
click node_issue_routes "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/issue.router.js"
click node_user_controller "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/userController.js"
click node_repo_controller "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/repoController.js"
click node_issue_controller "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/issueController.js"
click node_server_entry "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/index.js"
click node_init "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/init.js"
click node_add "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/add.js"
click node_commit "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/commit.js"
click node_push "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/push.js"
click node_pull "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/pull.js"
click node_revert "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/revert.js"
click node_users "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/models/userModel.js"
click node_repositories "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/models/repoModel.js"
click node_issues "https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/models/issueModel.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_routes_ui,node_auth_ui,node_dashboard,node_profile,node_heatmap,node_browser,node_cli_user toneBlue
class node_main_router,node_user_routes,node_repo_routes,node_issue_routes,node_user_controller,node_repo_controller,node_issue_controller,node_mongo,node_s3 toneAmber
class node_server_entry,node_init,node_add,node_commit,node_push,node_pull,node_revert,node_http_client toneMint
class node_users,node_repositories,node_issues toneRose
```

## Components

### Web interface

- [Page routing](https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/Routes.jsx): `frontend-main/src/Routes.jsx`
- [Login and signup](https://github.com/shreya22-prog/version-control-platform/tree/main/frontend-main/src/components/auth): `frontend-main/src/components/auth`
- [Dashboard](https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/components/dashboard/Dashboard.jsx): `frontend-main/src/components/dashboard/Dashboard.jsx`
- [User profile](https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/components/user/Profile.jsx): `frontend-main/src/components/user/Profile.jsx`
- [Activity heatmap](https://github.com/shreya22-prog/version-control-platform/blob/main/frontend-main/src/components/user/HeatMap.jsx): `frontend-main/src/components/user/HeatMap.jsx`

### HTTP API

- [Main router](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/main.router.js): `backend-main/routes/main.router.js`
- [User routes](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/user.router.js): `backend-main/routes/user.router.js`
- [Repository routes](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/repo.router.js): `backend-main/routes/repo.router.js`
- [Issue routes](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/routes/issue.router.js): `backend-main/routes/issue.router.js`
- [User management](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/userController.js): `backend-main/controllers/userController.js`
- [Repository management](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/repoController.js): `backend-main/controllers/repoController.js`
- [Issue management](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/issueController.js): `backend-main/controllers/issueController.js`

### Version control

- [Server and CLI entry](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/index.js): `backend-main/index.js`
- [Initialize repository](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/init.js): `backend-main/controllers/init.js`
- [Stage file](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/add.js): `backend-main/controllers/add.js`
- [Create commit](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/commit.js): `backend-main/controllers/commit.js`
- [Push commits](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/push.js): `backend-main/controllers/push.js`
- [Pull commits](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/pull.js): `backend-main/controllers/pull.js`
- [Revert commit](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/controllers/revert.js): `backend-main/controllers/revert.js`

### Persistence

- [User records](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/models/userModel.js): `backend-main/models/userModel.js`
- [Repository records](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/models/repoModel.js): `backend-main/models/repoModel.js`
- [Issue records](https://github.com/shreya22-prog/version-control-platform/blob/main/backend-main/models/issueModel.js): `backend-main/models/issueModel.js`

### Other components

- **Browser user**
- **API caller**
- **CLI user**
- **MongoDB**
- **AWS S3**

## Connections

- Browser user → Page routing: opens pages
- Page routing → Login and signup: routes to
- Page routing → Dashboard: routes to
- Page routing → User profile: routes to
- User profile → Activity heatmap: renders
- API caller → Main router: sends requests
- Main router → User routes: mounts
- Main router → Repository routes: mounts
- Main router → Issue routes: mounts
- User routes → User management: dispatches
- Repository routes → Repository management: dispatches
- Issue routes → Issue management: dispatches
- User management → MongoDB: reads and writes
- Repository management → Repository records: reads and writes
- Repository management → User records: populates owner
- Repository management → Issue records: populates issues
- Issue management → Issue records: reads and writes
- CLI user → Server and CLI entry: runs commands
- Server and CLI entry → Initialize repository: dispatches init
- Server and CLI entry → Stage file: dispatches add
- Server and CLI entry → Create commit: dispatches commit
- Server and CLI entry → Push commits: dispatches push
- Server and CLI entry → Pull commits: dispatches pull
- Server and CLI entry → Revert commit: dispatches revert
- Push commits → AWS S3: uploads commits
- Pull commits → AWS S3: downloads commits
