Comprehensive documentation for installation, customization, and usage
Clone the repository to your local machine using Git:
git clone https://github.com/your-username/real_estate_dashboard.git
cd real_estate_dashboard
Install all required dependencies using npm:
npm install
Create a .env
file in the root directory with the following variables:
VITE_APP_TITLE=Dubai Real Estate Dashboard
VITE_API_URL=https://your-api-url.com
Note: For development purposes, the dashboard uses mock data by default. No API connection is required to test the functionality.
Run the development server to start working with the dashboard:
npm run dev
The application will be available at http://localhost:5173
by default.
When you're ready to deploy, build the production version:
npm run build
The built files will be in the dist
directory, ready to be deployed to your hosting provider.
The dashboard comes with pre-configured demo content to help you get started quickly.
The demo data is automatically loaded when you start the application. It includes:
To replace the demo data with your own:
src/utils
directorymockData.ts
- General dashboard datamockCommissionData.ts
- Commission-related datamockOffplanData.ts
- Off-plan construction dataTip: For production use, you should replace the mock data services with actual API calls. The structure of the mock data matches the expected API response format.
Use these credentials to log in to the demo dashboard:
Email: ahmed@example.com
Password: password123
This will log you in as an admin user with full access to all features.
The dashboard uses Tailwind CSS for styling. You can customize the theme by modifying the following files:
Edit tailwind.config.js
to change colors, fonts, and other design tokens:
/** @type {import('tailwindcss').Config} */
export default {
content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
theme: {
extend: {
colors: {
primary: {
DEFAULT: '#6366F1',
light: '#818CF8'
},
secondary: '#1F2937',
accent: {
DEFAULT: '#F59E0B',
light: '#FCD34D'
}
}
},
},
plugins: [],
};
Edit src/App.css
to modify CSS variables used throughout the application:
:root {
--primary: #6366F1;
--primary-light: #818CF8;
--secondary: #1F2937;
--accent: #F59E0B;
--accent-light: #FCD34D;
--success: #10B981;
--warning: #F97316;
--error: #EF4444;
--background: #F8FAFC;
--foreground: #1F2937;
--card: #FFFFFF;
--card-foreground: #374151;
--border: #E2E8F0;
--input: #F1F5F9;
--ring: #94A3B8;
--radius: 0.5rem;
}
The main dashboard layout is defined in src/components/layout/DashboardLayout.tsx
. You can modify this file to change the overall structure of the dashboard.
Customize the sidebar navigation in src/components/layout/Sidebar.tsx
:
const navigation = [
{ name: 'Dashboard', path: '/dashboard', icon: LayoutDashboard },
{ name: 'Properties', path: '/properties', icon: Building2 },
// Add or remove navigation items here
];
Modify the header in src/components/layout/Header.tsx
to change the top navigation bar.
Most UI components are in the src/components
directory, organized by feature:
src/components/properties
- Property-related componentssrc/components/clients
- Client management componentssrc/components/commission
- Commission calculation componentssrc/components/offplan
- Off-plan construction componentssrc/components/dashboard
- Dashboard overview componentssrc/components/reports
- PDF report generation componentssrc/components/commission
- Commission management componentsIndividual pages are in the src/pages
directory. Modify these files to change the content and layout of specific pages.
To add a new component:
src/components
src/types
Note: You can also download reports in the following pages : Dashboard , Property Evaluation , Property Calculator , Commision , Off-plan constructions plan
Note: The Download will be as .pdf file example is image below
Understanding the file structure will help you navigate and customize the dashboard effectively:
/src
/components # Reusable UI components
/auth # Authentication components
/clients # Client management components
/commission # Commission calculation components
/dashboard # Dashboard overview components
/layout # Layout components (sidebar, header)
/offplan # Off-plan construction components
/properties # Property management components
/reports # PDF report generators
/ui # Generic UI components
/contexts # React context providers
/hooks # Custom React hooks
/pages # Page components
/auth # Authentication pages
/services # API services
/store # Redux store configuration
/slices # Redux slices for state management
/types # TypeScript type definitions
/utils # Utility functions and mock data
App.css # Global CSS styles
App.tsx # Main application component
index.css # Tailwind CSS imports
main.tsx # Application entry point
File | Description |
---|---|
src/App.tsx |
Main application component with routing configuration |
src/components/layout/DashboardLayout.tsx |
Main layout for authenticated pages |
src/components/layout/Sidebar.tsx |
Sidebar navigation component |
src/contexts/AuthContext.tsx |
Authentication context provider |
src/utils/mockData.ts |
Mock data for dashboard elements |
tailwind.config.js |
Tailwind CSS configuration |
Warning: Deleting a property is permanent and cannot be undone. Make sure to confirm before proceeding.
The property form includes the following fields:
The client form includes the following fields:
The user form includes the following fields:
Note: Only administrators can add, edit, or delete users. Regular users will not have access to the Users page.
The Commission Management module provides tools for calculating and tracking real estate commissions in compliance with Dubai regulations.
Note: The Commission Management module implements Dubai Land Department (DLD) regulations, including RERA Form F requirements and anti-flipping rules.
The Off-Plan Construction module allows tracking of construction projects, milestones, and payment reminders.
The dashboard includes specialized tools for property valuation and investment analysis.
Tip: The Property Evaluator uses advanced algorithms based on Dubai market data to provide accurate valuations for different property types and locations.
The Dubai Real Estate Dashboard is built using a carefully selected set of modern libraries and frameworks to ensure optimal performance, maintainability, and developer experience.
Note: All libraries are regularly updated to ensure security and compatibility with the latest web standards.
The Dubai Real Estate Dashboard implements several sophisticated algorithms to provide accurate financial calculations and property valuations.
Location: This algorithm is implemented in src/utils/commissionCalculator.ts
. To replace or modify it, edit this file directly.
The commission calculation system implements Dubai Land Department (DLD) regulations for real estate commissions:
// Commission calculation algorithm
export const calculateCommission = (
unitPrice: number,
developer: string,
agentTier: 'standard' | 'gold' | 'platinum' = 'standard',
isWaterfront: boolean = false,
isBulkBuyer: boolean = false,
isVipClient: boolean = false,
resaleWithinYear: boolean = false
): CommissionCalculation => {
// Find developer rates
const developerRate = COMMISSION_RATES.find(rate =>
rate.developer.toLowerCase() === developer.toLowerCase()
);
// Calculate base commission
let baseRate = developerRate.baseCommission / 100;
const bonuses = [];
// Apply special conditions (waterfront, bulk buyer, VIP client)
// Apply agent tier bonuses
// Calculate gross commission
const baseCommission = unitPrice * (developerRate.baseCommission / 100);
const bonusAmount = bonuses.reduce((sum, bonus) => sum + bonus.amount, 0);
const grossCommission = baseCommission + bonusAmount;
// Apply anti-flipping rule (30% reduction if resold within 1 year)
let antiFlippingReduction = 0;
let finalGrossCommission = grossCommission;
if (resaleWithinYear) {
antiFlippingReduction = grossCommission * 0.3;
finalGrossCommission = grossCommission - antiFlippingReduction;
}
// Calculate VAT (5%)
const vat = finalGrossCommission * 0.05;
const totalPayable = finalGrossCommission + vat;
return {
unitPrice,
developer,
agentTier,
isWaterfront,
isBulkBuyer,
isVipClient,
baseCommission,
bonuses,
grossCommission: finalGrossCommission,
vat,
totalPayable,
antiFlippingReduction: resaleWithinYear ? antiFlippingReduction : undefined
};
};
Location: This algorithm is implemented in src/store/slices/evaluatorSlice.ts
in the calculateValuation
reducer. To replace it, modify this reducer function.
The property evaluator uses a sophisticated algorithm that considers multiple factors to determine property value:
// Property valuation algorithm
const calculateValuation = (state) => {
// Base price calculation based on property type and area
const baseRates = {
'Apartment': 1200,
'Villa': 1400,
'Townhouse': 1300,
'Penthouse': 1600
};
const baseRate = baseRates[state.propertyDetails.type] || 1200;
const initialBasePrice = baseRate * state.propertyDetails.area;
// Apply location multiplier
const locationMultiplier = LOCATION_MULTIPLIERS[state.propertyDetails.location] || 1.0;
// Apply condition multiplier
const conditionMultiplier = CONDITION_MULTIPLIERS[state.propertyDetails.condition] || 1.0;
// Apply view premium
const viewMultiplier = VIEW_MULTIPLIERS[state.propertyDetails.view] || 1.0;
// Apply age depreciation
const ageImpact = Math.max(-20, -state.propertyDetails.age * 0.5);
// Apply amenities bonus
const amenitiesImpact = state.propertyDetails.amenities.length * 2;
// Calculate final adjusted price with weighted factors
// Calculate confidence score based on data quality
return adjustedPrice;
};
Location: This algorithm is implemented in src/store/slices/calculatorSlice.ts
in the calculateResults
reducer. To replace it, modify this reducer function.
The property calculator implements investment analysis calculations:
// ROI calculation algorithm
const calculateROI = () => {
// Calculate loan amount
const calculatedLoanAmount = propertyPrice * (1 - downPayment / 100);
// Calculate monthly mortgage payment
const monthlyInterestRate = interestRate / 100 / 12;
const numberOfPayments = loanTerm * 12;
const calculatedMonthlyMortgage =
calculatedLoanAmount *
(monthlyInterestRate * Math.pow(1 + monthlyInterestRate, numberOfPayments)) /
(Math.pow(1 + monthlyInterestRate, numberOfPayments) - 1);
// Calculate monthly expenses
const monthlyPropertyTax = (propertyPrice * propertyTax / 100) / 12;
const monthlyInsurance = insurance / 12;
const monthlyMaintenance = (propertyPrice * maintenance / 100) / 12;
const totalMonthlyExpenses = monthlyPropertyTax + monthlyInsurance + monthlyMaintenance + utilities;
// Calculate monthly cash flow
const effectiveRent = monthlyRent * (1 - vacancyRate / 100);
const managementFee = effectiveRent * (propertyManagement / 100);
const calculatedMonthlyCashFlow = effectiveRent - managementFee - calculatedMonthlyMortgage - totalMonthlyExpenses;
// Calculate annual cash flow
const calculatedAnnualCashFlow = calculatedMonthlyCashFlow * 12;
// Calculate cash on cash return
const totalInvestment = (propertyPrice * (downPayment / 100)) + (propertyPrice * 0.03);
const calculatedCashOnCashReturn = (calculatedAnnualCashFlow / totalInvestment) * 100;
// Calculate cap rate
const netOperatingIncome = (effectiveRent - managementFee - totalMonthlyExpenses) * 12;
const calculatedCapRate = (netOperatingIncome / propertyPrice) * 100;
return {
loanAmount: calculatedLoanAmount,
monthlyMortgage: calculatedMonthlyMortgage,
monthlyExpenses: totalMonthlyExpenses,
monthlyCashFlow: calculatedMonthlyCashFlow,
annualCashFlow: calculatedAnnualCashFlow,
cashOnCashReturn: calculatedCashOnCashReturn,
capRate: calculatedCapRate
};
};
Location: This algorithm is implemented in src/pages/PaymentPlans.tsx
in the calculateMonthlyPayment
function. To replace it, modify this function.
The payment plan module calculates installment amounts and schedules:
// Payment plan calculation
const calculateMonthlyPayment = (plan) => {
const principal = plan.totalAmount - plan.downPayment;
const monthlyRate = plan.interestRate / 100 / 12;
const monthlyPayment = (principal * monthlyRate * Math.pow(1 + monthlyRate, plan.installments)) /
(Math.pow(1 + monthlyRate, plan.installments) - 1);
return monthlyPayment;
};
Note: All algorithms implement Dubai-specific real estate regulations and market practices, including DLD guidelines, RERA requirements, and standard industry calculations.
Replacing Algorithms: When replacing any algorithm, ensure that your new implementation maintains the same input and output structure to avoid breaking the UI components that depend on these calculations. If you need to change the data structure, you'll also need to update the corresponding UI components and type definitions.
This section provides instructions for deploying the Dubai Real Estate Dashboard to production environments.
Vercel is recommended for deploying this React application due to its simplicity and performance optimizations.
.env
filesnpm run build
locally to verify the build process works correctlynpm run build
(default)dist
(default)Vercel automatically sets up continuous deployment from your Git repository:
For production deployments, set the following environment variables in Vercel:
VITE_APP_TITLE
- Application titleVITE_API_URL
- Backend API URL (if applicable)Tip: Use Vercel's "Preview Environments" feature to create isolated environments for testing changes before deploying to production.