# koushiksai166/martirmony-clone architecture

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

- Interactive diagram: https://gitdiagram.com/koushiksai166/martirmony-clone
- Repository: https://github.com/koushiksai166/martirmony-clone

## Overview

Vivah is a matrimony platform: users register, create profiles and preferences, discover and connect with potential partners, communicate, and optionally buy premium membership. The frontend routes users through these capabilities and provides shared authentication state; the NestJS API implements domain services backed by Prisma/PostgreSQL. Admin moderation, safety, notifications, and media upload are additional product branches. Some frontend-to-API wiring and unsampled domain internals are not visible in the excerpts, so those relationships are omitted rather than assumed.

Main entry points: [`backend/src/prisma/prisma.service.ts`](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/prisma/prisma.service.ts) (Database access), [`frontend/src/routes/AppRoutes.jsx`](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/routes/AppRoutes.jsx) (Route access), [`backend/src/notification/notification.service.ts`](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/notification/notification.service.ts) (Notifications), [`frontend/src/main.jsx`](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/main.jsx) (React application)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Web application"]
  node_web["React application<br/>[main.jsx]"]
  node_routes["Route access<br/>[AppRoutes.jsx]"]
  node_authstate["Auth state<br/>[AuthContext.jsx]"]
  node_searchui["Search experience<br/>[Search.jsx]"]
  node_membershipui["Membership experience<br/>[Membership.jsx]"]
  node_messagesui["Messaging experience<br/>[Messages.jsx]"]
  node_api["API client<br/>[api.js]"]
  node_token["Token handling<br/>[token.js]"]
end

