cyi1341 031e309cb0 | ||
---|---|---|
static | ||
templates | ||
Dockerfile | ||
README.md | ||
app.py | ||
archive.zip | ||
base.sql | ||
fly.toml | ||
requirements.txt | ||
system_platform.md |
README.md
POS System Documentation
Overview
This is a web-based point of sale (POS) system for a sports store called Marathon Sports. It is built using Python Flask and SQLite.
The system has the following features:
- Staff login
- Product search and sale
- Member registration
- View member list
- View product stocks
- View order history
Folder Structure
pos-hw
├── app.py
├── base.sql
├── Dockerfile
├── fly.toml
├── requirements.txt
├── icons
├── static
│ ├── layout.css
│ ├── manifest.json
│ ├── member_form.css
│ ├── order_history.css
│ ├── pos.css
│ ├── serviceworker.js
│ ├── stocks.css
│ └── style.css
└── templates
├── index.html
├── layout.html
├── member_form.html
├── members_list.html
├── order_history.html
├── pos.html
└── stocks.html
Main Files
app.py
: The main Flask applicationbase.sql
: SQLite database schema and initial datarequirements.txt
: Python dependenciesDockerfile
: For containerizing the appfly.toml
: Fly.io configurationstatic/
: Folder containing CSS stylesheetstemplates/
: Folder containing HTML templates
Key Functions
app.py
login()
: Login page and authenticationpos()
: Main POS page to search/add productsadd_to_order()
: Add product to current orderfinalize_order()
: Finalize ordermember_form()
: Display new member registration formsubmit_member_form()
: Submit new member formmembers_list()
: Display list of membersstocks()
: View product stocksorder_history()
: View past orders
Frontend Components
The main frontend pages and their purposes:
index.html
: Login pagelayout.html
: Base layoutpos.html
: Main POS interfacemember_form.html
: New member registration formmembers_list.html
: Display members liststocks.html
: Display product stocksorder_history.html
: Display past orders
Styling and JavaScript
Most pages use a common layout.css
stylesheet for styling navbar and sidebar components. Additional stylesheets exist for individual pages.
Custom JavaScript exists in pos.js
to:
- Dynamically add/update products in current order
- Communicate with backend to add to order
- Display errors