How ananya-hegde2001/codevault works
1. CodeVault- is split into two deployable surfaces: a React/Vite single-page frontend in frontend-main and an Express/Node backend in backend-main. The frontend is the presentation layer; the backend owns authentication, repository workflow, and data mutations.
2. The frontend is organized by user journey rather than by API domain. src/components/auth handles login/signup, dashboard is the landing workspace, and src/components/user contains repository-centric screens such as create repository, repository details, profile, and a heatmap view. App.jsx, Routes.jsx, authContext.jsx, and themeContext.jsx provide app-wide routing and state.
3. Authentication is a first-class boundary. The backend has userController plus authMiddleware and authorizeMiddleware, which suggests protected endpoints and role/ownership checks. On the frontend, auth state is likely lifted into authContext and used to gate routes and navigation.
4. The backend is organized as an API layer over feature controllers. Routes are separated into main.router, repo.router, user.router, and issue.router, which map to controllers for repo operations, commits, push/pull/revert flows, user actions, and issues. This separation is important for diagramming because it shows the app is domain-driven rather than monolithic.
5. Repository/version-control behavior is the core subsystem. Controllers like init, add, commit, push, pull, and revert indicate CodeVault implements a GitHub-like workflow, not just generic CRUD. These operations likely transform repository state, create commit records, and synchronize local snapshots with stored repository metadata.
6. The storage model appears to mix conventional app models with custom filesystem-backed artifacts. models/ contains userModel, repoModel, and issueModel, while .codeVault/commits contains per-commit folders with commit.json and tracked files. That suggests a hybrid architecture: structured app data through models, plus versioned repository contents stored as on-disk artifacts.
7. The .codeVault directory is an important architectural boundary. It looks like an internal repository workspace/history store containing commit snapshots and configuration, separate from the normal source tree. For architecture purposes, treat it as the persistence layer for repository history and local workflow state.
8. Issue tracking is a secondary subsystem tied to repositories and users. issueController and issueModel imply CRUD-style issue management, likely linked to a repository and created from the repo detail or dashboard views. It is distinct from commit history but shares the same authentication and repository context.
9. There is an external integration seam for AWS. config/aws-config.js indicates the backend can be wired to cloud services, though the exact service is not visible here. Architecturally, this is a configurable integration point rather than the app’s core runtime.
10. The request flow is straightforward: user action in the React UI goes through routed components, hits Express endpoints, passes auth/authorization middleware, then reaches controllers. Controllers either read/write model data or manipulate .codeVault repository artifacts, and the response drives UI updates in the dashboard or repository detail screens.
11. A few files suggest supporting workflows rather than runtime features: WORKFLOW_GUIDE.md and root-level commit.json/update.js likely help with the project’s custom development or repository sync process. They are useful to note on a diagram as operational tooling, but they are not the main product path.
12. The cleanest architecture diagram should therefore show: frontend SPA → backend API → auth/authorization → repo/user/issue controllers → models and .codeVault storage, with AWS as an optional side integration and the issue subsystem attached to repository/user data.
Main entry points: Routes.jsx Routes · main.router.js Main routes · commit.js Repo ops · App.jsx App shell
Components 20
Frontend SPA
React/Vite presentation layer and route/state orchestration.
- App shell · Top-level SPA bootstrap, routing, and context wiring.
frontend-main/src/App.jsx - Routes · Client-side route definitions for the main user journeys.
frontend-main/src/Routes.jsx - Auth state · Lifts authentication state for route gating and UI access.
frontend-main/src/authContext.jsx - Theme state · Shared UI theme state across the SPA.
frontend-main/src/themeContext.jsx - Auth screens · Login and signup journey.
frontend-main/src/components/auth/Login.jsx - Dashboard · Primary landing workspace after sign-in.
frontend-main/src/components/dashboard/Dashboard.jsx - Repo screens · Repository creation, details, profile, and heatmap views.
frontend-main/src/components/user/RepositoryDetails.jsx
Backend API
Express/Node API, controllers, middleware, and data access.
- API entry · Server bootstrap and request entrypoint.
backend-main/index.js - Main routes · Top-level request routing for the API.
backend-main/routes/main.router.js - Repo routes · Repository workflow endpoints.
backend-main/routes/repo.router.js - User routes · User and account endpoints.
backend-main/routes/user.router.js - Issue routes · Issue management endpoints.
backend-main/routes/issue.router.js - Auth guard · Authentication and authorization checks for protected access.
backend-main/middleware/authMiddleware.js - Repo ops · Init, add, commit, push, pull, and revert workflow handling.
backend-main/controllers/commit.js - User ctrl · User account and profile actions.
backend-main/controllers/userController.js - Issue ctrl · Repository-linked issue handling.
backend-main/controllers/issueController.js - AWS config · External cloud integration seam.
backend-main/config/aws-config.js
Persistence
Structured models and repository-history artifacts.
- App models · User, repository, and issue persistence models.
backend-main/models/repoModel.js - .codeVault · Filesystem-backed repository history, commits, and local workflow state.
backend-main/.codeVault
Operational Tools
Supporting workflow and sync artifacts outside the main runtime.
- Workflow docs · Supporting development and sync workflow guidance.
WORKFLOW_GUIDE.md
Connections 25
- App shell → Routes: uses · App shell wires client routes.
- App shell → Auth state: shares · Global auth state is provided across the app.
- App shell → Theme state: shares · Global theme state is provided across the app.
- Routes → Auth screens: routes · Routes expose login and signup screens.
- Routes → Dashboard: routes · Routes expose the main workspace.
- Routes → Repo screens: routes · Routes expose repository-centric user screens.
- Auth screens → Auth state: updates · Auth screens feed sign-in state into context.
- Dashboard → API entry: api calls · Workspace actions call the backend API.
- Repo screens → API entry: api calls · Repository and profile screens call the backend API.
- API entry → Main routes: mounts · Server bootstraps the main router.
- Main routes → Repo routes: delegates · Main routing delegates repository endpoints.
- Main routes → User routes: delegates · Main routing delegates user endpoints.
- Main routes → Issue routes: delegates · Main routing delegates issue endpoints.
- Repo routes → Auth guard: protected by · Repository actions require authentication and authorization.
- User routes → Auth guard: protected by · User actions require auth checks.
- Issue routes → Auth guard: protected by · Issue actions require auth checks.
- Repo routes → Repo ops: handled by · Repository routes execute workflow controllers.
- User routes → User ctrl: handled by · User routes execute user controller logic.
- Issue routes → Issue ctrl: handled by · Issue routes execute issue controller logic.
- Repo ops → App models: reads/writes · Controllers persist structured repository data.
- User ctrl → App models: reads/writes · Controllers persist user data.
- Issue ctrl → App models: reads/writes · Controllers persist issue data.
- Repo ops → .codeVault: manages · Repository operations create and update commit artifacts.
- Repo ops → AWS config: optional · Backend can integrate with configured AWS services.
- Workflow docs → .codeVault: describes · Workflow docs explain the custom repository store.