PropertySphere is a modern Property Management System built with ASP.NET Core, RavenDB, and a lightweight React frontend. It demonstrates RavenDB’s advanced features — GenAI integration, AI Agents, Spatial Indexing, Dynamic Indexing, Data Subscriptions, and Time Series — to deliver an intelligent, real‑time experience for renters and property managers.
Talk to your Telegram bot (replace with your bot’s handle). Try prompts like:
- "What were my utility charges last month?"
- "What’s my balance right now?"
- "Can you charge my card for pending rent?"
- "I need maintenance to fix a leaky faucet." (you can attach a JPG)
- "Any open service requests still pending?"
The bot can show balances, accept payments, open and track service requests, and react to photo uploads.
-
AI‑Powered Renter Assistant: Telegram bot that lets renters report issues, check balances, and pay rent with natural language.
-
Intelligent Maintenance (GenAI): Upload a photo (JPG) and a GenAI ETL generates a concise, actionable description for maintenance.
-
Billing: Friendly flow for reviewing and paying outstanding debt items.
-
Real‑time Notifications: RavenDB Subscriptions notify renters on analysis results and workflow updates.
-
Location‑Aware: Spatial indexes enable querying by property/service-request locations.
-
Financial Tracking: Debt items, payments, and utility usage with allocations.
- .NET 8 SDK
- RavenDB 7.1+ (local or RavenDB Cloud)
- OpenAI API Key (required for AI features)
- Telegram Bot Token (required for chat interface)
- Create a bot via @BotFather →
/newbot
- Create a bot via @BotFather →
- Open RavenDB Studio (usually http://localhost:8080).
- Create a database named
PropertySphere.
Use appsettings.Development.json (recommended for local dev):
{
"RavenDb": {
"Url": "http://localhost:8080",
"Database": "PropertySphere"
},
"Telegram": {
"BotToken": "YOUR_TELEGRAM_BOT_TOKEN_HERE"
},
"AI_API_KEY": "YOUR_OPENAI_API_KEY_HERE"
}Alternatively, set environment variables (PowerShell):
$env:AI_API_KEY = "sk-proj-..." # OpenAI key (enables AI Agent & GenAI)
$env:Telegram__BotToken = "123456:ABC-DEF" # Telegram bot token (note: double underscore)Notes
- If
AI_API_KEYis not set, AI Agent and GenAI tasks are skipped.- If
Telegram:BotTokenis missing, the app runs but the Telegram polling service stays disabled.
Or use .NET User Secrets (recommended for local dev):
# Run in the project folder (contains PropertySphere.csproj)
dotnet user-secrets set "AI_API_KEY" "sk-proj-..."
dotnet user-secrets set "Telegram:BotToken" "123456:ABC-DEF"User Secrets are loaded automatically in Development (see Properties/launchSettings.json) because this project already defines a UserSecretsId in PropertySphere.csproj.
dotnet restore- Open Command Palette → “Tasks: Run Task”.
- Choose Run PropertySphere (or Watch PropertySphere for hot reload).
dotnet run --project .\PropertySphere.csproj
# Hot reload
dotnet watch run --project .\PropertySphere.csprojApp URL: http://localhost:5000 (serves the React frontend from wwwroot/).
To explore the app with realistic data and link your Telegram account:
- Get your Telegram Chat ID: chat with @userinfobot and copy the numeric ID.
- Use the VS Code task Generate Demo Data (you’ll be prompted for the Chat ID), or run:
Invoke-RestMethod -Uri "http://localhost:5000/api/datageneration/generate-data?telegramChatId=YOUR_CHAT_ID" -Method POST
# curl alternative
curl -X POST "http://localhost:5000/api/datageneration/generate-data?telegramChatId=YOUR_CHAT_ID"Once generated, start chatting with your bot. Try “Hello” or “I have a leak in my kitchen”.
We configure a RavenDB AI Agent to answer renter questions using RAG over your RavenDB data (leases, debts, payments, utilities): looks up relevant documents, formats helpful responses, and exposes tool actions like creating service requests or charging a stored card.
- Code:
services/PropertyAgent.cs - Flow: Telegram → RavenDB Agent → Queries/Actions → Reply + follow‑ups
When a renter uploads a JPG via Telegram, the image is stored as an attachment on a Photo document. A GenAI task processes it and writes a concise description back to the document.
- Code:
services/PropertyDescriptionGenerator.cs - Mechanism:
GenAiConfiguration+ prompt → OpenAI model → updatesDescription
Subscriptions react after the GenAI description is saved, notifying the renter via Telegram with context.
- Code:
services/PhotoSubscription.cs - Query: all
PhotoswhereDescription != null
We index service requests with geospatial fields for property‑centric queries.
- Code:
Indexes/ServiceRequests_ByStatusAndLocation.cs - Example (C#):
Map = requests => from sr in requests
let property = LoadDocument<Property>(sr.PropertyId)
select new {
Location = CreateSpatialField(property.Latitude, property.Longitude)
};Utility usage (Water, Power) for each unit is stored as RavenDB Time Series and queried for billing and graphs.
- Ingest: demo generator writes hourly usage
- Query: AI Agent can request time‑bounded aggregations for renter units
- Quickstart:
QUICKSTART.md - Overview:
SUMMARY.md




