Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
d62c225
feat: setup initial monorepo architecture
vishnuvvv May 25, 2026
353c374
implement app architecture docs
vishnuvvv Jun 1, 2026
da3aec4
implements the file and folder structure
vishnuvvv Jun 1, 2026
dcaa087
updates file structure
vishnuvvv Jun 2, 2026
d60dc3f
update functionality details
vishnuvvv Jun 4, 2026
7f195c4
Implements srver structure
vishnuvvv Jun 4, 2026
cfca971
implements the design of venue listing page ui
vishnuvvv Jun 6, 2026
f629a20
implements the authentication ui
vishnuvvv Jun 7, 2026
0416111
Implements the ui of venue owner page
vishnuvvv Jun 9, 2026
d4878e7
Merge pull request #1 from vishnuvvv/feat/project-setup
vishnuvvv Jun 9, 2026
2d2b9ec
implements the add venue and admin ui also adds theverify venue modal…
vishnuvvv Jun 10, 2026
2d13e5b
Merge pull request #2 from vishnuvvv/feat/project-setup
vishnuvvv Jun 10, 2026
4ebf396
improved ui
vishnuvvv Jun 11, 2026
7671205
Merge pull request #3 from vishnuvvv/feat/project-setup
vishnuvvv Jun 11, 2026
a0704b4
feat : eslint rules added
irfanopc-iouring Jun 13, 2026
300faf5
fix : added styles in a seperate folder for auth
irfanopc-iouring Jun 13, 2026
c41d366
fix: folder structure changes for profile venue owner auth and dummy …
irfanopc-iouring Jun 13, 2026
e1f39b7
fix : folder structure changed for admin profile venues
irfanopc-iouring Jun 13, 2026
99d6dca
Merge pull request #4 from vishnuvvv/folder-structure
vishnuvvv Jun 14, 2026
87471e9
fix : dark light theme added and redux added styles added seperate fo…
irfanopc-iouring Jun 15, 2026
4b4d287
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
irfanopc-iouring Jun 15, 2026
c84a015
Merge pull request #5 from vishnuvvv/folder-structure
vishnuvvv Jun 16, 2026
90c3048
feat: Added language and constants
irfanopc-iouring Jun 16, 2026
51b9f13
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
irfanopc-iouring Jun 16, 2026
a45a082
feat: Added language and constants
irfanopc-iouring Jun 16, 2026
1d47fce
feat: added view deatils screen and side menu actions
irfanopc-iouring Jun 17, 2026
7761d97
feat: added view deatils screen and side menu actions
irfanopc-iouring Jun 17, 2026
6956584
feat: light and dark bg added for top sections
irfanopc-iouring Jun 17, 2026
163bbba
fix: language rendering issue resolved in sidebar
irfanopc-iouring Jun 17, 2026
bbca674
Merge pull request #6 from vishnuvvv/folder-structure
vishnuvvv Jun 18, 2026
d392f11
doc: adds the production requirement document and lld doc of auth module
vishnuvvv Jun 19, 2026
25d1625
Merge pull request #7 from vishnuvvv/doc/architecture
Labeebopc Jun 19, 2026
82f2aed
doc:updates the architecture and introduces low level design of venue…
vishnuvvv Jun 20, 2026
9e1ad25
Merge pull request #8 from vishnuvvv/doc/architecture
irfanopc Jun 22, 2026
49f8926
doc:updates architecure,updates venue module, updates booking module
vishnuvvv Jun 22, 2026
5da1f9b
Merge pull request #10 from vishnuvvv/doc/architecture
Labeebopc Jun 22, 2026
1baf81b
doc:updates the venue archtecture also adds admin module architecture
vishnuvvv Jun 23, 2026
2d24069
feat: performance widget added for devmode
irfanopc-iouring Jun 23, 2026
6d5aea4
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
irfanopc-iouring Jun 23, 2026
9d7c8db
Merge pull request #11 from vishnuvvv/doc/architecture
irfanopc Jun 23, 2026
fd122b0
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
irfanopc-iouring Jun 23, 2026
63baeea
Merge pull request #12 from vishnuvvv/folder-structure
vishnuvvv Jun 23, 2026
22c58eb
feat: implement user authentication system with JWT, Prisma, and pass…
Labeebopc Jul 1, 2026
988030d
chore: remove package-lock.json to resolve dependency management conf…
Labeebopc Jul 1, 2026
c71a4cf
Merge pull request #13 from vishnuvvv/refactor/backend-structure
vishnuvvv Jul 2, 2026
d8c1bfc
adds notification module
vishnuvvv Jul 2, 2026
0a80e63
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
vishnuvvv Jul 2, 2026
4e28cbb
Merge pull request #14 from vishnuvvv/doc/architecture
Labeebopc Jul 2, 2026
1789f2a
feat: implements user schema
vishnuvvv Jul 3, 2026
b26c37c
Merge pull request #15 from vishnuvvv/doc/architecture
Labeebopc Jul 3, 2026
b762de0
feat:implements athentication using otp
vishnuvvv Jul 5, 2026
2afb181
Merge pull request #16 from vishnuvvv/doc/architecture
Labeebopc Jul 5, 2026
762d62d
refactor:all services moves into providers folder
vishnuvvv Jul 6, 2026
4c6e791
feat : implements getmyprofile api and jwt strategy
vishnuvvv Jul 6, 2026
5432730
Merge pull request #17 from vishnuvvv/feat/auth
Labeebopc Jul 6, 2026
50ad919
feat: add venue management models, controller, service, and module fo…
Labeebopc Jul 6, 2026
6ff890b
feat: implements Oauth authentication api
vishnuvvv Jul 6, 2026
b0cb752
Merge pull request #18 from vishnuvvv/feat/auth
Labeebopc Jul 6, 2026
82e1bed
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
Labeebopc Jul 6, 2026
c57f996
Merge pull request #19 from vishnuvvv/feat/venue
vishnuvvv Jul 7, 2026
959143d
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
Labeebopc Jul 7, 2026
4e41d24
feat: add CreateVenueDto for venue creation with validation
Labeebopc Jul 7, 2026
a70e11e
feat: add validation for categories in CreateVenueDto
Labeebopc Jul 7, 2026
b596394
feat: add cookie-parser and implement token handling in auth controll…
Labeebopc Jul 7, 2026
c892956
feat: implements add venue api and cloudinary integration
vishnuvvv Jul 7, 2026
f2279fb
Merge pull request #20 from vishnuvvv/feat/auth
vishnuvvv Jul 7, 2026
76e7d1c
Merge branch 'development' into feat/venue
Labeebopc Jul 7, 2026
2449494
Merge pull request #21 from vishnuvvv/feat/venue
Labeebopc Jul 7, 2026
f3bfbcd
feat: updates dto and service and controller of add venue api
vishnuvvv Jul 8, 2026
495ed1f
feat: implements teh final tested addvenue api
vishnuvvv Jul 8, 2026
6fc7770
Merge pull request #22 from vishnuvvv/feat/venue
Labeebopc Jul 8, 2026
775ae8a
feat: implement refresh token functionality and update access token h…
Labeebopc Jul 9, 2026
b971c7c
feat: refactor refresh token method for improved readability
Labeebopc Jul 9, 2026
9962284
feat implements get venue by id and get all venue api
vishnuvvv Jul 9, 2026
b0dc7f1
Merge branch 'development' of https://github.com/vishnuvvv/BookMyVenu…
vishnuvvv Jul 9, 2026
db29359
Merge pull request #23 from vishnuvvv/feat/auth
vishnuvvv Jul 9, 2026
a26736f
Merge pull request #24 from vishnuvvv/feat/venue
Labeebopc Jul 9, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
318 changes: 318 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
# 🏗️ Architecture

