A full-stack apartment rental platform — Django REST Framework + React
Listings, search & filtering, booking lifecycle, reviews, and history — built as a portfolio project.
This is a demo/portfolio project, not a live commercial service. No real bookings or payments take place.
| Authentication | JWT-based registration and login with two roles: Tenant and Lessor |
| Listings | Full CRUD, up to 5 photos per listing with cover photo selection, soft delete, active/inactive toggle |
| Search & filtering | Keyword search, filter by city, district, price range, room count, property type; sorting by price, date, popularity; pagination |
| Booking | Full lifecycle (pending → confirmed/rejected → checked-in), overlap detection, cancellation window, role-based permissions |
| Reviews & ratings | One review per completed stay, cached average rating and count on the listing |
| Search & view history | Per-user history, aggregated "popular searches" and "trending listings" endpoints |
| Account deletion | Self-service, password-confirmed, anonymizes the account instead of cascading deletes |
| API documentation | Swagger UI and ReDoc via drf-spectacular |
|
Backend django-environ · django-filter · django-cors-headers · Pillow · PyMySQL · drf-spectacular · factory-boy · pytest-cov |
Frontend shadcn/ui (Radix UI) · React Hook Form · Zod · Framer Motion · Leaflet |
|
Infrastructure Nginx reverse-proxies the API and Django admin, serves the React build and static/media files, and gates the demo deployment behind HTTP Basic Auth. | |
apps/ Django apps: users, listings, bookings, reviews, history
config/ Django settings, URLs, WSGI/ASGI entry points
frontend/ React application (Vite)
docker/ Dockerfiles and Nginx configuration
docker-compose.yml
requirements.txt
Each Django app follows the same internal layout: models/, serializers/, views/, urls/, services/ (business logic separated from views), plus filters/, permissions/, or signals/ where relevant.
python -m venv venv
venv\Scripts\activate # Windows
source venv/bin/activate # macOS/Linux
pip install -r requirements.txtCreate .env.dev in the project root with at least:
SECRET_KEY=dev-only-key-change-me
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:5173
MYSQL=False
Then:
python manage.py migrate
python manage.py runserverWith MYSQL=False the backend uses SQLite — no database server needed to get started. Set MYSQL=True and add DB_NAME/DB_USER/DB_PASSWORD/DB_HOST/DB_PORT to run against MySQL instead.
API docs (staff only — see below): http://localhost:8000/api/schema/swagger-ui/
To view the API docs, create a staff account and log in via the Django admin session first:
python manage.py createsuperuserThen open http://localhost:8000/admin/login/, log in, and open http://localhost:8000/api/schema/swagger-ui/ in the same browser tab.
cd frontend
npm install
npm run devThe dev server runs on http://localhost:5173 and expects the backend at http://localhost:8000 (configurable via frontend/.env.development).
cp .env.example .env # fill in production values, including BASIC_AUTH_USER/PASSWORD
docker compose build
docker compose up -dThis starts MySQL, the Django backend (gunicorn), and Nginx serving the React build and proxying /api/ and /admin/ to the backend. See docker-compose.yml and docker/nginx.conf for details.
pytest
pytest --cov=apps --cov-report=term-missing # with coverage220 tests, 100% line coverage on apps/ (migrations and boilerplate excluded via .coveragerc).