# anikverma094-lab/wanderlust-project architecture

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

- Interactive diagram: https://gitdiagram.com/anikverma094-lab/wanderlust-project
- Repository: https://github.com/anikverma094-lab/wanderlust-project

## Overview

Wanderlust is a travel-blog application: readers browse featured, latest, categorized, and individual posts; signed-in users can create and edit posts, while admins manage posts and users. The backend also supports email/password and Google sign-in, role checks, and Redis-backed post caching. The graph follows documented route wiring and sampled controller/model interactions. Frontend-to-backend request wiring is not shown in the excerpts, so that connection is left unasserted.

Main entry points: [`frontend/src/App.tsx`](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/App.tsx) (App routes), [`backend/app.ts`](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/app.ts) (Express app), [`backend/models/user.ts`](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/models/user.ts) (User records), [`backend/routes/auth.ts`](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/auth.ts) (Auth routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Travel blog frontend"]
  node_app["App routes<br/>[App.tsx]"]
  node_home["Travel discovery<br/>[home-page.tsx]"]
  node_post_views["Post views<br/>[details-page.tsx]"]
  node_authoring["Post authoring<br/>[form-blog.tsx]"]
  node_admin["Admin pages<br/>[admin-blogs.tsx]"]
  node_auth_pages["Sign-in pages<br/>[signin-page.tsx]"]
end

subgraph group_api["Backend API"]
  node_server_app["Express app<br/>[app.ts]"]
  node_post_routes["Post routes<br/>[posts.ts]"]
  node_auth_routes["Auth routes<br/>[auth.ts]"]
  node_user_routes["User routes<br/>[user.ts]"]
  node_runtime["Backend startup<br/>[server.ts]"]
end

subgraph group_identity["Identity and access"]
  node_user_controller["User administration<br/>[user-controller.ts]"]
  node_auth_controller["Credential sessions<br/>[auth-controller.ts]"]
  node_auth_middleware["Token authorization<br/>[auth-middleware.ts]"]
  node_passport["Google OAuth<br/>[passport.ts]"]
  node_user_model[("User records<br/>[user.ts]")]
end

subgraph group_data["Content and caching"]
  node_post_controller["Post operations"]
  node_post_model[("Post records<br/>[post.ts]")]
  node_cache_helpers["Post cache helpers<br/>[cache-posts.ts]"]
  node_redis[("Redis cache<br/>[redis.ts]")]
  node_db_config["Database connection<br/>[db.ts]"]
end

node_reader(("Reader or author"))

node_reader -->|"browses and manages"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_post_views
node_app -->|"routes to"| node_authoring
node_app -->|"routes to"| node_admin
node_app -->|"routes to"| node_auth_pages
node_server_app -->|"mounts routes"| node_post_routes
node_server_app -->|"mounts routes"| node_auth_routes
node_server_app -->|"mounts routes"| node_user_routes
node_server_app -->|"initializes"| node_passport
node_post_routes -->|"dispatches to"| node_post_controller
node_post_routes -->|"applies"| node_auth_middleware
node_auth_routes -->|"dispatches to"| node_auth_controller
node_auth_routes -->|"applies"| node_auth_middleware
node_auth_routes -->|"authenticates with"| node_passport
node_user_routes -->|"dispatches to"| node_user_controller
node_user_routes -->|"applies"| node_auth_middleware
node_auth_middleware -->|"loads user"| node_user_model
node_auth_controller -->|"reads and updates"| node_user_model
node_user_controller -->|"manages users"| node_user_model
node_passport -->|"finds or creates"| node_user_model
node_post_controller -->|"reads and writes"| node_post_model
node_post_controller -->|"updates author posts"| node_user_model
node_post_controller -->|"invalidates and stores"| node_cache_helpers
node_cache_helpers -->|"uses client"| node_redis
node_runtime -->|"starts"| node_server_app
node_runtime -->|"connects database"| node_db_config
node_runtime -->|"connects cache"| node_redis

click node_app "https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/App.tsx"
click node_home "https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/home-page.tsx"
click node_post_views "https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/details-page.tsx"
click node_authoring "https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/components/form-blog.tsx"
click node_admin "https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/admin-blogs.tsx"
click node_auth_pages "https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/signin-page.tsx"
click node_server_app "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/app.ts"
click node_post_routes "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/posts.ts"
click node_auth_routes "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/auth.ts"
click node_user_routes "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/user.ts"
click node_post_controller "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/controllers/posts-controller.ts"
click node_user_controller "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/controllers/user-controller.ts"
click node_auth_controller "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/controllers/auth-controller.ts"
click node_auth_middleware "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/middlewares/auth-middleware.ts"
click node_passport "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/config/passport.ts"
click node_post_model "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/models/post.ts"
click node_user_model "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/models/user.ts"
click node_cache_helpers "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/utils/cache-posts.ts"
click node_redis "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/services/redis.ts"
click node_db_config "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/config/db.ts"
click node_runtime "https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/server.ts"

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_home,node_post_views,node_authoring,node_admin,node_auth_pages toneBlue
class node_server_app,node_post_routes,node_auth_routes,node_user_routes,node_runtime toneAmber
class node_user_controller,node_auth_controller,node_auth_middleware,node_passport,node_user_model toneMint
class node_post_controller,node_post_model,node_cache_helpers,node_redis,node_db_config toneRose
class node_reader toneIndigo
```

## Components

### Travel blog frontend

- [App routes](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Travel discovery](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/home-page.tsx): `frontend/src/pages/home-page.tsx`
- [Post views](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/details-page.tsx): `frontend/src/pages/details-page.tsx`
- [Post authoring](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/components/form-blog.tsx): `frontend/src/components/form-blog.tsx`
- [Admin pages](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/admin-blogs.tsx): `frontend/src/pages/admin-blogs.tsx`
- [Sign-in pages](https://github.com/anikverma094-lab/wanderlust-project/blob/main/frontend/src/pages/signin-page.tsx): `frontend/src/pages/signin-page.tsx`

### Backend API

- [Express app](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/app.ts): `backend/app.ts`
- [Post routes](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/posts.ts): `backend/routes/posts.ts`
- [Auth routes](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/auth.ts): `backend/routes/auth.ts`
- [User routes](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/routes/user.ts): `backend/routes/user.ts`
- [Backend startup](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/server.ts): `backend/server.ts`

### Identity and access

- [User administration](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/controllers/user-controller.ts): `backend/controllers/user-controller.ts`
- [Credential sessions](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/controllers/auth-controller.ts): `backend/controllers/auth-controller.ts`
- [Token authorization](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/middlewares/auth-middleware.ts): `backend/middlewares/auth-middleware.ts`
- [Google OAuth](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/config/passport.ts): `backend/config/passport.ts`
- [User records](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/models/user.ts): `backend/models/user.ts`

### Content and caching

- [Post operations](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/controllers/posts-controller.ts): `backend/controllers/posts-controller.ts`
- [Post records](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/models/post.ts): `backend/models/post.ts`
- [Post cache helpers](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/utils/cache-posts.ts): `backend/utils/cache-posts.ts`
- [Redis cache](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/services/redis.ts): `backend/services/redis.ts`
- [Database connection](https://github.com/anikverma094-lab/wanderlust-project/blob/main/backend/config/db.ts): `backend/config/db.ts`

### Other components

- **Reader or author**

## Connections

- Reader or author → App routes: browses and manages (evidence: `README.md`)
- App routes → Travel discovery: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Post views: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Post authoring: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Admin pages: routes to (evidence: `frontend/src/App.tsx`)
- App routes → Sign-in pages: routes to (evidence: `frontend/src/App.tsx`)
- Express app → Post routes: mounts routes (evidence: `backend/app.ts`)
- Express app → Auth routes: mounts routes (evidence: `backend/app.ts`)
- Express app → User routes: mounts routes (evidence: `backend/app.ts`)
- Express app → Google OAuth: initializes (evidence: `backend/app.ts`)
- Post routes → Post operations: dispatches to (evidence: `backend/routes/posts.ts`)
- Post routes → Token authorization: applies (evidence: `backend/routes/posts.ts`)
- Auth routes → Credential sessions: dispatches to (evidence: `backend/routes/auth.ts`)
- Auth routes → Token authorization: applies (evidence: `backend/routes/auth.ts`)
- Auth routes → Google OAuth: authenticates with (evidence: `backend/routes/auth.ts`)
- User routes → User administration: dispatches to (evidence: `backend/routes/user.ts`)
- User routes → Token authorization: applies (evidence: `backend/routes/user.ts`)
- Token authorization → User records: loads user (evidence: `backend/middlewares/auth-middleware.ts`)
- Credential sessions → User records: reads and updates (evidence: `backend/controllers/auth-controller.ts`)
- User administration → User records: manages users (evidence: `backend/controllers/user-controller.ts`)
- Google OAuth → User records: finds or creates (evidence: `backend/config/passport.ts`)
- Post operations → Post records: reads and writes (evidence: `backend/controllers/posts-controller.ts`)
- Post operations → User records: updates author posts (evidence: `backend/controllers/posts-controller.ts`)
- Post operations → Post cache helpers: invalidates and stores (evidence: `backend/controllers/posts-controller.ts`)
- Post cache helpers → Redis cache: uses client (evidence: `backend/utils/cache-posts.ts`)
- Backend startup → Express app: starts (evidence: `backend/server.ts`)
- Backend startup → Database connection: connects database (evidence: `backend/server.ts`)
- Backend startup → Redis cache: connects cache (evidence: `backend/server.ts`)