**Venue Booking Platform** — System & Repository Architecture

This document is the map of the codebase: how the frontend, backend, database, and third-party services connect, how the repo is laid out, and the rules that keep modules from becoming tangled as the project grows. For feature-level detail (schemas, endpoints, edge cases), see the per-module LLDs in `/docs/lld`.

---

## 📑 Table of Contents

1. [System Overview](#1-system-overview)
2. [Repository Layout](#2-repository-layout)
3. [Backend Folder Structure](#3-backend-folder-structure)
4. [Frontend Folder Structure](#4-frontend-folder-structure)
5. [Module Boundary Rules](#5-module-boundary-rules)
6. [Environment & Config Strategy](#6-environment--config-strategy)
7. [Naming Conventions](#7-naming-conventions)

---

## 1. System Overview

```
┌──────────────────────────────┐
│ BROWSER │
└───────────────┬──────────────┘
┌──────────────────────────────────────┐
│ FRONTEND (Next.js) │
│ Redux Toolkit · RTK Query · OpenLayers │
│ next-themes · next-intl │
└───────────────────┬──────────────────┘
│ REST /api/v1/*
┌──────────────────────────────────────┐
│ AUTH LAYER │
│ Google OAuth · Email OTP · JWT │
└───────────────────┬──────────────────┘
┌─────────────────────────────────────────────────────────────┐
│ BACKEND API (NestJS) │
│ │
│ ┌────────┐ ┌────────┐ ┌─────────┐ ┌────────┐ ┌────────┐ │
│ │ Auth │ │ Venue │ │ Booking │ │ User │ │ Admin │ │
│ └────────┘ └────────┘ └─────────┘ └────────┘ └────────┘ │
│ ┌──────────────┐ │
│ │ Notification │ (standalone, called by all) │
│ └──────────────┘ │
└───────┬─────────────────────┬─────────────────────┬───────────┘
│ │ │
▼ ▼ ▼
┌─────────────────────┐ ┌──────────────────┐ ┌──────────────────────┐
│ Upstash Redis │ │ PostgreSQL │ │ Third-Party Services │
│ OTP · Rate Limit · │ │ Users · Venues · │ │ Razorpay · Cloudinary │
│ Booking Slot Locks │ │ Bookings · Wishlist │ │ Nodemailer · OSM │
└─────────────────────┘ └──────────────────┘ └──────────────────────┘
```

| Layer | Responsibility |
|---|---|
| **Frontend** | Next.js app — rendering, RTK Query API calls, map UI, theming, i18n |
| **Auth Layer** | Identity verification, JWT issuance — sits in front of all protected routes |
| **Backend API** | NestJS feature modules — each owns its own schema, endpoints, and business logic |
| **Cache / Lock Store** | Upstash Redis — OTP, rate limiting, booking slot locks |
| **Database** | PostgreSQL — single source of truth for all persisted data |
| **Third-Party Services** | Razorpay, Cloudinary, Nodemailer, OpenStreetMap — called directly from the relevant backend module |

> Full request/response contracts, schemas, and sequence flows for each module live in their own LLD documents — this diagram only shows how the *pieces* fit together.

---

## 2. Repository Layout

Single repo, two top-level apps, kept structurally independent so either could be deployed or even extracted on its own later.

```
venue-booking-platform/
├── frontend/ # Next.js application
├── backend/ # NestJS application
├── docs/
│ ├── prd.md
│ ├── architecture.md # this file
│ └── lld/
│ ├── auth-module-lld.md
│ ├── venue-module-lld.md
│ ├── booking-module-lld.md
│ ├── user-module-lld.md
│ ├── admin-module-lld.md
│ └── notification-module-lld.md
├── .gitignore
└── README.md
```

Frontend and backend each have their own `package.json`, `.env`, and dependency tree — there is no shared `node_modules` or monorepo tooling (Turborepo/Nx) in Phase 1. That's a Phase 2 consideration if the project's contributor base grows enough to need it.

---

## 3. Backend Folder Structure

NestJS, organized as **one feature module per domain area** — mirroring the module split used across the LLDs (Auth, Venue, Booking, User, Admin, Notification).

```
backend/
├── src/
│ ├── main.ts
│ ├── app.module.ts
│ │
│ ├── auth/
│ │ ├── auth.module.ts
│ │ ├── auth.controller.ts
│ │ ├── auth.service.ts
│ │ ├── strategies/
│ │ │ ├── jwt.strategy.ts
│ │ │ └── google.strategy.ts
│ │ ├── guards/
│ │ │ ├── jwt-auth.guard.ts
│ │ │ └── roles.guard.ts
│ │ ├── decorators/
│ │ │ ├── roles.decorator.ts
│ │ │ └── current-user.decorator.ts
│ │ └── dto/
│ │
│ ├── venue/
│ │ ├── venue.module.ts
│ │ ├── venue.controller.ts
│ │ ├── venue.service.ts
│ │ ├── availability/
│ │ │ ├── availability.controller.ts
│ │ │ └── availability.service.ts
│ │ ├── images/
│ │ │ ├── images.controller.ts
│ │ │ ├── images.service.ts
│ │ │ └── cloudinary.provider.ts
│ │ └── dto/
│ │
│ ├── booking/
│ │ ├── booking.module.ts
│ │ ├── booking.controller.ts
│ │ ├── booking.service.ts
│ │ ├── payment/
│ │ │ ├── razorpay.provider.ts
│ │ │ └── payment.service.ts
│ │ └── dto/
│ │
│ ├── user/
│ │ ├── user.module.ts
│ │ ├── user.controller.ts
│ │ ├── user.service.ts
│ │ └── dto/
│ │
│ ├── admin/
│ │ ├── admin.module.ts
│ │ ├── admin.controller.ts
│ │ ├── admin.service.ts
│ │ └── dto/
│ │
│ ├── notification/
│ │ ├── notification.module.ts
│ │ ├── notification.controller.ts
│ │ ├── notification.service.ts
│ │ └── dto/
│ │
│ ├── amenity/
│ │ ├── amenity.module.ts
│ │ ├── amenity.controller.ts
│ │ └── amenity.service.ts
│ │
│ ├── common/ # shared across all modules
│ │ ├── filters/
│ │ │ └── http-exception.filter.ts
│ │ ├── interceptors/
│ │ │ └── transform.interceptor.ts
│ │ ├── pipes/
│ │ │ └── validation.pipe.ts
│ │ └── decorators/
│ │
│ ├── config/
│ │ ├── configuration.ts # env loading & validation
│ │ └── redis.config.ts
│ │
│ └── prisma/
│ ├── prisma.service.ts
│ └── prisma.module.ts
├── prisma/
│ ├── schema.prisma # single schema file, all models
│ └── migrations/
├── test/
├── .env.example
├── package.json
├── tsconfig.json
└── nest-cli.json
```

**Why one module per domain, not a layered structure (controllers/, services/, models/ at the top level):** keeps everything related to "Venue" in one place — easier for a new open-source contributor to find and reason about, and matches NestJS's own recommended module pattern.

---

## 4. Frontend Folder Structure

Next.js App Router, **feature-based** — matching what's already implemented. Documented here so backend contributors and reviewers understand how it maps to the same domain split used on the backend.

```
frontend/
├── app/ # Next.js App Router — routes only
│ ├── (auth)/
│ │ ├── login/page.tsx
│ │ └── layout.tsx
│ ├── (main)/
│ │ ├── venues/
│ │ │ ├── [id]/page.tsx
│ │ │ └── page.tsx
│ │ ├── bookings/page.tsx
│ │ ├── wishlist/page.tsx
│ │ └── layout.tsx
│ ├── (owner)/
│ │ ├── my-venues/page.tsx
│ │ └── add-venue/page.tsx
│ ├── (admin)/
│ │ └── dashboard/page.tsx
│ └── layout.tsx
├── features/ # feature-based domain modules
│ ├── auth/
│ │ ├── components/
│ │ ├── authApi.ts # RTK Query slice
│ │ └── authSlice.ts
│ ├── venue/
│ │ ├── components/
│ │ ├── venueApi.ts
│ │ └── venueSlice.ts
│ ├── booking/
│ │ ├── components/
│ │ ├── bookingApi.ts
│ │ └── bookingSlice.ts
│ ├── wishlist/
│ │ ├── components/
│ │ └── wishlistApi.ts
│ └── notification/
│ ├── components/
│ └── notificationApi.ts
├── components/ # shared/reusable UI, not feature-specific
│ ├── ui/
│ └── layout/
├── lib/
│ ├── store.ts # Redux store setup
│ └── api-client.ts # RTK Query base config
├── public/
├── messages/ # next-intl translations
│ ├── en.json
│ └── hi.json
├── next.config.js
└── tsconfig.json
```

**Mapping to the backend:** each folder under `features/` corresponds to a backend module of the same name (`auth/`, `venue/`, `booking/`) — a contributor working on Booking knows to look in `backend/src/booking/` and `frontend/features/booking/` for the full vertical slice.

---

## 5. Module Boundary Rules

These rules came directly out of the per-module LLD design work and are the most important part of this document — they're what keep the codebase from drifting into tangled cross-imports as more contributors join.

> **Rule 1 — Cross-module communication is a direct service call, not a schema relation.**
> Example: `VenueService` calls `AuthService.upgradeToVenueOwner(userId)` directly. There is no foreign key between `Venue` and `User.role` — the call updates it through code, not through the database.

> **Rule 2 — The only schema relation that crosses module ownership is `Notification.userId → User.id`.**
> Every other cross-module interaction (Booking checking Venue availability, Admin updating Venue status) happens via an exported service method, never by adding a new foreign key into another module's table.

> **Rule 3 — No message queue (RabbitMQ) in Phase 1.**
> This is a single NestJS process. A queue solves problems that arise when services are deployed separately and can't call each other directly — that isn't the case here. Reserved for a future microservices split, if the project ever grows into one.

> **Rule 4 — Notification is a standalone module, owned by no one feature.**
> Auth, Venue, Booking, and Admin all call into it (`NotificationService.create(...)`), but none of them import its internals or duplicate its logic.

> **Rule 5 — Each module owns its own DTOs, guards, and validation.**
> A module never reaches into another module's `dto/` folder or reuses its validation pipes directly — shared validation logic goes in `common/`, not by importing from a sibling feature module.

---

## 6. Environment & Config Strategy

| Variable group | Used by | Example keys |
|---|---|---|
| Database | Prisma / PostgreSQL | `DATABASE_URL` |
| Redis | Upstash | `UPSTASH_REDIS_REST_URL`, `UPSTASH_REDIS_REST_TOKEN` |
| Auth | Auth module | `JWT_SECRET`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` |
| Email | Notification / Auth | `SMTP_HOST`, `SMTP_USER`, `SMTP_PASS` |
| Payments | Booking module | `RAZORPAY_KEY_ID`, `RAZORPAY_KEY_SECRET` |
| Media | Venue module | `CLOUDINARY_CLOUD_NAME`, `CLOUDINARY_API_KEY`, `CLOUDINARY_API_SECRET` |

- `backend/.env.example` and `frontend/.env.example` are committed; actual `.env` files are git-ignored
- Config is loaded and validated once at startup (`config/configuration.ts`), not read directly via `process.env` scattered across modules

---

## 7. Naming Conventions

| Item | Convention | Example |
|---|---|---|
| NestJS files | `kebab-case.type.ts` | `create-venue.dto.ts`, `jwt-auth.guard.ts` |
| Modules/Classes | `PascalCase` | `VenueService`, `CreateVenueDto` |
| API endpoints | `/api/v1/kebab-case` | `/api/v1/venues/:id/blocked-dates` |
| Database tables (Prisma models) | `PascalCase` singular | `Venue`, `VenueSlotTemplate` |
| Frontend feature folders | `kebab-case`, matches backend module name | `features/booking/` ↔ `backend/src/booking/` |
| RTK Query slices | `camelCase` + `Api` suffix | `venueApi.ts`, `bookingApi.ts` |

---



**Venue Booking Platform** · Architecture Reference · v1.0

56 changes: 56 additions & 0 deletions apps/backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# compiled output
/dist
/node_modules
/build

# Logs
logs
*.log
npm-debug.log*
pnpm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# OS
.DS_Store

# Tests
/coverage
/.nyc_output

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# temp directory
.temp
.tmp

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
4 changes: 4 additions & 0 deletions apps/backend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "all"
}
Loading