# bhanuvarma17/eva-project- architecture

> Architecture diagram of the GitHub repository bhanuvarma17/eva-project-, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhanuvarma17/eva-project-
- Repository: https://github.com/bhanuvarma17/eva-project-

## Overview

1. **Overall shape**
This is a classic MERN split into two deployable parts: a React single-page frontend in `frontend/` and an Express/Node API in `backend/`, with MongoDB as the persistence layer. The root `package.json` appears to act mainly as a convenience layer for running/installing both halves together.

2. **Frontend boundary**
The frontend is responsible for all user-facing pages: Home, Contact, and Testimonials. It is organized as component-driven React code under `frontend/src/components/`, with shared styling in CSS files and a central theme palette in `frontend/src/theme/colors.js`.

3. **Frontend data access**
All API communication is funneled through `frontend/src/utils/api.js`, which is the main client-side boundary to the backend. This keeps the page components focused on rendering and form handling rather than direct network logic.

4. **Frontend page composition**
`App.js` likely routes or conditionally renders the main sections, while `Navigation.js` provides navigation across the site and `Footer.js` closes the layout. `Home.js`, `Contact.js`, `Plans.js`, and `Testimonials.js` are the main content modules that together form the brochure-style site.

5. **Backend entrypoint**
`backend/server.js` is the API host and the top-level backend composition point. It would typically configure Express middleware, connect to MongoDB using environment variables, mount the route modules, and listen on the configured port.

6. **Backend API layer**
The backend is split into route modules and controller modules. `backend/routes/contactRoutes.js` and `backend/routes/testimonialRoutes.js` define the HTTP endpoints, while the corresponding controllers implement the request handling and business logic.

7. **Persistence model**
MongoDB is accessed through two document models: `Contact.js` and `Testimonial.js`. These represent the two core data domains of the app: inbound customer inquiries and customer testimonials.

8. **Primary data flows**
There are two main flows:
- A visitor submits the contact form from the frontend; the request goes to `POST /api/contact`, is handled by the contact controller, and is stored in MongoDB as a contact submission.
- A visitor views or submits testimonials; the frontend reads approved testimonials from `GET /api/testimonials`, while testimonial submissions are stored in MongoDB and can later be reviewed via the admin-style `GET /api/testimonials/all`.

9. **Public vs. admin-style access**
The API distinguishes between public listing endpoints and “all records” endpoints. `/api/testimonials` returns only approved items for the public site, while `/api/testimonials/all` and `/api/contact/all` expose full collections for administrative use. There is no visible auth layer in the repository, so these endpoints are structurally separated but not protected in the code layout shown.

10. **Content seeding**
`backend/scripts/seedTestimonials.js` is an offline utility that preloads testimonial data into MongoDB. This supports the Testimonials page by ensuring there is initial content without manual entry.

11. **Configuration and runtime**
The backend expects environment-based configuration, with `backend/env.example` indicating at least `MONGODB_URI` and `PORT`. The project runs in Node.js on the backend and in the browser on the frontend, with development scripts supporting concurrent startup.

12. **Styling and design system**
The UI uses a fixed color palette defined in `frontend/src/theme/colors.js` and repeated across component-specific CSS files. This is important architecturally because visual consistency is centralized as a small theme module rather than embedded ad hoc in each component.

13. **External dependencies and infrastructure**
The only materially important external service is MongoDB, either local or Atlas, since it is the shared system of record for both contacts and testimonials. Express serves as the backend HTTP interface, and React serves as the client-side rendering/runtime layer.

14. **What to draw in a diagram**
A useful architecture diagram would show: browser user → React SPA → API utility layer → Express routes/controllers → MongoDB models/database, plus a separate arrow from `seedTestimonials.js` into MongoDB. The frontend should be shown as a presentation layer, the backend as an API/application layer, and MongoDB as the persistence layer.

