172 lines
5.1 KiB
Markdown
172 lines
5.1 KiB
Markdown
# Quality Recticel Application - Documentation
|
|
|
|
This folder contains all development and deployment documentation for the Quality Recticel application.
|
|
|
|
## Documentation Index
|
|
|
|
### Setup & Deployment
|
|
|
|
- **[PRODUCTION_STARTUP_GUIDE.md](./PRODUCTION_STARTUP_GUIDE.md)** - Complete production management guide
|
|
- Starting, stopping, and monitoring the application
|
|
- Log management and monitoring
|
|
- Process management and troubleshooting
|
|
- Performance tuning and security
|
|
- **[DATABASE_DOCKER_SETUP.md](./DATABASE_DOCKER_SETUP.md)** - Complete guide for database configuration and Docker setup
|
|
- **[DOCKER_IMPROVEMENTS.md](./DOCKER_IMPROVEMENTS.md)** - Detailed changelog of Docker-related improvements and optimizations
|
|
- **[DOCKER_QUICK_REFERENCE.md](./DOCKER_QUICK_REFERENCE.md)** - Quick reference guide for common Docker commands and operations
|
|
|
|
### Features & Systems
|
|
|
|
- **[BACKUP_SYSTEM.md](./BACKUP_SYSTEM.md)** - Database backup management system documentation
|
|
- Manual and scheduled backups
|
|
- Backup configuration and management
|
|
- Backup storage and download
|
|
- **[DATABASE_BACKUP_GUIDE.md](./DATABASE_BACKUP_GUIDE.md)** - Comprehensive backup creation guide
|
|
- Manual backup procedures
|
|
- Scheduled backup configuration
|
|
- Backup best practices
|
|
- **[DATABASE_RESTORE_GUIDE.md](./DATABASE_RESTORE_GUIDE.md)** - Database restore procedures
|
|
- Server migration guide
|
|
- Disaster recovery steps
|
|
- Restore troubleshooting
|
|
- Safety features and confirmations
|
|
|
|
### Database Documentation
|
|
|
|
- **[DATABASE_STRUCTURE.md](./DATABASE_STRUCTURE.md)** - Complete database structure documentation
|
|
- All 17 tables with field definitions
|
|
- Table purposes and descriptions
|
|
- Page-to-table usage matrix
|
|
- Relationships and foreign keys
|
|
- Indexes and performance notes
|
|
|
|
## Quick Links
|
|
|
|
### Application Structure
|
|
|
|
```
|
|
quality_app/
|
|
├── py_app/ # Python application code
|
|
│ ├── app/ # Flask application modules
|
|
│ │ ├── __init__.py # App factory
|
|
│ │ ├── routes.py # Main routes
|
|
│ │ ├── daily_mirror.py # Daily Mirror module
|
|
│ │ ├── database_backup.py # Backup system
|
|
│ │ ├── templates/ # HTML templates
|
|
│ │ └── static/ # CSS, JS, images
|
|
│ ├── instance/ # Configuration files
|
|
│ └── requirements.txt # Python dependencies
|
|
├── backups/ # Database backups
|
|
├── logs/ # Application logs
|
|
├── documentation/ # This folder
|
|
└── docker-compose.yml # Docker configuration
|
|
```
|
|
|
|
### Key Configuration Files
|
|
|
|
- `py_app/instance/external_server.conf` - Database connection settings
|
|
- `docker-compose.yml` - Docker services configuration
|
|
- `.env` - Environment variables (create from .env.example)
|
|
- `py_app/gunicorn.conf.py` - Gunicorn WSGI server settings
|
|
|
|
### Access Levels
|
|
|
|
The application uses a 4-tier role system:
|
|
|
|
1. **Superadmin** (Level 100) - Full system access
|
|
2. **Admin** (Level 90) - Administrative access
|
|
3. **Manager** (Level 70) - Module management
|
|
4. **Worker** (Level 50) - Basic operations
|
|
|
|
### Modules
|
|
|
|
- **Quality** - Production scanning and quality reports
|
|
- **Warehouse** - Warehouse management
|
|
- **Labels** - Label printing and management
|
|
- **Daily Mirror** - Business intelligence and reporting
|
|
|
|
## Development Notes
|
|
|
|
### Recent Changes (November 2025)
|
|
|
|
1. **SQLAlchemy Removal** - Simplified to direct MariaDB connections
|
|
2. **Daily Mirror Module** - Fully integrated with access control
|
|
3. **Backup System** - Complete database backup management
|
|
4. **Access Control** - Superadmin gets automatic full access
|
|
5. **Docker Optimization** - Production-ready configuration
|
|
|
|
### Common Tasks
|
|
|
|
**Start Application:**
|
|
```bash
|
|
cd /srv/quality_app/py_app
|
|
bash start_production.sh
|
|
```
|
|
|
|
**Stop Application:**
|
|
```bash
|
|
cd /srv/quality_app/py_app
|
|
bash stop_production.sh
|
|
```
|
|
|
|
**View Logs:**
|
|
```bash
|
|
tail -f /srv/quality_app/logs/error.log
|
|
tail -f /srv/quality_app/logs/access.log
|
|
```
|
|
|
|
**Create Backup:**
|
|
- Login as superadmin/admin
|
|
- Go to Settings page
|
|
- Click "Backup Now" button
|
|
|
|
**Check Application Status:**
|
|
```bash
|
|
ps aux | grep gunicorn | grep trasabilitate
|
|
```
|
|
|
|
## Support & Maintenance
|
|
|
|
### Log Locations
|
|
|
|
- **Access Log**: `/srv/quality_app/logs/access.log`
|
|
- **Error Log**: `/srv/quality_app/logs/error.log`
|
|
- **Backup Location**: `/srv/quality_app/backups/`
|
|
|
|
### Database
|
|
|
|
- **Host**: localhost (or as configured)
|
|
- **Port**: 3306
|
|
- **Database**: trasabilitate
|
|
- **User**: trasabilitate
|
|
|
|
### Default Login
|
|
|
|
- **Username**: superadmin
|
|
- **Password**: superadmin123
|
|
|
|
⚠️ **Change default credentials in production!**
|
|
|
|
## Contributing
|
|
|
|
When adding new documentation:
|
|
|
|
1. Place markdown files in this folder
|
|
2. Update this README with links
|
|
3. Use clear, descriptive filenames
|
|
4. Include date and version when applicable
|
|
|
|
## Version History
|
|
|
|
- **v1.0.0** (November 2025) - Initial production release
|
|
- Docker deployment ready
|
|
- Backup system implemented
|
|
- Daily Mirror module integrated
|
|
- SQLAlchemy removed
|
|
|
|
---
|
|
|
|
**Last Updated**: November 3, 2025
|
|
**Application**: Quality Recticel Traceability System
|
|
**Technology Stack**: Flask, MariaDB, Gunicorn, Docker
|