How kimaniroy0/property-management-analytics works
Estate Analytics is a property-management portal for tracking properties, units, tenants, rent, expenses, reports, and M-Pesa collections. Users authenticate, enter an authenticated dashboard, manage operational records, and review month-based performance; M-Pesa payments are recorded after Safaricom confirms them. The graph follows the documented browser/API/database and payment flows. Some component-to-context and route-to-server relationships are supported by the source index; unsampled implementation details are not inferred.
Main entry points: App.tsx App and routing · PropertyContext.tsx Dashboard state · stkpush.ts STK Push route · dashboard.ts Dashboard API route
Components 28
Web experience
- App and routing
src/App.tsx - Sign-in and sign-up
src/components/auth
Property operations
- Dashboard state
src/context/PropertyContext.tsx - Performance dashboard
src/components/dashboard/DashboardView.tsx - Property management
src/components/properties/PropertiesView.tsx - Unit management
src/components/units/UnitsView.tsx - Tenant management
src/components/tenants/TenantsView.tsx - Payment records
src/components/payments/PaymentsView.tsx - Expense tracking
src/components/expenses/ExpensesView.tsx - Financial reports
src/components/reports/ReportsView.tsx - Dashboard API client
src/lib/dashboardApi.ts
Identity and API
- Neon Auth client
src/lib/auth.ts - Dashboard API route
api/dashboard.ts - Property and payment routes
api - JWT and user DB
src/server/authenticatedDb.ts - Request protection
src/server/requestProtection.ts - Database connection
src/lib/db.ts
Rent collection
- M-Pesa collection UI
src/components/mpesa/MpesaView.tsx - STK Push modal
src/components/modals/MpesaModal.tsx - M-Pesa API client
src/lib/mpesaApi.ts - STK Push route
api/mpesa/stkpush.ts - Payment status route
api/mpesa/status.ts - Payment callback route
api/mpesa/callback.ts - STK request processing
src/server/mpesa.ts - Daraja integration
src/server/daraja.ts
Other components
- Property manager
- PostgreSQL
- Safaricom Daraja
Connections 42
- Property manager → App and routing: uses
src/App.tsx - App and routing → Sign-in and sign-up: shows auth
src/App.tsx - Sign-in and sign-up → Neon Auth client: authenticates with
src/components/auth/SignInView.tsx - App and routing → Dashboard state: provides state
src/App.tsx - App and routing → Performance dashboard: routes to
src/App.tsx - App and routing → Property management: routes to
src/App.tsx - App and routing → Unit management: routes to
src/App.tsx - App and routing → Tenant management: routes to
src/App.tsx - App and routing → Payment records: routes to
src/App.tsx - App and routing → M-Pesa collection UI: routes to
src/App.tsx - App and routing → Expense tracking: routes to
src/App.tsx - App and routing → Financial reports: routes to
src/App.tsx - Performance dashboard → Dashboard state: reads KPIs
src/components/dashboard/DashboardView.tsx - Property management → Dashboard state: manages records
src/components/properties/PropertiesView.tsx - Unit management → Dashboard state: manages records
src/components/units/UnitsView.tsx - Tenant management → Dashboard state: manages records
src/components/tenants/TenantsView.tsx - Payment records → Dashboard state: manages records
src/components/payments/PaymentsView.tsx - Expense tracking → Dashboard state: manages records
src/components/expenses/ExpensesView.tsx - Financial reports → Dashboard state: reads records
src/components/reports/ReportsView.tsx - Dashboard state → Neon Auth client: gets token
src/context/PropertyContext.tsx - Dashboard state → Dashboard API client: loads data
src/context/PropertyContext.tsx - Dashboard API client → Dashboard API route: requests dashboard
README.md - Dashboard API route → JWT and user DB: verifies user
api/dashboard.ts - Dashboard API route → Request protection: checks requests
api/dashboard.ts - Dashboard API route → PostgreSQL: reads and writes
README.md - JWT and user DB → Database connection: uses pool
src/server/authenticatedDb.ts - Database connection → PostgreSQL: connects
README.md - Property and payment routes → JWT and user DB: verifies user
api/payments.ts - Property and payment routes → Request protection: checks requests
api/payments.ts - M-Pesa collection UI → M-Pesa API client: requests status
src/components/mpesa/MpesaView.tsx - STK Push modal → M-Pesa API client: starts payment
src/components/modals/MpesaModal.tsx - M-Pesa API client → STK Push route: initiates push
README.md - M-Pesa API client → Payment status route: checks status
README.md - STK Push route → JWT and user DB: verifies user
api/mpesa/stkpush.ts - STK Push route → Request protection: checks requests
api/mpesa/stkpush.ts - STK Push route → Daraja integration: sends push
api/mpesa/stkpush.ts - Payment status route → Daraja integration: reconciles status
api/mpesa/status.ts - STK Push route → STK request processing: stores request
api/mpesa/stkpush.ts - Payment callback route → STK request processing: completes payment
api/mpesa/callback.ts - STK request processing → PostgreSQL: records payment
README.md - Daraja integration → Safaricom Daraja: calls API
README.md - Safaricom Daraja → Payment callback route: confirms payment
README.md