# kanishksingh-01/spaceloop architecture

> Architecture diagram of the GitHub repository kanishksingh-01/spaceloop, 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/kanishksingh-01/spaceloop
- Repository: https://github.com/kanishksingh-01/spaceloop

## Overview

SpaceLoop is a peer-to-peer marketplace for short-term use of physical spaces, with AI-assisted listings and search, booking, access, and trust features. The main seeker journey runs from natural-language discovery through booking and a live session to checkout; hosts can create AI-assisted listings and manage their spaces. The graph includes documented fraud, localization, and LoopBot capabilities. Some API and UI modules were not sampled, so those subsystem links rely on README statements rather than inspected call sites.

Main entry points: [`frontend/src/App.tsx`](https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/App.tsx) (Marketplace UI), [`backend/app/api/v1`](https://github.com/kanishksingh-01/spaceloop/tree/main/backend/app/api/v1) (REST API), [`backend/app/api/v1/bookings.py`](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/bookings.py) (Bookings), [`frontend/src/pages/SessionPage.tsx`](https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/pages/SessionPage.tsx) (Session console)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Marketplace experience"]
  node_webapp["Marketplace UI<br/>[App.tsx]"]
  node_sessionui["Session console<br/>[SessionPage.tsx]"]
  node_api["REST API"]
  node_localization["Localization<br/>[I18nContext.tsx]"]
end

subgraph group_market["Listings and discovery"]
  node_spaces["Space listings<br/>[spaces.py]"]
  node_listingai["AI listing assistance"]
end

subgraph group_booking["Booking and sessions"]
  node_bookings["Bookings<br/>[bookings.py]"]
  node_models[("Marketplace records<br/>[models.py]")]
  node_database[("Application database<br/>[database.py]")]
end

subgraph group_intelligence["AI and search"]
  node_nlp["Query understanding<br/>[pipeline.py]"]
  node_search["Hybrid search<br/>[hybrid_search.py]"]
  node_loopbot["LoopBot assistant"]
  node_rag["Knowledge retrieval<br/>[rag_service.py]"]
end

subgraph group_trust["Identity and safety"]
  node_auth["Authentication<br/>[auth.py]"]
  node_trustapi["Trust and safety<br/>[trust_safety.py]"]
  node_trustengine["Trust signals<br/>[engine.py]"]
  node_fraud["Fraud detection<br/>[service.py]"]
  node_email["Email service<br/>[service.py]"]
end

node_seeker(("Seeker"))
node_host(("Host"))

node_seeker -->|"searches and books"| node_webapp
node_host -->|"lists spaces"| node_webapp
node_webapp -->|"opens session"| node_sessionui
node_webapp -.->|"calls APIs"| node_api
node_sessionui -.->|"uses booking APIs"| node_api
node_api -->|"routes auth"| node_auth
node_api -->|"routes listings"| node_spaces
node_api -->|"routes bookings"| node_bookings
node_bookings -.->|"persists booking"| node_models
node_spaces -.->|"assists listing"| node_listingai
node_seeker -->|"asks naturally"| node_nlp
node_nlp -->|"dispatches search"| node_search
node_search -.->|"retrieves spaces"| node_models
node_webapp -.->|"asks LoopBot"| node_loopbot
node_loopbot -->|"processes query"| node_nlp
node_loopbot -.->|"retrieves guidance"| node_rag
node_bookings -.->|"checks trust"| node_trustapi
node_trustapi -.->|"evaluates signals"| node_trustengine
node_bookings -.->|"scores events"| node_fraud
node_auth -->|"sends verification"| node_email
node_webapp -.->|"renders languages"| node_localization
node_api -.->|"uses storage"| node_database
node_bookings -->|"enables live session"| node_sessionui
node_sessionui -.->|"records session"| node_bookings

click node_webapp "https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/App.tsx"
click node_sessionui "https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/pages/SessionPage.tsx"
click node_api "https://github.com/kanishksingh-01/spaceloop/tree/main/backend/app/api/v1"
click node_auth "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/auth.py"
click node_spaces "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/spaces.py"
click node_bookings "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/bookings.py"
click node_models "https://github.com/kanishksingh-01/spaceloop/blob/main/models.py"
click node_nlp "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/nlp/pipeline.py"
click node_search "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/search/hybrid_search.py"
click node_loopbot "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/ai/loopbot_orchestrator.py"
click node_rag "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/ai/rag_service.py"
click node_listingai "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/nlp/listing_assistance.py"
click node_trustapi "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/trust_safety.py"
click node_trustengine "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/trust_safety/engine.py"
click node_fraud "https://github.com/kanishksingh-01/spaceloop/blob/main/fraud_engine/service.py"
click node_localization "https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/i18n/I18nContext.tsx"
click node_email "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/email/service.py"
click node_database "https://github.com/kanishksingh-01/spaceloop/blob/main/backend/core/database.py"

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_sessionui,node_api,node_localization toneBlue
class node_spaces,node_listingai toneAmber
class node_bookings,node_models,node_database toneMint
class node_nlp,node_search,node_loopbot,node_rag toneRose
class node_auth,node_trustapi,node_trustengine,node_fraud,node_email,node_seeker,node_host toneIndigo
```

## Components

### Marketplace experience

- [Marketplace UI](https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Session console](https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/pages/SessionPage.tsx): `frontend/src/pages/SessionPage.tsx`
- [REST API](https://github.com/kanishksingh-01/spaceloop/tree/main/backend/app/api/v1): `backend/app/api/v1`
- [Localization](https://github.com/kanishksingh-01/spaceloop/blob/main/frontend/src/i18n/I18nContext.tsx): `frontend/src/i18n/I18nContext.tsx`

### Listings and discovery

- [Space listings](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/spaces.py): `backend/app/api/v1/spaces.py`
- [AI listing assistance](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/nlp/listing_assistance.py): `backend/modules/nlp/listing_assistance.py`

### Booking and sessions

- [Bookings](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/bookings.py): `backend/app/api/v1/bookings.py`
- [Marketplace records](https://github.com/kanishksingh-01/spaceloop/blob/main/models.py): `models.py`
- [Application database](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/core/database.py): `backend/core/database.py`

### AI and search

- [Query understanding](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/nlp/pipeline.py): `backend/modules/nlp/pipeline.py`
- [Hybrid search](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/search/hybrid_search.py): `backend/modules/search/hybrid_search.py`
- [LoopBot assistant](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/ai/loopbot_orchestrator.py): `backend/modules/ai/loopbot_orchestrator.py`
- [Knowledge retrieval](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/ai/rag_service.py): `backend/modules/ai/rag_service.py`

### Identity and safety

- [Authentication](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/auth.py): `backend/app/api/v1/auth.py`
- [Trust and safety](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/app/api/v1/trust_safety.py): `backend/app/api/v1/trust_safety.py`
- [Trust signals](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/trust_safety/engine.py): `backend/modules/trust_safety/engine.py`
- [Fraud detection](https://github.com/kanishksingh-01/spaceloop/blob/main/fraud_engine/service.py): `fraud_engine/service.py`
- [Email service](https://github.com/kanishksingh-01/spaceloop/blob/main/backend/modules/email/service.py): `backend/modules/email/service.py`

### Other components

- **Seeker**
- **Host**

## Connections

- Seeker → Marketplace UI: searches and books
- Host → Marketplace UI: lists spaces
- Marketplace UI → Session console: opens session (evidence: `frontend/src/App.tsx`)
- Marketplace UI → REST API: calls APIs
- Session console → REST API: uses booking APIs
- REST API → Authentication: routes auth (evidence: `app.py`)
- REST API → Space listings: routes listings (evidence: `app.py`)
- REST API → Bookings: routes bookings (evidence: `app.py`)
- Bookings → Marketplace records: persists booking
- Space listings → AI listing assistance: assists listing
- Seeker → Query understanding: asks naturally
- Query understanding → Hybrid search: dispatches search (evidence: `backend/modules/nlp/pipeline.py`)
- Hybrid search → Marketplace records: retrieves spaces
- Marketplace UI → LoopBot assistant: asks LoopBot
- LoopBot assistant → Query understanding: processes query (evidence: `backend/modules/ai/loopbot_orchestrator.py`)
- LoopBot assistant → Knowledge retrieval: retrieves guidance (evidence: `backend/modules/ai/loopbot_orchestrator.py`)
- Bookings → Trust and safety: checks trust
- Trust and safety → Trust signals: evaluates signals
- Bookings → Fraud detection: scores events
- Authentication → Email service: sends verification (evidence: `backend/app/api/v1/auth.py`)
- Marketplace UI → Localization: renders languages
- REST API → Application database: uses storage
- Bookings → Session console: enables live session
- Session console → Bookings: records session
