Skip to content

A Django-based web application for managing camping site reservations. The system features dynamic user forms, real-time pricing calculations, population and occupancy tracking, and the ability to generate reservation details as PDFs with QR codes. Includes full user authentication, Celery for background tasks, and Docker support for deployment.

Notifications You must be signed in to change notification settings

vic-cieslak/campsite-manager

Repository files navigation

Reservation System and Landing Page

Built with Cookiecutter Django Black code style

Overview

This project is a Django-based web application designed for managing reservations and providing a landing page for a camping site. It allows users to reserve camping spots, view current occupancy, and download reservation PDFs. The project includes real-time price calculation during reservation, population monitoring, and QR code generation. Screenshot from 2024-09-26 08-33-30

Create reservation flow, reservation management and PDF generation

Screencast.from.2024-09-26.08-36-00.mp4

Django Unfold Admin Panel backend

Screencast.from.2024-09-26.08-36-46.mp4

Features

  • User Management

    • User registration, login, and profile management.
    • Secure views for updating user information.
  • Reservation System

    • Create, view, and cancel reservations with real-time occupancy and population data tracking.
    • Generate PDFs of reservation details, including a QR code for on-site check-in.
    • Dynamic Reservation Form:
      • Users can input personal details, select dates, and specify the number of adults, children, and animals.
      • Additional options such as selecting a tent, caravan, electricity, and extras.
      • Increment/decrement buttons for selecting quantities (e.g., number of adults or children).
      • Date selection with a calendar picker.
      • Real-time pricing calculation that updates dynamically based on user selections, displayed in a floating price summary.
    • Automatic calculation of guests, including children and extra people.
  • Occupancy Tracking

    • Real-time population monitoring with thresholds for low, medium, and high occupancy levels.
    • View historical population data for up to 30 days.
  • PDF and QR Code Generation

    • Reservation summaries are exportable as PDFs with dynamically generated QR codes for easy check-in.
    • Support for multi-language PDFs, including Polish.
  • Dashboard

    • Admin view for monitoring daily and future camping site occupancy.

Screenshots

Screenshot of Reservation Form obraz

Screenshot of Occupancy Tracking obraz

Settings

Moved to settings.

Basic Commands

Setup local env

create .envs for .postgres and .django in .envs/.local:

.django

```bash


# General
# ------------------------------------------------------------------------------
USE_DOCKER=yes
IPYTHONDIR=/app/.ipython
# Redis
# ------------------------------------------------------------------------------
REDIS_URL=redis://redis:6379/0

# Celery
# ------------------------------------------------------------------------------

# Flower
CELERY_FLOWER_USER=debug
CELERY_FLOWER_PASSWORD=debug
```

.postgres

```bash
# PostgreSQL
# ------------------------------------------------------------------------------
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_DB=campsitemanager
POSTGRES_USER=debug
POSTGRES_PASSWORD=debug
```

Start containers:

$ docker compose -f local.yml up --build

Access 127.0.0.1:8000 to access local web instance.

Setting Up Your Users

  • To create a normal user account, just go to Sign Up and fill out the form. Once you submit it, you'll see a "Verify Your E-mail Address" page. Go to your console to see a simulated email verification message. Copy the link into your browser. Now the user's email should be verified and ready to go.

  • To create a superuser account, use this command:

    $ python manage.py createsuperuser

For convenience, you can keep your normal user logged in on Chrome and your superuser logged in on Firefox (or similar), so that you can see how the site behaves for both kinds of users.

Type Checks

Running type checks with mypy:

$ mypy campsitemanager

Test Coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

$ coverage run -m pytest
$ coverage html
$ open htmlcov/index.html

Running Tests with pytest

$ pytest

Live Reloading and Sass CSS Compilation

Moved to Live reloading and SASS compilation.

Celery

This app comes with Celery.

To run a celery worker:

cd campsitemanager
celery -A config.celery_app worker -l info

To run periodic tasks, start the celery beat scheduler service:

cd campsitemanager
celery -A config.celery_app beat

Alternatively, embed the beat service inside a worker (not recommended for production use):

cd campsitemanager
celery -A config.celery_app worker -B -l info

Deployment

Docker

Refer to the cookiecutter-django Docker documentation for detailed deployment instructions.


This README integrates all the new features, along with your original content, in a cohesive manner. Let me know if you need further changes!

About

A Django-based web application for managing camping site reservations. The system features dynamic user forms, real-time pricing calculations, population and occupancy tracking, and the ability to generate reservation details as PDFs with QR codes. Includes full user authentication, Celery for background tasks, and Docker support for deployment.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published