# srikanthkotipalli0209/eks-3tire_application architecture

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

- Interactive diagram: https://gitdiagram.com/srikanthkotipalli0209/eks-3tire_application
- Repository: https://github.com/srikanthkotipalli0209/eks-3tire_application

## Overview

Yelp Camp is an Express web application for browsing, creating, and reviewing location-based campgrounds, with local-account authentication, image uploads, and map views. The main request flow enters through the Express app, is dispatched to route handlers, passes validation and authorization where required, and is handled by controllers using MongoDB-backed models; responses are rendered for users. The README documents Mapbox, MongoDB Atlas, Passport, and Cloudinary capabilities. Some feature paths are documented rather than evidenced by sampled implementation, so those links are marked dashed or omitted.

Main entry points: [`app.js`](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/app.js) (Express App), [`middleware.js`](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/middleware.js) (Auth And Validation), [`models/campground.js`](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/campground.js) (Campground Records), [`routes/campgrounds.js`](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/campgrounds.js) (Campground Routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web Requests"]
  node_app["Express App<br/>[app.js]"]
  node_campground_routes["Campground Routes<br/>[campgrounds.js]"]
  node_review_routes["Review Routes<br/>[reviews.js]"]
  node_user_routes["User Routes<br/>[users.js]"]
  node_middleware["Auth And Validation<br/>[middleware.js]"]
end

subgraph group_domain["Campground Domain"]
  node_campground_controller["Campground Actions<br/>[campgrounds.js]"]
  node_campground_model["Campground Records<br/>[campground.js]"]
  node_schemas["Request Schemas<br/>[schemas.js]"]
end

subgraph group_accounts["Accounts And Reviews"]
  node_review_controller["Review Actions<br/>[reviews.js]"]
  node_review_model["Review Records<br/>[review.js]"]
  node_user_controller["User Actions<br/>[users.js]"]
  node_user_model["User Records<br/>[user.js]"]
end

subgraph group_maps["Maps And Media"]
  node_map_cluster["Cluster Map<br/>[clusterMap.js]"]
  node_map_detail["Campground Map<br/>[showPageMap.js]"]
  node_cloudinary_config["Image Storage Config<br/>[index.js]"]
end

node_visitor(("Visitor"))
node_mongo[("MongoDB")]
node_cloudinary[("Cloudinary")]
node_mapbox["Mapbox"]

node_visitor -->|"sends requests"| node_app
node_app -->|"mounts routes"| node_campground_routes
node_app -->|"mounts routes"| node_review_routes
node_app -->|"mounts routes"| node_user_routes
node_app -->|"connects to"| node_mongo
node_app -->|"configures authentication"| node_user_model
node_app -->|"renders home"| node_visitor
node_campground_routes -->|"checks access"| node_middleware
node_campground_routes -->|"dispatches actions"| node_campground_controller
node_campground_routes -->|"uses upload storage"| node_cloudinary_config
node_review_routes -->|"checks access"| node_middleware
node_review_routes -->|"dispatches actions"| node_review_controller
node_user_routes -->|"dispatches actions"| node_user_controller
node_middleware -->|"validates input"| node_schemas
node_middleware -->|"checks ownership"| node_campground_model
node_middleware -->|"checks authorship"| node_review_model
node_campground_controller -->|"uses records"| node_campground_model
node_campground_controller -->|"uses images"| node_cloudinary_config
node_review_controller -->|"updates campground"| node_campground_model
node_review_controller -->|"creates and deletes"| node_review_model
node_user_controller -->|"uses accounts"| node_user_model
node_campground_model -->|"deletes associated reviews"| node_review_model
node_campground_model -->|"deletes stored images"| node_cloudinary
node_map_cluster -.->|"uses map service"| node_mapbox
node_map_detail -.->|"uses map service"| node_mapbox
node_cloudinary_config -->|"configures storage"| node_cloudinary

click node_app "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/app.js"
click node_campground_routes "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/campgrounds.js"
click node_review_routes "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/reviews.js"
click node_user_routes "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/users.js"
click node_middleware "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/middleware.js"
click node_campground_controller "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/controllers/campgrounds.js"
click node_campground_model "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/campground.js"
click node_schemas "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/schemas.js"
click node_review_controller "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/controllers/reviews.js"
click node_review_model "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/review.js"
click node_user_controller "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/controllers/users.js"
click node_user_model "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/user.js"
click node_map_cluster "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/public/javascripts/clusterMap.js"
click node_map_detail "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/public/javascripts/showPageMap.js"
click node_cloudinary_config "https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/cloudinary/index.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_app,node_campground_routes,node_review_routes,node_user_routes,node_middleware toneBlue
class node_campground_controller,node_campground_model,node_schemas,node_mongo,node_cloudinary toneAmber
class node_review_controller,node_review_model,node_user_controller,node_user_model toneMint
class node_map_cluster,node_map_detail,node_cloudinary_config toneRose
class node_visitor,node_mapbox toneIndigo
```

## Components

### Web Requests

- [Express App](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/app.js): `app.js`
- [Campground Routes](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/campgrounds.js): `routes/campgrounds.js`
- [Review Routes](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/reviews.js): `routes/reviews.js`
- [User Routes](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/routes/users.js): `routes/users.js`
- [Auth And Validation](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/middleware.js): `middleware.js`

### Campground Domain

- [Campground Actions](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/controllers/campgrounds.js): `controllers/campgrounds.js`
- [Campground Records](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/campground.js): `models/campground.js`
- [Request Schemas](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/schemas.js): `schemas.js`

### Accounts And Reviews

- [Review Actions](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/controllers/reviews.js): `controllers/reviews.js`
- [Review Records](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/review.js): `models/review.js`
- [User Actions](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/controllers/users.js): `controllers/users.js`
- [User Records](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/models/user.js): `models/user.js`

### Maps And Media

- [Cluster Map](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/public/javascripts/clusterMap.js): `public/javascripts/clusterMap.js`
- [Campground Map](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/public/javascripts/showPageMap.js): `public/javascripts/showPageMap.js`
- [Image Storage Config](https://github.com/srikanthkotipalli0209/eks-3tire_application/blob/main/cloudinary/index.js): `cloudinary/index.js`

### Other components

- **Visitor**
- **MongoDB**
- **Cloudinary**
- **Mapbox**

## Connections

- Visitor → Express App: sends requests (evidence: `app.js`)
- Express App → Campground Routes: mounts routes (evidence: `app.js`)
- Express App → Review Routes: mounts routes (evidence: `app.js`)
- Express App → User Routes: mounts routes (evidence: `app.js`)
- Express App → MongoDB: connects to (evidence: `app.js`)
- Express App → User Records: configures authentication (evidence: `app.js`)
- Express App → Visitor: renders home (evidence: `app.js`)
- Campground Routes → Auth And Validation: checks access (evidence: `routes/campgrounds.js`)
- Campground Routes → Campground Actions: dispatches actions (evidence: `routes/campgrounds.js`)
- Campground Routes → Image Storage Config: uses upload storage (evidence: `routes/campgrounds.js`)
- Review Routes → Auth And Validation: checks access (evidence: `routes/reviews.js`)
- Review Routes → Review Actions: dispatches actions (evidence: `routes/reviews.js`)
- User Routes → User Actions: dispatches actions (evidence: `routes/users.js`)
- Auth And Validation → Request Schemas: validates input (evidence: `middleware.js`)
- Auth And Validation → Campground Records: checks ownership (evidence: `middleware.js`)
- Auth And Validation → Review Records: checks authorship (evidence: `middleware.js`)
- Campground Actions → Campground Records: uses records (evidence: `controllers/campgrounds.js`)
- Campground Actions → Image Storage Config: uses images (evidence: `controllers/campgrounds.js`)
- Review Actions → Campground Records: updates campground (evidence: `controllers/reviews.js`)
- Review Actions → Review Records: creates and deletes (evidence: `controllers/reviews.js`)
- User Actions → User Records: uses accounts (evidence: `controllers/users.js`)
- Campground Records → Review Records: deletes associated reviews (evidence: `models/campground.js`)
- Campground Records → Cloudinary: deletes stored images (evidence: `models/campground.js`)
- Cluster Map → Mapbox: uses map service (evidence: `README.md`)
- Campground Map → Mapbox: uses map service (evidence: `README.md`)
- Image Storage Config → Cloudinary: configures storage (evidence: `cloudinary/index.js`)
