How josejimenez-m/real-estate-listing-and-rental-system works
Project type and purpose
• This is a full‑stack real estate listing and rental web application.
• Frontend: PHP templates (index.php, pages/*.php) with AJAX/JavaScript (ES6+).
• Backend: PHP 8.x REST‑style endpoints, MySQL database, file storage for agreements.
• External integration: Payment gateway for booking deposits, real‑time notifications.
File structure
• Top level:
– README.md, project assets (drawio, presentation)
– config/db.php → central database connection
– includes/header.php & footer.php → layout templates
– index.php, logout.php → entry points
– pages/ → one PHP file per feature (login, register, CRUD on properties, messaging, search, uploads)
– uploads/ → PDF lease agreements
– real_estate_db.sql → schema
• No separate “api” folder: each pages/*.php acts as a handler. AJAX calls target these scripts.
• config folder holds environment configuration.
• SQL file reveals tables for users, properties, messages, bookings.
README for additional insights
• Lists key features: authentication, CRUD listings, advanced filters, messaging, secure payments, AJAX real‑time search, notifications.
• Technological stack: PHP 8.x, MySQL, JavaScript, AJAX, REST.
a. Main components
1. Browser Client (UI)
– Renders PHP templates, runs AJAX/ES6 for dynamic updates.
2. PHP Application Server
– Routing & Controllers (pages/*.php)
– Includes modules:
• Authentication Service
• Property Management Service
• Messaging Service
• File Upload/Storage Service
• Payment Processing Module
• Notification Dispatcher
– Shared configuration (config/db.php)
– Layout engine (includes/header, footer)
3. MySQL Database
– Tables: users, properties, messages, bookings, payments, etc.
4. File Storage
– uploads/ directory for lease agreement PDFs
5. External Payment Gateway
– Third‑party API for processing deposits
6. (Optional) Notification Service
– Email or push service for alerts on new inquiries/listings
b. Relationships and interactions
• Browser ↔ PHP Server: HTTPS requests & AJAX calls
• Server ↔ Database: SQL queries via config/db.php
• Server ↔ File Storage: Read/write PDF agreements
• Server ↔ Payment Gateway: API calls (REST)
• Server ↔ Notification Service: SMTP or push API
c. Architectural patterns and design principles
• Layered architecture:
– Presentation Layer (PHP templates + JS)
– Application Layer (controllers/services)
– Data Layer (MySQL + filesystem)
• Modularization by feature (each page script corresponds to a service)
• REST‑style endpoints for AJAX interactivity
• Separation of concerns via includes (header/footer) and config
• Single database connection managed centrally
d. Key technologies/frameworks
• PHP 8.x (server‑side scripting)
• MySQL (relational database)
• AJAX / JavaScript ES6+ (client interactivity)
• REST API conventions
• File system (uploads folder)
• External payment API (e.g., Stripe/PayPal)