subgraph group_identity["Identity and accounts"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_users["User accounts<br/>[users.service.ts]"]
end

subgraph group_discovery["Profiles and discovery"]
  node_profiles["Profile management<br/>[profile.service.ts]"]
  node_preferences["Partner preferences"]
  node_savedsearch["Saved searches"]
  node_matches["Matching<br/>[match.service.ts]"]
end

subgraph group_engagement["Communication and safety"]
  node_interests["Interest exchange"]
  node_chat["Chat<br/>[chat.service.ts]"]
  node_notifications["Notifications"]
  node_safety["Safety and reports<br/>[safety.service.ts]"]
end

subgraph group_platform["Platform services"]
  node_admin["Admin moderation<br/>[admin.service.ts]"]
  node_payments["Membership payments<br/>[payment.service.ts]"]
  node_uploads["Media uploads<br/>[upload.storage.ts]"]
  node_email["Email delivery<br/>[email.service.ts]"]
  node_prisma["Database access<br/>[prisma.service.ts]"]
end

node_member(("Member"))
node_postgres[("PostgreSQL")]
node_razorpay["Razorpay"]
node_emailprovider["Email provider"]

node_member -->|"uses"| node_web
node_web -->|"renders"| node_routes
node_web -->|"provides auth"| node_authstate
node_routes -->|"routes to"| node_searchui
node_routes -->|"routes to"| node_membershipui
node_routes -->|"routes to"| node_messagesui
node_authstate -->|"uses auth service"| node_api
node_api -->|"uses"| node_token
node_searchui -->|"searches through"| node_api
node_auth -->|"manages accounts"| node_users
node_auth -->|"sends welcome email"| node_email
node_chat -->|"notifies"| node_notifications
node_notifications -->|"sends email"| node_email
node_admin -->|"uses profile service"| node_profiles
node_admin -->|"queries"| node_prisma
node_savedsearch -->|"reads and writes"| node_prisma
node_savedsearch -->|"notifies"| node_notifications
node_chat -->|"reads and writes"| node_prisma
node_notifications -->|"reads and writes"| node_prisma
node_prisma -->|"connects"| node_postgres
node_payments -.->|"payment integration"| node_razorpay
node_email -.->|"delivery integration"| node_emailprovider

click node_web "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/main.jsx"
click node_routes "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/routes/AppRoutes.jsx"
click node_authstate "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/context/AuthContext.jsx"
click node_searchui "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/pages/search/Search.jsx"
click node_membershipui "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/pages/membership/Membership.jsx"
click node_messagesui "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/pages/messages/Messages.jsx"
click node_api "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/services/api.js"
click node_token "https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/utils/token.js"
click node_auth "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/auth/auth.service.ts"
click node_users "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/users/users.service.ts"
click node_profiles "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/profile/profile.service.ts"
click node_preferences "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/profile/preferences.service.ts"
click node_savedsearch "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/profile/saved-search.service.ts"
click node_matches "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/match/match.service.ts"
click node_interests "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/interest/interest.service.ts"
click node_chat "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/chat/chat.service.ts"
click node_notifications "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/notification/notification.service.ts"
click node_safety "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/safety/safety.service.ts"
click node_admin "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/admin/admin.service.ts"
click node_payments "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/payment/payment.service.ts"
click node_uploads "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/upload/upload.storage.ts"
click node_email "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/email/email.service.ts"
click node_prisma "https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/prisma/prisma.service.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_web,node_routes,node_authstate,node_searchui,node_membershipui,node_messagesui,node_api,node_token toneBlue
class node_auth,node_users,node_postgres toneAmber
class node_profiles,node_preferences,node_savedsearch,node_matches toneMint
class node_interests,node_chat,node_notifications,node_safety toneRose
class node_admin,node_payments,node_uploads,node_email,node_prisma,node_member,node_razorpay,node_emailprovider toneIndigo
```

## Components

### Web application

- [React application](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Route access](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/routes/AppRoutes.jsx): `frontend/src/routes/AppRoutes.jsx`
- [Auth state](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/context/AuthContext.jsx): `frontend/src/context/AuthContext.jsx`
- [Search experience](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/pages/search/Search.jsx): `frontend/src/pages/search/Search.jsx`
- [Membership experience](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/pages/membership/Membership.jsx): `frontend/src/pages/membership/Membership.jsx`
- [Messaging experience](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/pages/messages/Messages.jsx): `frontend/src/pages/messages/Messages.jsx`
- [API client](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/services/api.js): `frontend/src/services/api.js`
- [Token handling](https://github.com/koushiksai166/martirmony-clone/blob/main/frontend/src/utils/token.js): `frontend/src/utils/token.js`

### Identity and accounts

- [Authentication](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [User accounts](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/users/users.service.ts): `backend/src/users/users.service.ts`

### Profiles and discovery

- [Profile management](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/profile/profile.service.ts): `backend/src/profile/profile.service.ts`
- [Partner preferences](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/profile/preferences.service.ts): `backend/src/profile/preferences.service.ts`
- [Saved searches](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/profile/saved-search.service.ts): `backend/src/profile/saved-search.service.ts`
- [Matching](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/match/match.service.ts): `backend/src/match/match.service.ts`

### Communication and safety

- [Interest exchange](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/interest/interest.service.ts): `backend/src/interest/interest.service.ts`
- [Chat](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/chat/chat.service.ts): `backend/src/chat/chat.service.ts`
- [Notifications](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/notification/notification.service.ts): `backend/src/notification/notification.service.ts`
- [Safety and reports](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/safety/safety.service.ts): `backend/src/safety/safety.service.ts`

### Platform services

- [Admin moderation](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/admin/admin.service.ts): `backend/src/admin/admin.service.ts`
- [Membership payments](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/payment/payment.service.ts): `backend/src/payment/payment.service.ts`
- [Media uploads](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/upload/upload.storage.ts): `backend/src/upload/upload.storage.ts`
- [Email delivery](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/email/email.service.ts): `backend/src/email/email.service.ts`
- [Database access](https://github.com/koushiksai166/martirmony-clone/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`

### Other components

- **Member**
- **PostgreSQL**
- **Razorpay**
- **Email provider**

## Connections

- Member → React application: uses (evidence: `frontend/src/main.jsx`)
- React application → Route access: renders
- React application → Auth state: provides auth (evidence: `frontend/src/main.jsx`)
- Route access → Search experience: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Route access → Membership experience: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Route access → Messaging experience: routes to (evidence: `frontend/src/routes/AppRoutes.jsx`)
- Auth state → API client: uses auth service (evidence: `frontend/src/context/AuthContext.jsx`)
- API client → Token handling: uses (evidence: `frontend/src/services/api.js`)
- Search experience → API client: searches through
- Authentication → User accounts: manages accounts (evidence: `backend/src/auth/auth.service.ts`)
- Authentication → Email delivery: sends welcome email (evidence: `backend/src/auth/auth.service.ts`)
- Chat → Notifications: notifies (evidence: `backend/src/chat/chat.service.ts`)
- Notifications → Email delivery: sends email (evidence: `backend/src/notification/notification.service.ts`)
- Admin moderation → Profile management: uses profile service (evidence: `backend/src/admin/admin.service.ts`)
- Admin moderation → Database access: queries (evidence: `backend/src/admin/admin.service.ts`)
- Saved searches → Database access: reads and writes (evidence: `backend/src/profile/saved-search.service.ts`)
- Saved searches → Notifications: notifies (evidence: `backend/src/profile/saved-search.service.ts`)
- Chat → Database access: reads and writes (evidence: `backend/src/chat/chat.service.ts`)
- Notifications → Database access: reads and writes (evidence: `backend/src/notification/notification.service.ts`)
- Database access → PostgreSQL: connects (evidence: `backend/src/prisma/prisma.service.ts`)
- Membership payments → Razorpay: payment integration (evidence: `README.md`)
- Email delivery → Email provider: delivery integration (evidence: `README.md`)
