How ahmedayman4/nawy works
This is a full-stack Egyptian real-estate discovery and AI-consultant platform. Users browse and filter listings, search in natural language, chat for location or compound insights, compare properties, and request price estimates; chat also supports history and evolving preferences. The README documents the main client-to-API relationship and the broader capabilities. Backend startup and several feature implementations are excerpted; frontend-to-API calls and some documented subsystems are not, so those links are omitted where no relationship is evidenced.
Main entry points: lifespan.py Runtime initialization · chat.py Location RAG chat · properties.py Semantic recommendations · main.py FastAPI gateway
Components 28
Web experience
- Browse listings
frontend/src/app/page.tsx - Consultant chat
frontend/src/app/chat/page.tsx - Compare properties
frontend/src/app/compare/page.tsx - Price predictor
frontend/src/app/predictor/page.tsx - Saved favorites
frontend/src/app/favorites/page.tsx - Chat history
frontend/src/app/history/page.tsx
API features
- FastAPI gateway
backend/main.py - Browse and filter
backend/routers/properties.py - Semantic recommendations
backend/routers/properties.py - Location RAG chat
backend/routers/chat.py - AI comparison
backend/routers/compare.py - Price prediction
backend/routers/predict.py - Request and response models
backend/schemas/models.py
AI and data services
- Runtime initialization
backend/core/lifespan.py - Runtime configuration
backend/core/config.py - Property dataset
- Property vector store
- Location vector store
- Groq language models
- Price model and encoder
Session state
- Preference and history helpers
backend/utils/helpers.py - MongoDB
- In-memory fallback
Data collection
- Location collection
01-nawy-scraping/location_data_collection/location_scrapper.py - Property collection
01-nawy-scraping/property_data_collection/nawy_scrapping.py - Property-finder collection
01-nawy-scraping/property_finder_collection/property_finder_scraping.py - Location processing
01-nawy-scraping/scratch/process_locations.py
Other components
- Property seeker
Connections 40
- Property seeker → Browse listings: searches listings
README.md - Property seeker → Consultant chat: asks questions
README.md - Property seeker → Compare properties: compares listings
README.md - Property seeker → Price predictor: estimates price
README.md - Property seeker → Saved favorites: saves listings
- Property seeker → Chat history: reviews chats
- FastAPI gateway → Browse and filter: routes requests
backend/main.py - FastAPI gateway → Semantic recommendations: routes requests
backend/main.py - FastAPI gateway → Location RAG chat: routes requests
backend/main.py - FastAPI gateway → AI comparison: routes requests
backend/main.py - FastAPI gateway → Price prediction: routes requests
backend/main.py - Runtime initialization → Property dataset: loads dataset
backend/core/lifespan.py - Runtime initialization → Property vector store: initializes store
backend/core/lifespan.py - Runtime initialization → Location vector store: initializes store
backend/core/lifespan.py - Runtime initialization → Groq language models: initializes models
backend/core/lifespan.py - Runtime initialization → Price model and encoder: loads artifacts
backend/core/lifespan.py - Runtime initialization → MongoDB: connects client
backend/core/lifespan.py - Runtime initialization → Runtime configuration: reads URI
backend/core/lifespan.py - Runtime initialization → In-memory fallback: initializes fallback
backend/core/lifespan.py - Browse and filter → Property dataset: filters rows
backend/routers/properties.py - Semantic recommendations → Property vector store: searches similar
backend/routers/properties.py - Semantic recommendations → Property dataset: filters results
backend/routers/properties.py - Semantic recommendations → Groq language models: generates filters
README.md - Semantic recommendations → Preference and history helpers: cleans generated code
backend/routers/properties.py - Location RAG chat → Preference and history helpers: loads history
backend/routers/chat.py - Location RAG chat → Preference and history helpers: updates preferences
backend/routers/chat.py - Location RAG chat → Location vector store: retrieves context
backend/routers/chat.py - Location RAG chat → Groq language models: rewrites and answers
backend/routers/chat.py - Location RAG chat → Semantic recommendations: delegates property search
backend/routers/chat.py - AI comparison → Property dataset: reads specifications
backend/routers/compare.py - AI comparison → Location vector store: retrieves locations
backend/routers/compare.py - AI comparison → Groq language models: synthesizes comparison
backend/routers/compare.py - Price prediction → Price model and encoder: predicts price
backend/routers/predict.py - Price prediction → Property dataset: reads price statistics
backend/routers/predict.py - Preference and history helpers → MongoDB: reads and writes
backend/utils/helpers.py - Preference and history helpers → In-memory fallback: falls back to
backend/utils/helpers.py - Browse and filter → Request and response models: validates payloads
backend/routers/properties.py - Location RAG chat → Request and response models: validates payloads
backend/routers/chat.py - AI comparison → Request and response models: validates payloads
backend/routers/compare.py - Price prediction → Request and response models: validates payloads
backend/routers/predict.py