# keshav-kale/wanderlust-mega-project architecture

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

- Interactive diagram: https://gitdiagram.com/keshav-kale/wanderlust-mega-project
- Repository: https://github.com/keshav-kale/wanderlust-mega-project

## Overview

Wanderlust is a travel-blog application: visitors browse featured, latest, category, and individual posts, while contributors create posts and users can sign in or register. The backend exposes post and authentication routes, persists users and posts in MongoDB, and optionally caches post results in Redis. The README also describes deployment tooling, but that is not part of the runtime architecture shown here. Frontend-to-backend wiring is not visible in the excerpts, so those relationships are omitted or marked unverified.

Main entry points: [`frontend/src/App.tsx`](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/App.tsx) (Application shell), [`backend/server.js`](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/server.js) (HTTP server), [`backend/controllers/auth-controller.js`](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/controllers/auth-controller.js) (Account workflows), [`backend/routes/posts.js`](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/routes/posts.js) (Post routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_frontend["Application shell<br/>[App.tsx]"]
  node_home["Blog feed<br/>[blog-feed.tsx]"]
  node_postpages["Post pages"]
  node_authpages["Sign-in and signup"]
  node_compose["Post composition<br/>[add-blog.tsx]"]
end

subgraph group_api["API and workflows"]
  node_server["HTTP server<br/>[server.js]"]
  node_postroutes["Post routes<br/>[posts.js]"]
  node_postcontroller["Post operations"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_authmiddleware["Post cache middleware<br/>[middleware.js]"]
end

subgraph group_data["Persistence and cache"]
  node_dbconfig["Database connection<br/>[db.js]"]
  node_postmodel["Post model<br/>[post.js]"]
  node_redisservice["Redis connection<br/>[redis.js]"]
  node_postcache["Post cache operations<br/>[cache-posts.js]"]
end

subgraph group_identity["Identity integrations"]
  node_authcontroller["Account workflows<br/>[auth-controller.js]"]
  node_usermodel["User model<br/>[user.js]"]
end

node_visitor(("Visitor or contributor"))
node_mongodb[("MongoDB")]
node_redis[("Redis")]
node_google(("Google OAuth"))
node_github(("GitHub OAuth"))

node_visitor -->|"uses"| node_frontend
node_frontend -.->|"presents"| node_home
node_frontend -.->|"presents"| node_postpages
node_frontend -.->|"presents"| node_authpages
node_frontend -.->|"presents"| node_compose
node_visitor -.->|"requests"| node_server
node_server -->|"mounts"| node_postroutes
node_server -->|"mounts"| node_authroutes
node_server -->|"connects"| node_dbconfig
node_server -->|"connects"| node_redisservice
node_postroutes -->|"dispatches"| node_postcontroller
node_postroutes -->|"applies"| node_authmiddleware
node_authroutes -->|"dispatches"| node_authcontroller
node_postcontroller -->|"queries"| node_postmodel
node_postcontroller -->|"reads and invalidates"| node_postcache
node_authmiddleware -->|"reads"| node_postcache
node_postcache -->|"uses client"| node_redisservice
node_dbconfig -->|"connects"| node_mongodb
node_redisservice -->|"connects"| node_redis
node_authcontroller -->|"queries"| node_usermodel
node_authcontroller -->|"exchanges tokens"| node_google
node_authcontroller -->|"exchanges tokens"| node_github

click node_frontend "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/components/blog-feed.tsx"
click node_postpages "https://github.com/keshav-kale/wanderlust-mega-project/tree/main/frontend/src/pages"
click node_authpages "https://github.com/keshav-kale/wanderlust-mega-project/tree/main/frontend/src/pages"
click node_compose "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/pages/add-blog.tsx"
click node_server "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/server.js"
click node_postroutes "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/routes/posts.js"
click node_postcontroller "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/controllers/posts-controller.js"
click node_authroutes "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/routes/auth.js"
click node_authcontroller "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/controllers/auth-controller.js"
click node_authmiddleware "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/utils/middleware.js"
click node_dbconfig "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/config/db.js"
click node_postmodel "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/models/post.js"
click node_usermodel "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/models/user.js"
click node_redisservice "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/services/redis.js"
click node_postcache "https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/utils/cache-posts.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_frontend,node_home,node_postpages,node_authpages,node_compose toneBlue
class node_server,node_postroutes,node_postcontroller,node_authroutes,node_authmiddleware,node_mongodb,node_redis toneAmber
class node_dbconfig,node_postmodel,node_redisservice,node_postcache toneMint
class node_authcontroller,node_usermodel toneRose
class node_visitor,node_google,node_github toneIndigo
```

## Components

### Web experience

- [Application shell](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Blog feed](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/components/blog-feed.tsx): `frontend/src/components/blog-feed.tsx`
- [Post pages](https://github.com/keshav-kale/wanderlust-mega-project/tree/main/frontend/src/pages): `frontend/src/pages`
- [Sign-in and signup](https://github.com/keshav-kale/wanderlust-mega-project/tree/main/frontend/src/pages): `frontend/src/pages`
- [Post composition](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/frontend/src/pages/add-blog.tsx): `frontend/src/pages/add-blog.tsx`

### API and workflows

- [HTTP server](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/server.js): `backend/server.js`
- [Post routes](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/routes/posts.js): `backend/routes/posts.js`
- [Post operations](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/controllers/posts-controller.js): `backend/controllers/posts-controller.js`
- [Auth routes](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Post cache middleware](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/utils/middleware.js): `backend/utils/middleware.js`

### Persistence and cache

- [Database connection](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/config/db.js): `backend/config/db.js`
- [Post model](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/models/post.js): `backend/models/post.js`
- [Redis connection](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/services/redis.js): `backend/services/redis.js`
- [Post cache operations](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/utils/cache-posts.js): `backend/utils/cache-posts.js`

### Identity integrations

- [Account workflows](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/controllers/auth-controller.js): `backend/controllers/auth-controller.js`
- [User model](https://github.com/keshav-kale/wanderlust-mega-project/blob/main/backend/models/user.js): `backend/models/user.js`

### Other components

- **Visitor or contributor**
- **MongoDB**
- **Redis**
- **Google OAuth**
- **GitHub OAuth**

## Connections

- Visitor or contributor → Application shell: uses
- Application shell → Blog feed: presents
- Application shell → Post pages: presents
- Application shell → Sign-in and signup: presents
- Application shell → Post composition: presents
- Visitor or contributor → HTTP server: requests
- HTTP server → Post routes: mounts (evidence: `backend/server.js`)
- HTTP server → Auth routes: mounts (evidence: `backend/server.js`)
- HTTP server → Database connection: connects (evidence: `backend/server.js`)
- HTTP server → Redis connection: connects (evidence: `backend/server.js`)
- Post routes → Post operations: dispatches (evidence: `backend/routes/posts.js`)
- Post routes → Post cache middleware: applies (evidence: `backend/routes/posts.js`)
- Auth routes → Account workflows: dispatches (evidence: `backend/routes/auth.js`)
- Post operations → Post model: queries (evidence: `backend/controllers/posts-controller.js`)
- Post operations → Post cache operations: reads and invalidates (evidence: `backend/controllers/posts-controller.js`)
- Post cache middleware → Post cache operations: reads (evidence: `backend/utils/middleware.js`)
- Post cache operations → Redis connection: uses client (evidence: `backend/utils/cache-posts.js`)
- Database connection → MongoDB: connects (evidence: `backend/config/db.js`)
- Redis connection → Redis: connects (evidence: `backend/services/redis.js`)
- Account workflows → User model: queries (evidence: `backend/controllers/auth-controller.js`)
- Account workflows → Google OAuth: exchanges tokens (evidence: `backend/controllers/auth-controller.js`)
- Account workflows → GitHub OAuth: exchanges tokens (evidence: `backend/controllers/auth-controller.js`)
