# RavaHomes

RavaHomes is a real estate web platform and subsidiary of Rava. It connects tenants looking for rental properties with landlords who list them, while Rava staff oversee all platform activity through a dedicated admin panel.

## Tech Stack

- **Frontend:** HTML5, TailwindCSS
- **Backend:** PHP (procedural)
- **Database:** MySQL
- **Email:** PHPMailer (SMTP)

## User Roles

| Role | Capabilities |
|------|-------------|
| Tenant | Browse listings, save properties, submit rental applications, message landlords |
| Landlord | Post and manage properties, review and respond to applications, message tenants |
| Admin (Rava Staff) | Oversee all users, properties, and applications; manage staff accounts; configure site settings |

## Project Structure

```
ravahomes/
├── public/         # Web root — Apache/Nginx document root must point here
├── app/            # PHP logic, config, handlers — NOT web-accessible
├── templates/      # Reusable PHP partials (layout, components, emails)
├── database/       # SQL schema, seeds, and migrations
└── logs/           # Application log files — NOT web-accessible
```

## Local Setup

1. Clone the repo and navigate to `ravahomes/`
2. Copy `.env.example` to `.env` and fill in your credentials
3. Point your web server's document root to `ravahomes/public/`
4. Import `database/schema.sql` into your MySQL database
5. Optionally run `database/seeds.sql` to populate sample data
6. Install PHPMailer via Composer: `composer require phpmailer/phpmailer`

## Security Notes

- Never expose the `app/`, `templates/`, `database/`, or `logs/` directories to the web
- Never commit `.env` — it contains database and SMTP credentials
- All forms use CSRF tokens; all output is escaped; all DB queries use prepared statements
- File uploads are validated by MIME type and extension, renamed to hashes, and stored in `public/uploads/`