Main entry points: [`frontend/src/App.js`](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/App.js) (App), [`backend/server.js`](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/server.js) (Server), [`frontend/src/utils/api.js`](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/utils/api.js) (API client), [`backend/models/Testimonial.js`](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/models/Testimonial.js) (Testimonial model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workspace["Workspace"]
  node_root_package["Root pkg<br/>workspace scripts<br/>[package.json]"]
end

subgraph group_frontend["Frontend"]
  node_frontend_app["App<br/>React shell<br/>[App.js]"]
  node_frontend_nav["Navigation<br/>UI component<br/>[Navigation.js]"]
  node_frontend_footer["Footer<br/>UI component<br/>[Footer.js]"]
  node_frontend_home["Home<br/>page component<br/>[Home.js]"]
  node_frontend_contact["Contact<br/>page component<br/>[Contact.js]"]
  node_frontend_plans["Plans<br/>page component<br/>[Plans.js]"]
  node_frontend_testimonials["Testimonials<br/>page component<br/>[Testimonials.js]"]
  node_frontend_api["API client<br/>fetch utility<br/>[api.js]"]
  node_frontend_theme["Colors<br/>theme palette<br/>[colors.js]"]
  node_frontend_index["Client entry<br/>React bootstrap<br/>[index.js]"]
end

subgraph group_backend["Backend"]
  node_backend_server["Server<br/>Express host<br/>[server.js]"]
  node_backend_contact_routes["Contact routes<br/>HTTP routes<br/>[contactRoutes.js]"]
  node_backend_testimonial_routes["Testimonial routes<br/>HTTP routes"]
  node_backend_contact_controller["Contact ctrl<br/>request handler"]
  node_backend_testimonial_controller["Testimonial ctrl<br/>request handler"]
  node_backend_seed["Seed data<br/>offline script"]
end

subgraph group_data["Data"]
  node_backend_contact_model[("Contact model<br/>Mongo model<br/>[Contact.js]")]
  node_backend_testimonial_model[("Testimonial model<br/>Mongo model<br/>[Testimonial.js]")]
  node_mongodb[("MongoDB<br/>database")]
end

node_root_package -.->|"run client"| node_frontend_index
node_root_package -.->|"run api"| node_backend_server
node_frontend_index -->|"mounts"| node_frontend_app
node_frontend_app -->|"uses"| node_frontend_nav
node_frontend_app -->|"uses"| node_frontend_footer
node_frontend_app -->|"renders"| node_frontend_home
node_frontend_app -->|"renders"| node_frontend_contact
node_frontend_app -->|"renders"| node_frontend_plans
node_frontend_app -->|"renders"| node_frontend_testimonials
node_frontend_home -.->|"styles"| node_frontend_theme
node_frontend_contact -->|"calls"| node_frontend_api
node_frontend_testimonials -->|"calls"| node_frontend_api
node_frontend_nav -.->|"styles"| node_frontend_theme
node_frontend_footer -.->|"styles"| node_frontend_theme
node_backend_server -->|"mounts"| node_backend_contact_routes
node_backend_server -->|"mounts"| node_backend_testimonial_routes
node_backend_contact_routes -->|"dispatches"| node_backend_contact_controller
node_backend_testimonial_routes -->|"dispatches"| node_backend_testimonial_controller
node_backend_contact_controller -->|"uses"| node_backend_contact_model
node_backend_testimonial_controller -->|"uses"| node_backend_testimonial_model
node_backend_contact_model -->|"stores"| node_mongodb
node_backend_testimonial_model -->|"stores"| node_mongodb
node_backend_seed -->|"loads"| node_backend_testimonial_model
node_backend_seed -->|"seeds"| node_mongodb
node_frontend_api -->|"HTTP API"| node_backend_server

click node_root_package "https://github.com/bhanuvarma17/eva-project-/blob/main/package.json"
click node_frontend_app "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/App.js"
click node_frontend_nav "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Navigation.js"
click node_frontend_footer "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Footer.js"
click node_frontend_home "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Home.js"
click node_frontend_contact "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Contact.js"
click node_frontend_plans "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Plans.js"
click node_frontend_testimonials "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Testimonials.js"
click node_frontend_api "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/utils/api.js"
click node_frontend_theme "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/theme/colors.js"
click node_frontend_index "https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/index.js"
click node_backend_server "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/server.js"
click node_backend_contact_routes "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/routes/contactRoutes.js"
click node_backend_testimonial_routes "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/routes/testimonialRoutes.js"
click node_backend_contact_controller "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/controllers/contactController.js"
click node_backend_testimonial_controller "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/controllers/testimonialController.js"
click node_backend_contact_model "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/models/Contact.js"
click node_backend_testimonial_model "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/models/Testimonial.js"
click node_backend_seed "https://github.com/bhanuvarma17/eva-project-/blob/main/backend/scripts/seedTestimonials.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_root_package toneBlue
class node_frontend_app,node_frontend_nav,node_frontend_footer,node_frontend_home,node_frontend_contact,node_frontend_plans,node_frontend_testimonials,node_frontend_api,node_frontend_theme,node_frontend_index toneAmber
class node_backend_server,node_backend_contact_routes,node_backend_testimonial_routes,node_backend_contact_controller,node_backend_testimonial_controller,node_backend_seed toneMint
class node_backend_contact_model,node_backend_testimonial_model,node_mongodb toneRose
```

## Components

### Workspace

Root-level convenience and repo orchestration

- [Root pkg](https://github.com/bhanuvarma17/eva-project-/blob/main/package.json): workspace scripts · Top-level package for running both halves together · `package.json`

### Frontend

React presentation layer

- [App](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/App.js): React shell · Top-level client composition and page switching · `frontend/src/App.js`
- [Navigation](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Navigation.js): UI component · Site-wide navigation bar · `frontend/src/components/Navigation.js`
- [Footer](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Footer.js): UI component · Shared page footer · `frontend/src/components/Footer.js`
- [Home](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Home.js): page component · Main landing content · `frontend/src/components/Home.js`
- [Contact](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Contact.js): page component · Contact page and submission form · `frontend/src/components/Contact.js`
- [Plans](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Plans.js): page component · Service or pricing content section · `frontend/src/components/Plans.js`
- [Testimonials](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/components/Testimonials.js): page component · Customer testimonial display and submission UI · `frontend/src/components/Testimonials.js`
- [API client](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/utils/api.js): fetch utility · Single client-side boundary for backend calls · `frontend/src/utils/api.js`
- [Colors](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/theme/colors.js): theme palette · Shared color constants for the UI · `frontend/src/theme/colors.js`
- [Client entry](https://github.com/bhanuvarma17/eva-project-/blob/main/frontend/src/index.js): React bootstrap · Browser entrypoint and render bootstrap · `frontend/src/index.js`

### Backend

Express API layer

- [Server](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/server.js): Express host · API entrypoint and application composition · `backend/server.js`
- [Contact routes](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/routes/contactRoutes.js): HTTP routes · Endpoints for contact submissions · `backend/routes/contactRoutes.js`
- [Testimonial routes](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/routes/testimonialRoutes.js): HTTP routes · Endpoints for testimonial reads and writes · `backend/routes/testimonialRoutes.js`
- [Contact ctrl](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/controllers/contactController.js): request handler · Contact request processing and persistence logic · `backend/controllers/contactController.js`
- [Testimonial ctrl](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/controllers/testimonialController.js): request handler · Testimonial request processing and persistence logic · `backend/controllers/testimonialController.js`
- [Seed data](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/scripts/seedTestimonials.js): offline script · Preloads testimonial content into MongoDB · `backend/scripts/seedTestimonials.js`

### Data

MongoDB persistence and seed data

- [Contact model](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/models/Contact.js): Mongo model · Document model for contact submissions · `backend/models/Contact.js`
- [Testimonial model](https://github.com/bhanuvarma17/eva-project-/blob/main/backend/models/Testimonial.js): Mongo model · Document model for testimonials · `backend/models/Testimonial.js`
- **MongoDB**: database · Shared system of record for contacts and testimonials

## Connections

- Root pkg → Client entry: run client · Workspace scripts can start the frontend
- Root pkg → Server: run api · Workspace scripts can start the backend
- Client entry → App: mounts · Bootstraps the React application
- App → Navigation: uses · Composes shared navigation
- App → Footer: uses · Composes shared footer
- App → Home: renders · Primary landing content
- App → Contact: renders · Contact page
- App → Plans: renders · Plans section
- App → Testimonials: renders · Testimonials page
- Home → Colors: styles · Uses shared palette
- Contact → API client: calls · Submits contact data to the backend
- Testimonials → API client: calls · Fetches and submits testimonials
- Navigation → Colors: styles · Uses shared palette
- Footer → Colors: styles · Uses shared palette
- Server → Contact routes: mounts · Registers contact endpoints
- Server → Testimonial routes: mounts · Registers testimonial endpoints
- Contact routes → Contact ctrl: dispatches · Delegates request handling
- Testimonial routes → Testimonial ctrl: dispatches · Delegates request handling
- Contact ctrl → Contact model: uses · Persists contact submissions
- Testimonial ctrl → Testimonial model: uses · Persists and reads testimonials
- Contact model → MongoDB: stores · Contact collection lives in MongoDB
- Testimonial model → MongoDB: stores · Testimonial collection lives in MongoDB
- Seed data → Testimonial model: loads · Creates testimonial documents
- Seed data → MongoDB: seeds · Populates the database
- API client → Server: HTTP API · Client-side network boundary to the Express API
