A full-stack AI-powered real estate application built with FastAPI (Python) backend and React (TypeScript) frontend.
./start_project.shThis will start both backend and frontend servers automatically.
- Python 3.13+
- Node.js 18+
- npm
-
Navigate to backend directory:
cd AI-Broker-backend/AI-Broker -
Create and activate virtual environment:
python3 -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
cp .env.example .env # Edit .env with your actual API keys -
Create database and migrate data:
python database.py python migrate_data.py
-
Start backend server:
python main.py
-
Navigate to frontend directory:
cd AI-broker-frontend -
Install dependencies:
npm install
-
Start development server:
npm run dev
- Frontend Application: http://localhost:8080 (or 8081)
- Backend API: http://localhost:8000
- API Documentation: http://localhost:8000/docs
The application uses SQLite for development with the following tables:
properties- Real estate property listingsusers- User informationtours- Scheduled property toursinquiries- User inquiries and messageschat_sessions- Chat conversation history
The database contains 904+ migrated property records with:
- Property details (name, description, address, price)
- Property features (bedrooms, baths, square footage)
- Images and embeddings for AI search
- Listing status and type information
# OpenAI Configuration
OPENAI_API_KEY=your_openai_api_key_here
# Email Configuration
EMAIL_PASSWORD=your_app_password_here
SENDER_EMAIL=your_email@gmail.com
# Database Configuration
DATABASE_URL=sqlite:///./real_estate.db
# Server Configuration
HOST=0.0.0.0
PORT=8000
# CORS Configuration
ALLOWED_ORIGINS=http://localhost:8080,https://yourdomain.com- FastAPI - Modern Python web framework
- SQLAlchemy - SQL toolkit and ORM
- OpenAI - AI integration for property search and chat
- LangChain - AI application framework
- Pydantic - Data validation
- Uvicorn - ASGI server
- React 18 - User interface library
- TypeScript - Type-safe JavaScript
- Vite - Build tool and dev server
- shadcn/ui - UI component library
- Tailwind CSS - Utility-first CSS framework
- React Query - Data fetching and caching
- Axios - HTTP client
real-estate/
├── AI-Broker-backend/
│ └── AI-Broker/
│ ├── main.py # FastAPI application
│ ├── database.py # Database models and setup
│ ├── models.py # Pydantic models
│ ├── migrate_data.py # Data migration script
│ ├── data.json # Property data
│ ├── requirements.txt # Python dependencies
│ ├── .env # Environment variables
│ └── venv/ # Virtual environment
├── AI-broker-frontend/
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── pages/ # Page components
│ │ ├── utils/ # Utility functions
│ │ └── lib/ # Library configurations
│ ├── package.json # Node.js dependencies
│ └── vite.config.ts # Vite configuration
├── start_project.sh # Automated startup script
└── README.md
- Environment variable configuration for sensitive data
- CORS protection with configurable origins
- Input validation with Pydantic models
- SQL injection protection with SQLAlchemy ORM
For production deployment:
- Update
ALLOWED_ORIGINSin.envto include your production domain - Use a production-grade database (PostgreSQL recommended)
- Set
NODE_ENV=productionfor frontend - Use reverse proxy (nginx) for serving static files
- Enable HTTPS with SSL certificates
- AI-Powered Search - Natural language property search using OpenAI
- Property Management - Complete CRUD operations for properties
- Tour Scheduling - Book property viewings with email confirmations
- Chat Interface - Interactive AI assistant for property inquiries
- Responsive Design - Mobile-friendly interface
- Real-time Updates - Live chat and property updates
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License.