# mr-deepansh/trip_planner-collaboration architecture

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

- Interactive diagram: https://gitdiagram.com/mr-deepansh/trip_planner-collaboration
- Repository: https://github.com/mr-deepansh/trip_planner-collaboration

## Overview

Trip Planner Collaboration is a web app for coordinating group trips. A traveler signs in, views trips, opens an itinerary, and can create trips or manage members and activities; the React client calls an Express REST API, whose controllers use Sequelize models backed by PostgreSQL. Authentication also includes OAuth and password recovery, while trip membership roles gate protected operations. The graph preserves the README’s documented capabilities, but implementation evidence is limited to the supplied excerpts and SOURCE INDEX; documented-only integrations are shown with README evidence.

Main entry points: [`backend/src/models/index.js`](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/models/index.js) (Relational models), [`frontend/src/App.jsx`](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/App.jsx) (Page routing), [`backend/src/app.js`](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/app.js) (Express API), [`backend/src/routes/trip.routes.js`](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/trip.routes.js) (Trip routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web client"]
  node_app["Page routing<br/>[App.jsx]"]
  node_authui["Auth state<br/>[AuthContext.jsx]"]
  node_dashboard["Trip dashboard<br/>[Dashboard.jsx]"]
  node_tripdetail["Trip detail<br/>[TripDetail.jsx]"]
  node_login["Login and signup<br/>[Login.jsx]"]
  node_register["Registration<br/>[Register.jsx]"]
  node_httpclient["HTTP client<br/>[axiosConfig.js]"]
end

subgraph group_api["API and access"]
  node_apiapp["Express API<br/>[app.js]"]
  node_authroutes["Auth routes<br/>[auth.routes.js]"]
  node_authcontroller["Auth workflows<br/>[auth.controller.js]"]
  node_passport["OAuth strategies<br/>[passport.js]"]
  node_authmw["JWT verification<br/>[auth.middleware.js]"]
  node_triproutes["Trip routes<br/>[trip.routes.js]"]
  node_rolemw["Role checks<br/>[role.middleware.js]"]
end

subgraph group_domain["Trip planning"]
  node_tripcontroller["Trip workflows<br/>[trip.controller.js]"]
  node_activityroutes["Activity routes<br/>[activity.routes.js]"]
  node_activitycontroller["Activity workflows"]
end

subgraph group_platform["Persistence and operations"]
  node_models["Relational models<br/>[index.js]"]
  node_database[("PostgreSQL")]
  node_email["Email delivery<br/>[email.js]"]
  node_errors["Error pipeline"]
  node_logging["Structured logging<br/>[logger.js]"]
  node_observability["Telemetry and instrumentation<br/>[telemetry.js]"]
end

node_traveler(("Traveler"))

node_traveler -->|"uses"| node_app
node_app -->|"routes to"| node_login
node_app -->|"routes to"| node_register
node_app -->|"routes to"| node_dashboard
node_app -->|"routes to"| node_tripdetail
node_login -->|"uses"| node_authui
node_register -->|"uses"| node_authui
node_authui -->|"calls"| node_httpclient
node_dashboard -->|"calls"| node_httpclient
node_tripdetail -->|"calls"| node_httpclient
node_httpclient -.->|"sends REST requests"| node_apiapp
node_apiapp -->|"mounts"| node_authroutes
node_apiapp -->|"mounts"| node_triproutes
node_apiapp -->|"uses"| node_errors
node_authroutes -->|"dispatches"| node_authcontroller
node_authroutes -->|"protects"| node_authmw
node_authroutes -->|"authenticates OAuth"| node_passport
node_authcontroller -->|"reads and writes"| node_models
node_authcontroller -->|"sends reset email"| node_email
node_authcontroller -->|"logs events"| node_logging
node_triproutes -->|"requires JWT"| node_authmw
node_triproutes -->|"checks roles"| node_rolemw
node_triproutes -->|"dispatches"| node_tripcontroller
node_triproutes -->|"mounts nested routes"| node_activityroutes
node_activityroutes -->|"dispatches"| node_activitycontroller
node_activityroutes -->|"requires JWT"| node_authmw
node_activityroutes -->|"checks roles"| node_rolemw
node_tripcontroller -->|"reads and writes"| node_models
node_activitycontroller -->|"reads and writes"| node_models
node_authmw -->|"loads user"| node_models
node_authmw -->|"logs auth events"| node_logging
node_rolemw -->|"checks membership"| node_models
node_models -->|"persists through Sequelize"| node_database
node_apiapp -->|"logs requests"| node_logging
node_observability -->|"supports telemetry"| node_logging
node_passport -->|"loads user records"| node_models
node_passport -.->|"supports Google and GitHub"| node_traveler

click node_app "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/App.jsx"
click node_authui "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/context/AuthContext.jsx"
click node_dashboard "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/Dashboard.jsx"
click node_tripdetail "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/TripDetail.jsx"
click node_login "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/Login.jsx"
click node_register "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/Register.jsx"
click node_httpclient "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/api/axiosConfig.js"
click node_apiapp "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/app.js"
click node_authroutes "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/auth.routes.js"
click node_authcontroller "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/controllers/auth.controller.js"
click node_passport "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/config/passport.js"
click node_authmw "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/middlewares/auth.middleware.js"
click node_triproutes "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/trip.routes.js"
click node_rolemw "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/middlewares/role.middleware.js"
click node_tripcontroller "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/controllers/trip.controller.js"
click node_activityroutes "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/activity.routes.js"
click node_activitycontroller "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/controllers/activity.controller.js"
click node_models "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/models/index.js"
click node_email "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/utils/email.js"
click node_errors "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/middlewares/error.middleware.js"
click node_logging "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/utils/logger.js"
click node_observability "https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/observability/telemetry.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_authui,node_dashboard,node_tripdetail,node_login,node_register,node_httpclient toneBlue
class node_apiapp,node_authroutes,node_authcontroller,node_passport,node_authmw,node_triproutes,node_rolemw toneAmber
class node_tripcontroller,node_activityroutes,node_activitycontroller toneMint
class node_models,node_database,node_email,node_errors,node_logging,node_observability toneRose
class node_traveler toneIndigo
```

## Components

### Web client

- [Page routing](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Auth state](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Trip dashboard](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/Dashboard.jsx): `frontend/src/pages/Dashboard.jsx`
- [Trip detail](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/TripDetail.jsx): `frontend/src/pages/TripDetail.jsx`
- [Login and signup](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/Login.jsx): `frontend/src/pages/Login.jsx`
- [Registration](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/pages/Register.jsx): `frontend/src/pages/Register.jsx`
- [HTTP client](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/frontend/src/api/axiosConfig.js): `frontend/src/api/axiosConfig.js`

### API and access

- [Express API](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/app.js): `backend/src/app.js`
- [Auth routes](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/auth.routes.js): `backend/src/routes/auth.routes.js`
- [Auth workflows](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/controllers/auth.controller.js): `backend/src/controllers/auth.controller.js`
- [OAuth strategies](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/config/passport.js): `backend/src/config/passport.js`
- [JWT verification](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/middlewares/auth.middleware.js): `backend/src/middlewares/auth.middleware.js`
- [Trip routes](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/trip.routes.js): `backend/src/routes/trip.routes.js`
- [Role checks](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/middlewares/role.middleware.js): `backend/src/middlewares/role.middleware.js`

### Trip planning

- [Trip workflows](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/controllers/trip.controller.js): `backend/src/controllers/trip.controller.js`
- [Activity routes](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/routes/activity.routes.js): `backend/src/routes/activity.routes.js`
- [Activity workflows](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/controllers/activity.controller.js): `backend/src/controllers/activity.controller.js`

### Persistence and operations

- [Relational models](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/models/index.js): `backend/src/models/index.js`
- **PostgreSQL**
- [Email delivery](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/utils/email.js): `backend/src/utils/email.js`
- [Error pipeline](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/middlewares/error.middleware.js): `backend/src/middlewares/error.middleware.js`
- [Structured logging](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/utils/logger.js): `backend/src/utils/logger.js`
- [Telemetry and instrumentation](https://github.com/mr-deepansh/trip_planner-collaboration/blob/main/backend/src/observability/telemetry.js): `backend/src/observability/telemetry.js`

### Other components

- **Traveler**

## Connections

- Traveler → Page routing: uses (evidence: `frontend/src/App.jsx`)
- Page routing → Login and signup: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Registration: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Trip dashboard: routes to (evidence: `frontend/src/App.jsx`)
- Page routing → Trip detail: routes to (evidence: `frontend/src/App.jsx`)
- Login and signup → Auth state: uses (evidence: `frontend/src/pages/Login.jsx`)
- Registration → Auth state: uses (evidence: `frontend/src/pages/Register.jsx`)
- Auth state → HTTP client: calls (evidence: `frontend/src/context/AuthContext.jsx`)
- Trip dashboard → HTTP client: calls (evidence: `frontend/src/pages/Dashboard.jsx`)
- Trip detail → HTTP client: calls (evidence: `frontend/src/pages/TripDetail.jsx`)
- HTTP client → Express API: sends REST requests (evidence: `README.md`)
- Express API → Auth routes: mounts (evidence: `backend/src/app.js`)
- Express API → Trip routes: mounts (evidence: `backend/src/app.js`)
- Express API → Error pipeline: uses (evidence: `backend/src/app.js`)
- Auth routes → Auth workflows: dispatches (evidence: `backend/src/routes/auth.routes.js`)
- Auth routes → JWT verification: protects (evidence: `backend/src/routes/auth.routes.js`)
- Auth routes → OAuth strategies: authenticates OAuth (evidence: `backend/src/routes/auth.routes.js`)
- Auth workflows → Relational models: reads and writes (evidence: `backend/src/controllers/auth.controller.js`)
- Auth workflows → Email delivery: sends reset email (evidence: `backend/src/controllers/auth.controller.js`)
- Auth workflows → Structured logging: logs events (evidence: `backend/src/controllers/auth.controller.js`)
- Trip routes → JWT verification: requires JWT (evidence: `backend/src/routes/trip.routes.js`)
- Trip routes → Role checks: checks roles (evidence: `backend/src/routes/trip.routes.js`)
- Trip routes → Trip workflows: dispatches (evidence: `backend/src/routes/trip.routes.js`)
- Trip routes → Activity routes: mounts nested routes (evidence: `backend/src/routes/trip.routes.js`)
- Activity routes → Activity workflows: dispatches (evidence: `backend/src/routes/activity.routes.js`)
- Activity routes → JWT verification: requires JWT (evidence: `backend/src/routes/activity.routes.js`)
- Activity routes → Role checks: checks roles (evidence: `backend/src/routes/activity.routes.js`)
- Trip workflows → Relational models: reads and writes (evidence: `backend/src/controllers/trip.controller.js`)
- Activity workflows → Relational models: reads and writes (evidence: `backend/src/controllers/activity.controller.js`)
- JWT verification → Relational models: loads user (evidence: `backend/src/middlewares/auth.middleware.js`)
- JWT verification → Structured logging: logs auth events (evidence: `backend/src/middlewares/auth.middleware.js`)
- Role checks → Relational models: checks membership (evidence: `backend/src/middlewares/role.middleware.js`)
- Relational models → PostgreSQL: persists through Sequelize (evidence: `README.md`)
- Express API → Structured logging: logs requests (evidence: `backend/src/app.js`)
- Telemetry and instrumentation → Structured logging: supports telemetry
- OAuth strategies → Relational models: loads user records (evidence: `backend/src/config/passport.js`)
- OAuth strategies → Traveler: supports Google and GitHub (evidence: `README.md`)
