Skip to content

Repository files navigation

SoftStay

A full-stack apartment rental platform — Django REST Framework + React

Listings, search & filtering, booking lifecycle, reviews, and history — built as a portfolio project.

SoftStay

License: MIT Python Django React Tests

This is a demo/portfolio project, not a live commercial service. No real bookings or payments take place.

Contents

Features

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

Tech stack

Backend

Python Django DRF JWT MySQL SQLite Gunicorn Pytest

django-environ · django-filter · django-cors-headers · Pillow · PyMySQL · drf-spectacular · factory-boy · pytest-cov

Frontend

React Vite Tailwind React Router TanStack Query Axios

shadcn/ui (Radix UI) · React Hook Form · Zod · Framer Motion · Leaflet

Infrastructure

Docker Docker Compose Nginx

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.

Project structure

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.

Getting started

Backend

python -m venv venv
venv\Scripts\activate        # Windows
source venv/bin/activate     # macOS/Linux

pip install -r requirements.txt

Create .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 runserver

With 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 createsuperuser

Then open http://localhost:8000/admin/login/, log in, and open http://localhost:8000/api/schema/swagger-ui/ in the same browser tab.

Frontend

cd frontend
npm install
npm run dev

The dev server runs on http://localhost:5173 and expects the backend at http://localhost:8000 (configurable via frontend/.env.development).

Running with Docker

cp .env.example .env   # fill in production values, including BASIC_AUTH_USER/PASSWORD
docker compose build
docker compose up -d

This 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.

Testing

pytest
pytest --cov=apps --cov-report=term-missing   # with coverage

220 tests, 100% line coverage on apps/ (migrations and boilerplate excluded via .coveragerc).

License

MIT

About

A full-stack apartment rental platform — Django REST Framework + React Listings, search & filtering, booking lifecycle, reviews, and history — built as a portfolio project.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages