Lotus POS is a desktop Point of Sale system designed for small and medium-sized businesses. It allows you to manage sales, inventory, pricing, and database configuration in a simple way.
The POS software is designed for being "offline-first", ensuring the system remains operational even when internet connectivity fails, and does not depend on it.
If electronic invoicing software/service is used and an invoice cannot be approved immediately, the sale is marked as "pending" in the sales record, and all necessary data to generate the invoice is saved. Later, pending invoices can be resent if desired, ensuring the business’s fiscal integrity.
- Python: Core language.
- PySide6: For the desktop GUI.
- SQLAlchemy: For database interaction (ORM).
- python-dotenv: For managing environment variables.
- Sales Management: Fast sales registration, product selection by barcode, automatic total calculation, and payment method selection.
- Inventory Control: Instant stock lookup by product.
- Price Management: Search and update product prices.
- Flexible Configuration: Change the database URL from the interface and restart the app to apply changes.
- Architecture: Clear separation between business logic, data access, controllers, and views.
- Logging: Log management for auditing and debugging.
The screenshot shows the app in Spanish, as requested by a real client.
During development, several design decisions were made to prioritize maintainability, scalability, and low coupling.
Each system module (Sales, Prices, Stock) has its own Model, View, and Controller, functioning as independent mini-applications.
- This allows complete isolation between functionalities, so if a domain breaks or is removed, the others remain unaffected.
- It promotes scalability and maintainability, as the flows of different modules never intersect at any point in the lifecycle.
Previously, DAOs represented database tables. Now, they represent business contexts and are associated with the module they work with, also promoting decoupling at the data access layer. This avoids mixing queries from different modules in a single file.
- Less coupling in the data access layer.
- More readable code, organized by business context.
Data is duplicated: the backend keeps the original object for final calculations, while the frontend receives a copy for real-time visual calculations.
- Decouples presentation and business logic.
- More secure, as the backend data does not need to be modified just for frontend display purposes.
- This solution addresses the problem that calculations like subtotal or total were done at the end of the flow. To show real-time updates to the user without relying on the backend, this technique was implemented successfully, improving the user experience.
When entering a sale, if it is automatically sent to an external electronic invoicing service, it does not block the UI because this process runs on a separate thread, nor does it stop the program in case of an error. See the code between lines 72-88 in src/controllers/register_sale.py.
The project has a modular architecture.
.
├── integration/ # Modules to connect with external services (e.g., billing services).
├── src/ # Main source code.
│ ├── business_logic/ # Core logic: business rules, calculations, and processes.
│ ├── controllers/ # Intermediaries between the view and the logic.
│ ├── data_access/ # Persistence layer: SQL queries and database access.
│ ├── logs/
│ ├── sample_data/
│ ├── utils/ # Helper functions and reusable tools.
│ ├── views/ # User interface.
│ └── exceptions.py # Custom error definitions.
├── .env # Real environment variables (credentials, local paths).
├── .env.example # Template of environment variables for other developers.
├── .gitignore
├── LICENSE
├── main.py # Main entry point to run the application.
├── README_English.md
├── README_spanish.md
└── requirements.txt
-
Clone the repository:
git clone https://github.com/NehuenLian/Lotus-POS-Desktop
-
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
- Copy the
.env.examplefile to.envand fill in the required values. This includes the database URL and paths for the fiscal integration certificates (if required).# .env file DB_URL="sqlite:///src/data_access/sample_database.db"
- Copy the
-
Run the application:
python main.py
-
You can navigate through the sections from the sidebar:
- Stock Lookup
- Price Management
- Sales Registration
- Settings
All dependencies are listed in requirements.txt.
- GUI: PySide6
- ORM: SQLAlchemy
- Environment: python-dotenv
This project is licensed under the MIT License.
You are free to use, modify, and distribute the software.
Developed by Nehuen Lián.
You can contact me for any question or suggestion.