Restaurant Management System
The project is a restaurant order management system that allows efficient organization of staff workflows, control of product and dish inventory, and processing of orders from guests and employees. The system is implemented using modern technologies such as FastAPI for the backend, PostgreSQL for the database, and Docker for containerization.
- Programming Language: Python
- Framework: FastAPI (asynchronous)
- Database: PostgreSQL
- Containerization: Docker
- Dependency Management Tools: Poetry
- User Interfaces: Web application and integration with Telegram
- Administrator
- Chef
- Bar
- Kitchen
- Staff
- Guest
- Adds products for dish preparation (table "Products" includes name, caloric content, unit of measurement).
- Creates dishes (table "Dishes" is expandable. Each entry has properties: composition (linked to products), caloric content per serving (calculated based on the products table), photo, available quantity in stock).
- Creates and edits the list of dishes for the "Permanent Menu" that rarely changes.
- Creates and edits the list of dishes for the "Daily Menu" for a week ahead.
- Creates and edits the list of dishes for the "Buffet Menu" for a week ahead.
- Receives a summary table of orders for the next day.
- Forms kitchen orders for the preparation of a list of dishes with calculated quantities of necessary products.
- Receives/edits reports on product and production balances.
- Generates reports on completed orders.
- Generates reports on the number of meals purchased and calculates compensation from the enterprise.
- Creates and edits the list of dishes for each menu.
- Selects orders for the next day from the available menu in the application (positions and quantities).
- Generates a QR code from the application for quick identification and ordering at the bar.
- Selects orders from the available menu.
- Generates a QR code from the application for quick ordering at the bar.
- Scans the user's QR code or reads the pass and receives information about their order.
- Creates/edits the user's order (staff/guest).
- Tops up the staff account by indicating the paid amount.
- Confirms the order for fulfillment if the user's balance is positive.
- Receives payment (cash or card) if the user's balance is insufficient, updates the user's balance, and confirms the order for fulfillment.
- Prints a receipt with order information.
- Views orders from the chef for dish preparation (name, quantity).
- Receives information about order issuance.
- Marks the order as OK after issuance.
- Prints a receipt with items to be issued (result of the confirmed order at the restaurant reception).
- Touchscreen terminal at reception
- Touchscreen terminal in the kitchen
- Receipt printer at reception
- Receipt printer in the kitchen
- Each menu has its own history of position and price changes.
- Date, time, user, order, status
Create your own .env file based on deploy/env-examples with your variables.
LOCAL DEVELOPMENT
- Git repository: https://github.com/Dishalex/Rest, default branch
dev - Each developer creates their own branches from
devand updates them throughmerge. Branch naming convention:usernamefor permanent branches,username-featurefor temporary branches, which are deleted after merging. - Merge to
devonly throughpull-request. - Python >=3.10, <=3.12
- Poetry
.cmdscripts for Windows..shscripts for Linux and Mac.- The root Git project contains several independent subprojects:
- BACKEND
- FRONTEND
- DATABASE
- Each subproject is an independent product and has its own Docker.
- They communicate through a shared database, which can be local (Docker) or remote (elephantsql) during development.
- Environment variable settings are shared in the
/deploy/.envfile. Local development uses only the relative path to this file. - Security: Each Docker container takes only the necessary settings from the
.envfile, not the entire file. Place the.envfile outside the Docker container. - FRONTEND and BACKEND each have their own virtual environment managed by Poetry.
cd FRONTEND
poetry shell
poetry update
cd BACKEND
poetry shell
poetry update
If using VS Code Workspace, add subprojects to it (File->Add folder to Workspace). When launching the terminal, specify the directory.
scripts/docker_db.cmd
Database data will be created in Database/postgres-data/ (excluded from Git).
To stop the database:
scripts/docker_db_stop.cmd
cd BACKEND
uvicorn src.main --reload
cd BACKEND
poetry export --without-hashes > requirements.txt
scripts/gen_req_txt.cmd
cd FRONTEND/cafe
python manage.py migrate
scripts/docker_app_run.cmd
- git checkout dev
- git pull
- cd FRONTEND
- poetry shell
- poetry update
- cd ..
- cd scripts
- docker_db.cmd - run DB local docker, skip if remote used postgres
- migrate_dev_app.cmd - migrate DB
- run_dev_app.cmd - run app
- open browser: http://127.0.0.1:8000