-
Notifications
You must be signed in to change notification settings - Fork 1
primitives index
github-actions[bot] edited this page Jun 19, 2026
·
1 revision
The 360Ghar backend is built on a small set of foundational domain objects. This section documents each primitive, its purpose, key fields, relationships, and the service and model files that own it. Read these pages before the feature and systems sections, since the features compose these primitives into product capabilities.
The platform's six modules (Ghar Core, 360 Stays, Flatmates, Property Management, 360 Virtual Tours, and the 360 Data Hub) all share the same underlying tables. There is one User table, one Property table, one Agent table. A booking, a visit, and a flatmate meeting all resolve to rows in the same database, related by foreign keys.
Active contributors: Saksham, Ravi
- user.md - The User model, roles, phone-first auth, preferences, account deletion
- property.md - The Property model, types, purpose, status, geospatial columns, images, amenities
- agent.md - The Agent model, agent types, experience levels, load balancing
- booking.md - The Booking model, statuses, and the overlapping-bookings rule
- visit.md - The Visit model, statuses, contexts, agent assignment
- lease.md - The Lease model, statuses, termination, and renewal
- tour.md - The Tour model, scenes, hotspots, visibility, analytics, custom domains
All primitives follow the same conventions:
- Models live in
app/models/and inherit fromapp.core.database.Base. - Enums live in
app/models/enums.pyand are stored asSQLEnumcolumns with DB-levelCHECKconstraints. - Business logic lives in
app/services/and is async-first, injectingAsyncSessionthrough FastAPI dependencies. - Foreign keys use
ON DELETE CASCADEfor ownership edges (user -> property -> visit) andSET NULLfor soft edges (agent assigned to a visit). - Seed demo rows are marked with
is_seed_data = trueonusers,agents, andproperties. Child tables inherit "seedness" through FK joins, never their own flag. Seeseed_data/02_clear_data.py.
- reference/data-models.md for the full entity-relationship diagram across all 68 tables.
- api/index.md for how primitives surface as REST endpoints.
- Features overview
- Ghar Core (marketplace)
- 360 Stays (bookings)
- 360 Flatmates
- Property Management
- 360 Virtual Tours
- 360 Data Hub
- MCP servers and widgets
- AI agent
- Blog and SEO
- Notifications
- Vastu analyzer