# karimyasse/morafeq architecture

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

- Interactive diagram: https://gitdiagram.com/karimyasse/morafeq
- Repository: https://github.com/karimyasse/morafeq

## Overview

This is a role-based housing marketplace for hosts, expatriate renters, and administrators. Renters discover listings, inspect details, and can proceed to bookings; hosts manage listings and booking requests; both sides have messaging, profiles, and reviews, while administrators moderate listings and disputes. The graph also preserves documented AI housing assistance and location/roommate features. Source excerpts establish several controller-to-service paths, but most feature internals and frontend API wiring were not sampled, so those connections are omitted rather than inferred.

Main entry points: [`Frontend/src/App.jsx`](https://github.com/karimyasse/morafeq/blob/master/Frontend/src/App.jsx) (Role-based application), [`Backend/src/prisma/prisma.service.ts`](https://github.com/karimyasse/morafeq/blob/master/Backend/src/prisma/prisma.service.ts) (Relational data store), [`Backend/src/auth/auth.service.ts`](https://github.com/karimyasse/morafeq/blob/master/Backend/src/auth/auth.service.ts) (Authentication), [`Backend/src/listings/listings.service.ts`](https://github.com/karimyasse/morafeq/blob/master/Backend/src/listings/listings.service.ts) (Listing management and search)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Application entry"]
  node_frontend["Role-based application<br/>[App.jsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_auth["Authentication<br/>[auth.service.ts]"]
  node_profiles["User profiles<br/>[users.service.ts]"]
  node_verification["Account verification"]
end

subgraph group_market["Housing marketplace"]
  node_listingui["Listing discovery and detail"]
  node_listings["Listing management and search"]
  node_search["Search queries<br/>[search.service.ts]"]
  node_bookings["Bookings and requests"]
  node_payments["Payments"]
  node_reviewsui["Review experience"]
  node_reviews["Review management<br/>[reviews.service.ts]"]
  node_favorites["Saved listings"]
  node_locations["Location services"]
  node_insights["Location insights"]
  node_roommates["Roommate matching"]
end

subgraph group_engagement["Messaging and assistance"]
  node_chat["Live messaging<br/>[chat.gateway.ts]"]
  node_disputes["Dispute conversations"]
  node_assistant["AI housing assistant<br/>[ai.service.ts]"]
end

subgraph group_operations["Administration"]
  node_admin["Moderation and dispute review<br/>[admin.service.ts]"]
  node_store[("Relational data store<br/>[prisma.service.ts]")]
end

node_people(("Renters and hosts"))
node_admins(("Administrators"))

node_people -->|"use"| node_frontend
node_admins -->|"use"| node_frontend
node_frontend -.->|"authenticate"| node_auth
node_frontend -->|"route to"| node_listingui
node_frontend -->|"route to"| node_reviewsui
node_auth -->|"read and write"| node_store
node_auth -->|"email codes"| node_people
node_listingui -.->|"request listings"| node_listings
node_listings -.->|"delegate search"| node_search
node_listings -->|"get listing reviews"| node_reviews
node_bookings -.->|"payment handling"| node_payments
node_reviewsui -->|"call review API"| node_reviews
node_reviews -->|"read and write"| node_store
node_admin -.->|"read and write"| node_store
node_admin -.->|"manage conversations"| node_disputes
node_assistant -->|"read sessions"| node_store
node_assistant -->|"index listings"| node_store

click node_frontend "https://github.com/karimyasse/morafeq/blob/master/Frontend/src/App.jsx"
click node_auth "https://github.com/karimyasse/morafeq/blob/master/Backend/src/auth/auth.service.ts"
click node_profiles "https://github.com/karimyasse/morafeq/blob/master/Backend/src/users/users.service.ts"
click node_verification "https://github.com/karimyasse/morafeq/blob/master/Backend/src/verification/verification.service.ts"
click node_listingui "https://github.com/karimyasse/morafeq/tree/master/Frontend/src/features/expatriate"
click node_listings "https://github.com/karimyasse/morafeq/blob/master/Backend/src/listings/listings.service.ts"
click node_search "https://github.com/karimyasse/morafeq/blob/master/Backend/src/search/search.service.ts"
click node_bookings "https://github.com/karimyasse/morafeq/blob/master/Backend/src/bookings/bookings.service.ts"
click node_payments "https://github.com/karimyasse/morafeq/blob/master/Backend/src/payments/payments.service.ts"
click node_reviewsui "https://github.com/karimyasse/morafeq/tree/master/Frontend/src/features/reviews"
click node_reviews "https://github.com/karimyasse/morafeq/blob/master/Backend/src/reviews/reviews.service.ts"
click node_favorites "https://github.com/karimyasse/morafeq/blob/master/Backend/src/favorites/favorites.service.ts"
click node_locations "https://github.com/karimyasse/morafeq/blob/master/Backend/src/locations/locations.service.ts"
click node_insights "https://github.com/karimyasse/morafeq/blob/master/Backend/src/location-insights/location-insights.service.ts"
click node_roommates "https://github.com/karimyasse/morafeq/blob/master/Backend/src/roommate-matching/roommate-matching.service.ts"
click node_chat "https://github.com/karimyasse/morafeq/blob/master/Backend/src/chat/chat.gateway.ts"
click node_disputes "https://github.com/karimyasse/morafeq/blob/master/Backend/src/dispute-chat/dispute-chat.service.ts"
click node_assistant "https://github.com/karimyasse/morafeq/blob/master/Backend/src/ai/ai.service.ts"
click node_admin "https://github.com/karimyasse/morafeq/blob/master/Backend/src/admin/admin.service.ts"
click node_store "https://github.com/karimyasse/morafeq/blob/master/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_frontend toneBlue
class node_auth,node_profiles,node_verification toneAmber
class node_listingui,node_listings,node_search,node_bookings,node_payments,node_reviewsui,node_reviews,node_favorites,node_locations,node_insights,node_roommates toneMint
class node_chat,node_disputes,node_assistant toneRose
class node_admin,node_store,node_people,node_admins toneIndigo
```

## Components

### Application entry

- [Role-based application](https://github.com/karimyasse/morafeq/blob/master/Frontend/src/App.jsx): `Frontend/src/App.jsx`

### Identity and profiles

- [Authentication](https://github.com/karimyasse/morafeq/blob/master/Backend/src/auth/auth.service.ts): `Backend/src/auth/auth.service.ts`
- [User profiles](https://github.com/karimyasse/morafeq/blob/master/Backend/src/users/users.service.ts): `Backend/src/users/users.service.ts`
- [Account verification](https://github.com/karimyasse/morafeq/blob/master/Backend/src/verification/verification.service.ts): `Backend/src/verification/verification.service.ts`

### Housing marketplace

- [Listing discovery and detail](https://github.com/karimyasse/morafeq/tree/master/Frontend/src/features/expatriate): `Frontend/src/features/expatriate`
- [Listing management and search](https://github.com/karimyasse/morafeq/blob/master/Backend/src/listings/listings.service.ts): `Backend/src/listings/listings.service.ts`
- [Search queries](https://github.com/karimyasse/morafeq/blob/master/Backend/src/search/search.service.ts): `Backend/src/search/search.service.ts`
- [Bookings and requests](https://github.com/karimyasse/morafeq/blob/master/Backend/src/bookings/bookings.service.ts): `Backend/src/bookings/bookings.service.ts`
- [Payments](https://github.com/karimyasse/morafeq/blob/master/Backend/src/payments/payments.service.ts): `Backend/src/payments/payments.service.ts`
- [Review experience](https://github.com/karimyasse/morafeq/tree/master/Frontend/src/features/reviews): `Frontend/src/features/reviews`
- [Review management](https://github.com/karimyasse/morafeq/blob/master/Backend/src/reviews/reviews.service.ts): `Backend/src/reviews/reviews.service.ts`
- [Saved listings](https://github.com/karimyasse/morafeq/blob/master/Backend/src/favorites/favorites.service.ts): `Backend/src/favorites/favorites.service.ts`
- [Location services](https://github.com/karimyasse/morafeq/blob/master/Backend/src/locations/locations.service.ts): `Backend/src/locations/locations.service.ts`
- [Location insights](https://github.com/karimyasse/morafeq/blob/master/Backend/src/location-insights/location-insights.service.ts): `Backend/src/location-insights/location-insights.service.ts`
- [Roommate matching](https://github.com/karimyasse/morafeq/blob/master/Backend/src/roommate-matching/roommate-matching.service.ts): `Backend/src/roommate-matching/roommate-matching.service.ts`

### Messaging and assistance

- [Live messaging](https://github.com/karimyasse/morafeq/blob/master/Backend/src/chat/chat.gateway.ts): `Backend/src/chat/chat.gateway.ts`
- [Dispute conversations](https://github.com/karimyasse/morafeq/blob/master/Backend/src/dispute-chat/dispute-chat.service.ts): `Backend/src/dispute-chat/dispute-chat.service.ts`
- [AI housing assistant](https://github.com/karimyasse/morafeq/blob/master/Backend/src/ai/ai.service.ts): `Backend/src/ai/ai.service.ts`

### Administration

- [Moderation and dispute review](https://github.com/karimyasse/morafeq/blob/master/Backend/src/admin/admin.service.ts): `Backend/src/admin/admin.service.ts`
- [Relational data store](https://github.com/karimyasse/morafeq/blob/master/Backend/src/prisma/prisma.service.ts): `Backend/src/prisma/prisma.service.ts`

### Other components

- **Renters and hosts**
- **Administrators**

## Connections

- Renters and hosts → Role-based application: use
- Administrators → Role-based application: use
- Role-based application → Authentication: authenticate
- Role-based application → Listing discovery and detail: route to (evidence: `Frontend/src/App.jsx`)
- Role-based application → Review experience: route to (evidence: `Frontend/src/App.jsx`)
- Authentication → Relational data store: read and write (evidence: `Backend/src/auth/auth.service.ts`)
- Authentication → Renters and hosts: email codes (evidence: `Backend/src/auth/auth.service.ts`)
- Listing discovery and detail → Listing management and search: request listings
- Listing management and search → Search queries: delegate search
- Listing management and search → Review management: get listing reviews (evidence: `Backend/src/listings/listings.controller.ts`)
- Bookings and requests → Payments: payment handling
- Review experience → Review management: call review API (evidence: `Frontend/src/features/reviews/services/reviewsApi.js`)
- Review management → Relational data store: read and write (evidence: `Backend/src/reviews/reviews.service.ts`)
- Moderation and dispute review → Relational data store: read and write (evidence: `Backend/src/admin/admin.service.ts`)
- Moderation and dispute review → Dispute conversations: manage conversations
- AI housing assistant → Relational data store: read sessions (evidence: `Backend/src/ai/ai.controller.ts`)
- AI housing assistant → Relational data store: index listings (evidence: `Backend/src/ai/ai.controller.ts`)
