https://github.com/wareflowx/wems
Custom HR desktop app generator for logistics: CACES, medical compliance, training tracking.
https://github.com/wareflowx/wems
Last synced: 5 months ago
JSON representation
Custom HR desktop app generator for logistics: CACES, medical compliance, training tracking.
- Host: GitHub
- URL: https://github.com/wareflowx/wems
- Owner: wareflowx
- License: mit
- Created: 2026-01-15T14:33:08.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-29T13:11:47.000Z (5 months ago)
- Last Synced: 2026-01-30T02:31:53.924Z (5 months ago)
- Language: Python
- Size: 1.59 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Roadmap: docs/ROADMAP.md
Awesome Lists containing this project
README
# Wareflow EMS
**Warehouse Employee Management System** - Desktop application for warehouse employee management, CACES safety certification tracking, and medical compliance monitoring.



---
## ๐ Table of Contents
1. [Description](#-description)
2. [Features](#-features)
3. [Screenshots](#-screenshots)
4. [Prerequisites](#-prerequisites)
5. [Installation](#-installation)
6. [Usage](#-usage)
7. [Configuration](#-configuration)
8. [Project Structure](#-project-structure)
9. [Database](#-database)
10. [CLI Interface](#-cli-interface)
11. [Testing](#-testing)
12. [Development](#-development)
13. [Release Guide](#-release-guide)
14. [Changelog](#-changelog)
15. [Roadmap](#-roadmap)
16. [Contributing](#-contributing)
17. [License](#-license)
18. [Contact](#-contact)
---
## ๐ฏ Description
Wareflow EMS is a modern Python desktop application designed for logistics and warehouse companies. It provides comprehensive management of:
- **Employee Management**: Complete administrative tracking (CDI, CDD, Temporary, Apprenticeship)
- **CACES Tracking**: French safety certifications (R489 categories: 1A, 1B, 3, 4, 5)
- **Medical Monitoring**: Compliance with French labor law medical examinations
- **Training Records**: Online training tracking with expiration monitoring
- **Smart Alerts**: Proactive notifications for upcoming expirations
- **Concurrent Access**: Multi-user support for network-shared deployments
**Technologies**: Python 3.14+, CustomTkinter, SQLite, Peewee ORM
---
## โจ Features
### Employee Management
- โ
Full CRUD (Create, Read, Update, Delete)
- โ
Status tracking: Active/Inactive
- โ
Contract types: CDI, CDD, Temporary, Apprenticeship, Internship
- โ
Customizable workspaces and roles
- โ
Automatic seniority calculation
- โ
Contact information (email, phone)
### CACES Tracking
- โ
5 R489 categories (1A, 1B, 3, 4, 5)
- โ
Automatic expiration calculation (5 or 10 years based on type)
- โ
PDF document management
- โ
Visual status (valid, warning, critical, expired)
- โ
Proactive alerts before expiration
### Medical Visits
- โ
3 visit types: Initial, Periodic, Recovery
- โ
Results: Fit, Unfit, Fit with restrictions
- โ
Automatic expiration calculation (1-2 years)
- โ
Business rules: Recovery visit requires restrictions
- โ
Medical certificate storage
### Online Training
- โ
Training tracking with optional validity
- โ
Permanent training support
- โ
Automatic expiration calculation
- โ
Certificate secure storage
### Alert System
- โ
3 levels: Critical (< 7 days), Warning (< 30 days), Info (< 90 days)
- โ
Filter by type (CACES, Medical, Training)
- โ
Per-employee aggregation
- โ
Excel alert export
### Excel Import/Export
- โ
Batch import with validation
- โ
Excel template generation
- โ
Export with conditional formatting
- โ
Multiple sheets (Summary, Employees, CACES, Visits, Training)
### Automatic Backups
- โ
Startup backup
- โ
Configurable retention (default: 30)
- โ
Automatic old backup cleanup
- โ
One-click restore
### Concurrent Access Control
- โ
Database-backed locking
- โ
Heartbeat every 30 seconds
- โ
Stale lock detection (2 minutes)
- โ
Read-only mode when locked by others
---
## ๐ผ๏ธ Screenshots
*(Add 3-4 screenshots here)*
- Employee list with filters
- Employee detail view
- Alert dashboard
- CACES addition form
---
## ๐ฆ Prerequisites
### Requirements
- **Python 3.14 or higher** (strict requirement)
- **Windows 10/11** (primary), macOS, Linux compatible
- **200 MB disk space**
### Optional
- **Network access** (for network share deployment)
- **PDF reader** (to view stored certificates)
---
## ๐ Installation
### Method 0: Download Windows Executable (Easiest)
**No Python installation required!** Download the pre-built Windows executable:
1. Go to [Releases](https://github.com/wareflowx/wareflow-ems/releases)
2. Download the latest `Wareflow-EMS-X.X.X.exe`
3. Run the executable
4. Application will create database on first launch
**Benefits:**
- โก 5-minute setup vs 30+ minutes with Python
- ๐ All dependencies bundled
- ๐จ No technical knowledge required
- โ
Official tested releases
**System Requirements:**
- Windows 10 or later
- 100 MB free disk space
- No additional dependencies
### Method 1: uv (Recommended)
```bash
# Clone repository
git clone https://github.com/wareflowx/wareflow-ems.git
cd wareflow-ems
# Install dependencies
uv sync
# Launch application
uv run python -m src.main
```
### Method 2: pip
```bash
# Clone repository
git clone https://github.com/wareflowx/wareflow-ems.git
cd wareflow-ems
# Create virtual environment
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
# Install dependencies
pip install -e .
# Launch application
python -m src.main
```
### First Run
On first launch, the application will:
1. โ
Automatically create `data/` directory
2. โ
Initialize SQLite database
3. โ
Create necessary tables
4. โ
Create startup backup
5. โ
Display main interface
**No configuration required!**
---
## ๐ฎ Usage
### Graphical Interface (GUI)
```bash
uv run python -m src.main
```
**Navigation**:
- **Employees**: Employee list and search
- **Alerts**: Upcoming expirations view
- **Excel Import**: Batch employee import
- **Backups**: Backup management
### Command Line Interface (CLI)
```bash
# Show help
uv run python src/cli_main.py --help
# List employees
uv run python src/cli_main.py employee list
# Add employee (interactive)
uv run python src/cli_main.py employee add
# Show employee details
uv run python src/cli_main.py employee show
# Add CACES
uv run python src/cli_main.py caces add
# Show alerts
uv run python src/cli_main.py report alerts --days 30
# Export to Excel
uv run python src/cli_main.py report export employees.xlsx
# Lock management
uv run python src/cli_main.py lock status
uv run python src/cli_main.py lock release
```
---
## โ๏ธ Configuration
### Environment Variables
Create a `.env` file at project root:
```bash
# Database
DATABASE_PATH=data/employee_manager.db
# Or separate folder and name
DATABASE_DIR=data
DATABASE_NAME=employee_manager.db
# Application
APP_ENV=production
LOG_LEVEL=INFO
# Interface
APP_THEME=blue # blue, green, dark-blue
APP_MODE=system # light, dark, system
DEFAULT_WIDTH=1200
DEFAULT_HEIGHT=800
```
### Configuration File `config.json` (Optional)
```json
{
"alerts": {
"critical_days": 7,
"warning_days": 30,
"info_days": 90
},
"lock": {
"timeout_minutes": 2,
"heartbeat_interval_seconds": 30
},
"backup": {
"max_backups": 30,
"auto_backup_on_startup": true
},
"organization": {
"roles": ["Cariste", "Prรฉparateur", "Magasinier", "Rรฉceptionnaire"],
"workspaces": ["Quai", "Zone A", "Zone B", "Bureau"]
}
}
```
---
## ๐ Project Structure
```
wareflow-ems/
โโโ src/
โ โโโ cli/ # Command-line interface
โ โ โโโ employee.py # Employee commands
โ โ โโโ caces.py # CACES commands
โ โ โโโ medical.py # Medical visit commands
โ โ โโโ training.py # Training commands
โ โ โโโ report.py # Reports and exports
โ โโโ controllers/ # Business logic layer
โ โ โโโ employee_controller.py
โ โ โโโ dashboard_controller.py
โ โ โโโ alerts_controller.py
โ โโโ database/ # Database layer
โ โ โโโ connection.py # SQLite connection with Peewee
โ โโโ employee/ # Employee module (Entity-Oriented)
โ โ โโโ models.py # ORM models (560 lines)
โ โ โโโ queries.py # Complex queries
โ โ โโโ calculations.py # Business calculations
โ โ โโโ validators.py # Data validation
โ โ โโโ constants.py # Constants and enums
โ โ โโโ alerts.py # Alert generation
โ โโโ excel_import/ # Excel import
โ โโโ export/ # Excel export
โ โโโ lock/ # Concurrent access control
โ โ โโโ models.py # AppLock model
โ โ โโโ manager.py # Lock manager
โ โโโ ui_ctk/ # CustomTkinter GUI
โ โ โโโ app.py # GUI entry point
โ โ โโโ main_window.py # Main window
โ โ โโโ forms/ # Input forms
โ โ โโโ views/ # Data views
โ โ โโโ widgets/ # Reusable components
โ โโโ utils/ # Utility functions
โ โ โโโ config.py # Configuration management
โ โ โโโ validation.py # Validation framework
โ โ โโโ logging_config.py # Logging setup
โ โ โโโ files.py # File operations
โ โ โโโ backup_manager.py # Backup management
โ โโโ main.py # Main entry point
โโโ tests/ # Test suite
โ โโโ test_employee/ # Employee model tests
โ โโโ test_cli/ # CLI tests
โ โโโ test_integration/ # Integration tests
โ โโโ conftest.py # Shared fixtures
โโโ docs/ # Documentation (30+ files)
โโโ data/ # SQLite database
โโโ documents/ # Stored certificates
โ โโโ caces/
โ โโโ medical/
โ โโโ training/
โโโ backups/ # Automatic backups
โโโ logs/ # Logs with rotation
โโโ pyproject.toml # Project metadata
โโโ .env.example # Configuration template
โโโ README.md # This file
```
---
## ๐๏ธ Database
### Schema
**5 SQLite Tables** with foreign key relationships:
1. **employees**: Employee data
- Fields: external_id, first_name, last_name, email, phone, status, workspace, role, contract_type, entry_date
- Indexes: external_id (unique), status, workspace, role, contract_type
2. **caces**: Safety certifications
- Relation: employee_id โ employees.id (CASCADE DELETE)
- Fields: kind, completion_date, expiration_date, document_path
- Index: (employee_id, expiration_date)
3. **medical_visits**: Medical visits
- Relation: employee_id โ employees.id (CASCADE DELETE)
- Fields: visit_type, visit_date, expiration_date, result, document_path
- Index: (employee_id, expiration_date)
4. **online_trainings**: Online training
- Relation: employee_id โ employees.id (CASCADE DELETE)
- Fields: title, completion_date, validity_months, expiration_date, certificate_path
- Index: (employee_id, expiration_date)
5. **app_locks**: Concurrent access locks
- Fields: hostname, username, locked_at, last_heartbeat, process_id
- Indexes: hostname, locked_at, last_heartbeat
### Location
**Default**: `data/employee_manager.db`
**Customizable** via environment variables.
### Concurrency
- **WAL mode** (Write-Ahead Logging) for concurrent reads
- **PRAGMA foreign_keys = 1** for referential integrity
- **CASCADE DELETE**: Deleting an employee deletes all related data
---
## ๐ป CLI Interface
### Available Commands
#### Employees
```bash
employee-manager employee list # List all employees
employee-manager employee show # Employee details
employee-manager employee add # Add (interactive)
employee-manager employee update # Update
employee-manager employee delete # Delete
```
#### CACES
```bash
employee-manager caces list # List all CACES
employee-manager caces add # Add CACES
employee-manager caces expiring --days 30 # Expiring within 30 days
employee-manager caces expired # Expired CACES
```
#### Medical Visits
```bash
employee-manager medical list # List all visits
employee-manager medical add # Add visit
employee-manager medical unfit # Unfit employees
employee-manager medical expiring --days 30 # Expiring within 30 days
```
#### Training
```bash
employee-manager training list # List all training
employee-manager training add # Add training
employee-manager training expiring --days 60 # Expiring within 60 days
```
#### Reports
```bash
employee-manager report dashboard # Dashboard statistics
employee-manager report alerts --type caces # CACES alerts
employee-manager report export output.xlsx # Export to Excel
employee-manager report stats # Global statistics
```
#### Locks
```bash
employee-manager lock status # Lock status
employee-manager lock acquire # Acquire lock
employee-manager lock release # Release lock
employee-manager lock refresh # Refresh lock
```
---
## ๐งช Testing
### Run Tests
```bash
# All tests
uv run pytest
# With coverage
uv run pytest --cov=src --cov-report=html
# Specific test
uv run pytest tests/test_employee/test_models.py
# Verbose mode
uv run pytest -v
# Stop on first error
uv run pytest -x
```
### Test Structure
```
tests/
โโโ conftest.py # Shared fixtures
โโโ test_employee/ # Employee model tests
โโโ test_cli/ # CLI tests
โโโ test_export/ # Excel export tests
โโโ test_integration/ # Integration tests
โโโ test_lock/ # Lock mechanism tests
โโโ test_utils/ # Utility tests
โโโ test_ui/ # GUI tests (excluded from CI)
```
### Coverage
**Minimum required**: 40%
**HTML report**: `htmlcov/index.html`
---
## ๐ง Development
### Code Style
**Linter**: Ruff
**Formatter**: Ruff
```bash
# Check style
uv run ruff check src/
# Auto-fix
uv run ruff check --fix src/
# Format code
uv run ruff format src/
```
### Contribution Workflow
1. Fork the project
2. Create a feature branch `feature/my-feature`
3. Make changes
4. Add tests
5. Run tests: `uv run pytest`
6. Check style: `uv run ruff check src/`
7. Commit with conventional message
8. Push and create Pull Request
### Commit Messages
Conventional commits recommended:
- `feat:` - New feature
- `fix:` - Bug fix
- `docs:` - Documentation
- `test:` - Tests
- `refactor:` - Refactoring
- `chore:` - Maintenance
### Build Executable
```bash
# Install PyInstaller
uv pip install pyinstaller
# Build
python build/build.py
# Output: dist/employee_manager.exe
```
---
## ๐ฆ Release Guide
Wareflow EMS uses automated releases with GitHub Actions. Creating a release is as simple as pushing a Git tag.
### Quick Release
```bash
# 1. Update version in pyproject.toml
# 2. Commit and push
git add .
git commit -m "chore: release v1.0.0"
git push origin main
# 3. Create and push tag
git tag v1.0.0
git push --tags
# That's it! GitHub Actions will:
# - Run tests
# - Build Windows .exe
# - Create GitHub release
# - Upload executable
```
### Download Releases
Pre-built Windows executables are available at [Releases](https://github.com/wareflowx/wareflow-ems/releases).
No Python installation required - just download and run!
### Local Build
```bash
# Install build dependencies
uv sync --extra build
# Build Windows .exe
python scripts/build.py
# Output: dist/Wareflow EMS.exe
```
### Documentation
See [RELEASE_GUIDE.md](docs/RELEASE_GUIDE.md) for detailed information about:
- Version numbering
- Release checklist
- Troubleshooting
- Rollback procedures
---
## ๐ Changelog
### Version 1.0.0 (2025-01-22)
#### Added
- โ
Complete employee management system
- โ
CACES tracking with automatic expiration calculation
- โ
Medical visit tracking
- โ
Online training management
- โ
Smart alert system
- โ
Excel import/export
- โ
Automatic backups
- โ
Full CLI interface (30+ commands)
- โ
Modern CustomTkinter GUI
- โ
Concurrent access control
- โ
Authentication system removed (OS-level access)
#### Fixed
- ๐ Fixed datetime/date comparisons in computed properties
- ๐ Fixed EmployeeController import path
- ๐ Fixed validate_date to return date objects
#### Technical
- ๐ฆ 11,000+ lines of Python code
- ๐ฆ 80+ test files
- ๐ฆ 30+ documentation files
- ๐ฆ Python 3.14+ required
- ๐ฆ Test coverage: 40% minimum
---
## ๐บ๏ธ Roadmap
### Phase 1: Core Features โ
(Complete)
- [x] Employee management
- [x] CACES tracking
- [x] Medical visits
- [x] Training
- [x] Alerts
- [x] CustomTkinter GUI
- [x] Complete CLI
### Phase 2: Advanced Features (In Progress)
- [ ] Undo/Redo functionality
- [ ] Soft delete with trash
- [ ] Optimistic locking
- [ ] Internationalization (i18n)
- [ ] Advanced theming
### Phase 3: Integration (Planned)
- [ ] REST API for remote access
- [ ] Web dashboard
- [ ] Mobile app (React Native)
- [ ] ERP/WMS integration
### Phase 4: Enterprise (Future)
- [ ] Multi-company support
- [ ] Advanced permissions
- [ ] Complete audit trail
- [ ] SSO integration
- [ ] High availability setup
---
## ๐ค Contributing
Contributions are welcome!
1. Fork the project
2. Create a feature branch
3. Make your changes
4. Add tests
5. Ensure tests pass
6. Submit a Pull Request
### Guidelines
- Follow existing code style (ruff)
- Write tests for new features
- Update documentation
- Atomic commits with clear messages
---
## ๐ License
This project is licensed under the **MIT License**.
```
MIT License
Copyright (c) 2025 Wareflow
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```
---
## ๐ง Contact
- **Project**: https://github.com/wareflowx/wareflow-ems
- **Issues**: https://github.com/wareflowx/wareflow-ems/issues
- **Documentation**: https://github.com/wareflowx/wareflow-ems/tree/main/docs
---
## ๐ Acknowledgments
- **Peewee ORM**: For the elegant and simple ORM
- **CustomTkinter**: For the modern UI framework
- **Typer**: For the beautiful CLI framework
- **uv**: For the ultra-fast package manager
---
**Built with โค๏ธ by Wareflow**