bvedad / hotelheroic-django

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

HotelHeroic

HotelHeroic is a Django application built for managing hotel operations and reservations.

Features

  • Reservation Management: Manage hotel reservations, including booking details, guest information, and room assignments.
  • Room Availability: Check room availability for specific dates and make new reservations.
  • Billing and Invoicing: Generate invoices for guests and handle billing transactions.
  • Reporting: Generate reports to analyze occupancy rates, revenue, and other key metrics.
  • User Management: Manage user accounts and assign roles and permissions.

Installation

  1. Clone the repository:

    git clone https://github.com/bvedad/hotelheroic-django.git
  2. Create a virtual environment and activate it:

    python3 -m venv env
    source env/bin/activate
  3. Install the Python dependencies:

    pip install -r requirements.txt
  4. Set up the database:

psql postgres -c "CREATE ROLE hh_role;"
psql postgres -c "CREATE USER hh_user WITH PASSWORD 'password' IN ROLE hh_role;"
psql postgres -c "CREATE DATABASE hh_db OWNER hh_role;"
psql postgres -c "CREATE SCHEMA hh_db;"
psql postgres -c "ALTER USER hh_user CREATEDB;"
  • Apply database migrations
python manage.py migrate
  1. Start the development server:

    python manage.py runserver

The application will be accessible at http://localhost:8000

Recompile CSS

To recompile SCSS files, follow this setup:

  1. Install tools
  • NodeJS 12.x or higher
  • Gulp - globally
    • npm install -g gulp-cli
  • Yarn (optional)
  1. Change the working directory to assets folder
$ cd apps/static/assets
  1. Install modules (this will create a classic node_modules directory)
$ npm install
// OR
$ yarn

  1. Edit & Recompile SCSS files
$ gulp

The generated files (css, min.css) are saved in static/assets/css directory.


Deployment

The app is provided with a basic configuration to be executed in Docker , Gunicorn, and Waitress.

Docker execution


The application can be easily executed in a docker container. The steps:

Get the code

$ git clone https://github.com/app-generator/priv-django-dashboard-volt-pro.git
$ cd hotelheroic-django

Start the app in Docker

$ sudo docker-compose pull && sudo docker-compose build && sudo docker-compose up -d

Visit http://localhost:85 in your browser. The app should be up & running.



Gunicorn 'Green Unicorn' is a Python WSGI HTTP Server for UNIX.

Install using pip

$ pip install gunicorn

Start the app using gunicorn binary

$ gunicorn --bind=0.0.0.0:8001 core.wsgi:application
Serving on http://localhost:8001

Visit http://localhost:8001 in your browser. The app should be up & running.


Waitress (Gunicorn equivalent for Windows) is meant to be a production-quality pure-Python WSGI server with very acceptable performance. It has no dependencies except ones that live in the Python standard library.

Install using pip

$ pip install waitress

Start the app using waitress-serve

$ waitress-serve --port=8001 core.wsgi:application
Serving on http://localhost:8001

Visit http://localhost:8001 in your browser. The app should be up & running.

Credits & Links

About

License:Other


Languages

Language:CSS 44.0%Language:Python 22.8%Language:SCSS 15.2%Language:HTML 14.5%Language:JavaScript 3.5%Language:Dockerfile 0.0%Language:Procfile 0.0%