# navi126/wanderlust-mega-project architecture

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

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

## Overview

Wanderlust is a MERN travel-blog application: visitors browse posts, while contributors can add content and users can sign in or sign up. The backend exposes post and authentication routes, persists domain records through Mongoose, and optionally caches selected post listings in Redis. The README also describes deployment tooling, but that is not part of the runtime product map. Frontend page-to-API wiring was not shown, so those links are marked unverified rather than inferred as calls.

Main entry points: [`frontend/src/App.tsx`](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/App.tsx) (Web application), [`backend/server.js`](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/server.js) (HTTP server), [`frontend/src/components/blog-feed.tsx`](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/blog-feed.tsx) (Blog feed), [`backend/routes/posts.js`](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/routes/posts.js) (Post routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_webapp["Web application<br/>[App.tsx]"]
  node_browse["Browse posts<br/>[home-page.tsx]"]
  node_postviews["Post views<br/>[details-page.tsx]"]
  node_authoring["Post authoring<br/>[add-blog.tsx]"]
  node_signin["Sign in<br/>[signin-page.tsx]"]
  node_signup["Sign up<br/>[signup-page.tsx]"]
  node_feed["Blog feed<br/>[blog-feed.tsx]"]
  node_postcards["Post cards<br/>[post-card.tsx]"]
  node_featured["Featured post"]
  node_latest["Latest post"]
end

subgraph group_api["Backend API"]
  node_authroutes["Authentication routes<br/>[auth.js]"]
  node_postroutes["Post routes<br/>[posts.js]"]
  node_cachemiddleware["Cache middleware<br/>[middleware.js]"]
  node_server["HTTP server<br/>[server.js]"]
end

subgraph group_domain["Content and identity"]
  node_authcontroller["Authentication handlers<br/>[auth-controller.js]"]
  node_postcontroller["Post handlers"]
  node_usermodel["User model<br/>[user.js]"]
  node_postmodel["Post model<br/>[post.js]"]
end

subgraph group_data["Persistence and cache"]
  node_mongodb[("MongoDB")]
  node_dbconnect["Database connection<br/>[db.js]"]
  node_cachehelpers["Post cache helpers<br/>[cache-posts.js]"]
  node_redisclient["Redis client<br/>[redis.js]"]
  node_redisstore[("Redis")]
end

node_visitor(("Visitor or contributor"))
node_oauthproviders{{"OAuth providers"}}

node_visitor -.->|"uses"| node_webapp
node_webapp -.->|"presents"| node_browse
node_webapp -.->|"presents"| node_postviews
node_webapp -.->|"presents"| node_authoring
node_webapp -.->|"presents"| node_signin
node_webapp -.->|"presents"| node_signup
node_browse -.->|"renders"| node_feed
node_feed -.->|"renders"| node_postcards
node_feed -.->|"renders"| node_featured
node_feed -.->|"renders"| node_latest
node_webapp -.->|"requests API"| node_server
node_server -->|"mounts"| node_postroutes
node_server -->|"mounts"| node_authroutes
node_postroutes -->|"dispatches"| node_postcontroller
node_authroutes -->|"dispatches"| node_authcontroller
node_postcontroller -->|"queries"| node_postmodel
node_authcontroller -->|"queries"| node_usermodel
node_server -->|"connects"| node_dbconnect
node_dbconnect -->|"connects"| node_mongodb
node_postroutes -->|"registers"| node_cachemiddleware
node_cachemiddleware -->|"retrieves cache"| node_cachehelpers
node_postcontroller -->|"stores or deletes"| node_cachehelpers
node_cachehelpers -->|"uses"| node_redisclient
node_redisclient -.->|"connects"| node_redisstore
node_server -->|"connects"| node_redisclient
node_authcontroller -->|"exchanges OAuth"| node_oauthproviders

click node_webapp "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/App.tsx"
click node_browse "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/home-page.tsx"
click node_postviews "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/details-page.tsx"
click node_authoring "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/add-blog.tsx"
click node_signin "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/signin-page.tsx"
click node_signup "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/signup-page.tsx"
click node_feed "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/blog-feed.tsx"
click node_postcards "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/post-card.tsx"
click node_featured "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/featured-post-card.tsx"
click node_latest "https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/latest-post-card.tsx"
click node_authroutes "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/routes/auth.js"
click node_postroutes "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/routes/posts.js"
click node_authcontroller "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/controllers/auth-controller.js"
click node_postcontroller "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/controllers/posts-controller.js"
click node_usermodel "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/models/user.js"
click node_postmodel "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/models/post.js"
click node_dbconnect "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/config/db.js"
click node_cachemiddleware "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/utils/middleware.js"
click node_cachehelpers "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/utils/cache-posts.js"
click node_redisclient "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/services/redis.js"
click node_server "https://github.com/navi126/wanderlust-mega-project/blob/main/backend/server.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_webapp,node_browse,node_postviews,node_authoring,node_signin,node_signup,node_feed,node_postcards,node_featured,node_latest toneBlue
class node_authroutes,node_postroutes,node_cachemiddleware,node_server toneAmber
class node_authcontroller,node_postcontroller,node_usermodel,node_postmodel toneMint
class node_mongodb,node_dbconnect,node_cachehelpers,node_redisclient,node_redisstore toneRose
class node_visitor,node_oauthproviders toneIndigo
```

## Components

### Web experience

- [Web application](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Browse posts](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/home-page.tsx): `frontend/src/pages/home-page.tsx`
- [Post views](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/details-page.tsx): `frontend/src/pages/details-page.tsx`
- [Post authoring](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/add-blog.tsx): `frontend/src/pages/add-blog.tsx`
- [Sign in](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/signin-page.tsx): `frontend/src/pages/signin-page.tsx`
- [Sign up](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/pages/signup-page.tsx): `frontend/src/pages/signup-page.tsx`
- [Blog feed](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/blog-feed.tsx): `frontend/src/components/blog-feed.tsx`
- [Post cards](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/post-card.tsx): `frontend/src/components/post-card.tsx`
- [Featured post](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/featured-post-card.tsx): `frontend/src/components/featured-post-card.tsx`
- [Latest post](https://github.com/navi126/wanderlust-mega-project/blob/main/frontend/src/components/latest-post-card.tsx): `frontend/src/components/latest-post-card.tsx`

### Backend API

- [Authentication routes](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/routes/auth.js): `backend/routes/auth.js`
- [Post routes](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/routes/posts.js): `backend/routes/posts.js`
- [Cache middleware](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/utils/middleware.js): `backend/utils/middleware.js`
- [HTTP server](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/server.js): `backend/server.js`

### Content and identity

- [Authentication handlers](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/controllers/auth-controller.js): `backend/controllers/auth-controller.js`
- [Post handlers](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/controllers/posts-controller.js): `backend/controllers/posts-controller.js`
- [User model](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/models/user.js): `backend/models/user.js`
- [Post model](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/models/post.js): `backend/models/post.js`

### Persistence and cache

- **MongoDB**
- [Database connection](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/config/db.js): `backend/config/db.js`
- [Post cache helpers](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/utils/cache-posts.js): `backend/utils/cache-posts.js`
- [Redis client](https://github.com/navi126/wanderlust-mega-project/blob/main/backend/services/redis.js): `backend/services/redis.js`
- **Redis**

### Other components

- **Visitor or contributor**
- **OAuth providers**

## Connections

- Visitor or contributor → Web application: uses
- Web application → Browse posts: presents
- Web application → Post views: presents
- Web application → Post authoring: presents
- Web application → Sign in: presents
- Web application → Sign up: presents
- Browse posts → Blog feed: renders
- Blog feed → Post cards: renders
- Blog feed → Featured post: renders
- Blog feed → Latest post: renders
- Web application → HTTP server: requests API
- HTTP server → Post routes: mounts (evidence: `backend/server.js`)
- HTTP server → Authentication routes: mounts (evidence: `backend/server.js`)
- Post routes → Post handlers: dispatches (evidence: `backend/routes/posts.js`)
- Authentication routes → Authentication handlers: dispatches (evidence: `backend/routes/auth.js`)
- Post handlers → Post model: queries (evidence: `backend/controllers/posts-controller.js`)
- Authentication handlers → User model: queries (evidence: `backend/controllers/auth-controller.js`)
- HTTP server → Database connection: connects (evidence: `backend/server.js`)
- Database connection → MongoDB: connects (evidence: `backend/config/db.js`)
- Post routes → Cache middleware: registers (evidence: `backend/routes/posts.js`)
- Cache middleware → Post cache helpers: retrieves cache (evidence: `backend/utils/middleware.js`)
- Post handlers → Post cache helpers: stores or deletes (evidence: `backend/controllers/posts-controller.js`)
- Post cache helpers → Redis client: uses (evidence: `backend/utils/cache-posts.js`)
- Redis client → Redis: connects
- HTTP server → Redis client: connects (evidence: `backend/server.js`)
- Authentication handlers → OAuth providers: exchanges OAuth (evidence: `backend/controllers/auth-controller.js`)
