DEV Community

CristianZArellano
CristianZArellano

Posted on

🍽️ Building ReservaFlow: A Django + Celery + Redis Reservation System

πŸ‘‹ Hi everyone! I'm Cristian, a Python backend developer, and I'm excited to share one of my latest projects: ReservaFlow.

ReservaFlow is a restaurant reservation management system designed to handle real-world scenarios like reservation expiration, double-booking prevention, and async notifications. I'm building it using a modern Django backend stack.


πŸ“ A Note on This Project

This project is currently under active development. My main goal with ReservaFlow is to dive deep into backend architecture and gain hands-on experience by combining several powerful technologies. The idea is to fully implement and get the benefits of using Celery for async tasks, Redis for distributed locking, and Docker for a production-ready environment.

I’m taking a step-by-step approach to build this system. As part of my process, I've been experimenting with uv for dependency management. While I'm still evaluating how well it works for team collaboration, I've been really impressed by its speed and performance so far!


πŸš€ Tech Stack

  • Django 5 + Django REST Framework (DRF) β†’ Clean and modular API
  • PostgreSQL β†’ Relational database
  • Celery + Redis β†’ Async tasks & distributed locking
  • Docker & Docker Compose β†’ Production-ready containerization
  • uv β†’ Modern Python dependency management

πŸ”‘ Key Features

  • Online reservation system with pending/confirmed/expired states
  • User authentication and customer management
  • Restaurant & table management
  • Reservation expiration handled with Celery scheduled tasks
  • Email notifications (confirmation + reminders) via async workers
  • Redis-powered distributed lock to prevent double bookings
  • Caching with Redis for faster table availability checks
  • Django Admin panel for full control

πŸ“‚ Project Structure

restaurant-reservations/
β”œβ”€β”€ config/           # Project-level settings and URLs
β”œβ”€β”€ customers/        # Customer management
β”œβ”€β”€ notifications/    # (WIP) Notification handling
β”œβ”€β”€ reservations/     # Reservation core logic
β”œβ”€β”€ restaurants/      # Restaurant and tables
Enter fullscreen mode Exit fullscreen mode


`


⚑ Key Design Decisions

  • Asynchronous tasks: Reservation expiration and email notifications are processed by Celery workers so the API stays responsive.
  • Distributed locking with Redis: To prevent two users from booking the same table at the same time, I added a Redis lock service. If the lock is held, the API returns a 423 Locked error.
  • Caching: Table availability checks first query Redis before hitting the database, improving performance.

πŸ“¬ API Example

Create a Reservation

http
POST /api/reservations/

Request body:

json
{
"restaurant_id": 1,
"customer_id": 1,
"table_id": 1,
"reservation_date": "2025-08-30",
"reservation_time": "19:00:00",
"party_size": 2
}

Response:

json
{
"id": "new-uuid-of-reservation",
"status": "pending",
"expires_at": "2025-08-30T18:50:00Z",
"message": "Reservation created successfully"
}


πŸ› οΈ Local Setup

To get the project running locally, you can clone the repository and follow these steps:

bash
git clone https://github.com/CristianZArellano/ReservaFlow.git
cd ReservaFlow/restaurant-reservations
uv sync
uv run python manage.py migrate
uv run python manage.py runserver

Or run everything with Docker:

bash
docker-compose up --build


🎯 What’s Next?

  • Define and implement the Notification model
  • Improve automated testing with pytest
  • Deploy a live demo

πŸ‘¨β€πŸ’» About Me

I’m Cristian Z. Arellano, a backend developer passionate about building scalable APIs with Python and Django.

You can find the full project on my GitHub: CristianZArellano


✨ Thanks for reading! I'd love to hear feedback from other Django and backend devs β€” what would you improve or add?

`


`

Top comments (0)