A simple lab management system.
Project description
SW Labs Management System
A comprehensive laboratory management system for software development labs, built with Flask and featuring file-based storage.
Features
- Lab Management: Create and manage multiple laboratories
- Station Management: Track individual workstations within labs
- Device Monitoring: Monitor PCs and servers with real-time ping status
- User Management: Admin and regular user roles with authentication
- File-Based Storage: Data stored in JSON files for easy backup and portability
- Real-time Status: Live device status monitoring
- Responsive UI: Modern Bootstrap-based interface
Quick Start
Prerequisites
- Python 3.7 or higher
- pip (Python package installer)
Installation
-
Clone or download the project
git clone <repository-url> cd SW-Lab-Manager
-
Install dependencies
pip install -r requirements.txt
-
Run the application
python run.py -
Access the application
- Open your browser and go to:
http://localhost:5000 - Default admin credentials:
admin/admin123
- Open your browser and go to:
File-Based Storage
The system now uses JSON files for data storage instead of SQLite database:
data/users.json: User accounts and authentication datadata/labs.json: Laboratory informationdata/stations.json: Workstation data within labsdata/devices.json: Device information and status
Benefits of File-Based Storage
- Easy Backup: Simply copy the
data/folder to backup all data - Portable: Move data between systems by copying JSON files
- Human Readable: JSON files can be easily viewed and edited
- Version Control Friendly: JSON files work well with Git
- No Database Setup: No need to install or configure databases
Data Migration
If you have existing data in the SQLite database, you can migrate it to JSON files:
python migrate_to_files.py
This will create the data/ directory with JSON files containing your existing data.
System Architecture
Core Components
- Flask Web Framework: Backend API and web interface
- Flask-Login: User authentication and session management
- Bootstrap 5: Modern responsive UI
- ping3: Network device monitoring
- JSON Storage: File-based data persistence
Data Structure
data/
├── users.json # User accounts
├── labs.json # Laboratories
├── stations.json # Workstations
└── devices.json # Devices (PCs/Servers)
Usage
Admin Panel
Access the admin panel to manage:
- Labs: Create and configure laboratories
- Stations: Add workstations to labs
- Devices: Configure PCs and servers with IP addresses
- Users: Create and manage user accounts
Regular Users
Regular users can:
- View lab and station information
- Occupy and release stations
- Monitor device status
- View their activity history
Device Monitoring
The system automatically pings devices every 30 seconds to check their online status. Device status is displayed in real-time on the web interface.
Troubleshooting
Login Issues
If you experience login problems:
- Clear browser cache and cookies
- Check that the data/users.json file exists
- Verify admin credentials:
admin/admin123 - Restart the application
Device Monitoring Issues
If devices show as offline:
- Check IP addresses are correct in device configuration
- Verify network connectivity between the server and devices
- Check firewall settings that might block ping requests
- Ensure devices are powered on and connected to the network
File Storage Issues
If data files are corrupted:
- Backup the data/ directory before making changes
- Check JSON syntax in the data files
- Restore from backup if needed
- Run the migration script to recreate files
Development
Adding New Features
- Backend: Add routes in
app.py - Frontend: Create templates in
templates/ - Styling: Update
static/css/style.css - JavaScript: Modify
static/js/app.js
Data Model Changes
When modifying data structures:
- Update the JSON file schemas
- Modify the file-based storage functions in
app.py - Update the migration script if needed
- Test with sample data
Security Considerations
- Password Hashing: All passwords are hashed using Werkzeug's security functions
- Session Management: Flask-Login handles secure session management
- Input Validation: All user inputs are validated and sanitized
- File Permissions: Ensure data files have appropriate read/write permissions
Backup and Recovery
Regular Backups
# Backup all data
cp -r data/ backup/data_$(date +%Y%m%d_%H%M%S)/
# Restore from backup
cp -r backup/data_YYYYMMDD_HHMMSS/* data/
Data Export
You can export data to CSV format for external analysis:
python export_to_csv.py
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For issues and questions:
- Check the troubleshooting section above
- Review the data files for corruption
- Check the application logs for error messages
- Create an issue in the project repository
Changelog
Version 2.0
- NEW: File-based storage system (JSON)
- FIXED: Login loading issue
- IMPROVED: Better error handling
- ADDED: Data migration script
- ENHANCED: Backup and recovery procedures
Version 1.0
- Initial release with SQLite database
- Basic lab and station management
- Device monitoring functionality
- User authentication system
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sw_lab_manager-0.0.4.tar.gz.
File metadata
- Download URL: sw_lab_manager-0.0.4.tar.gz
- Upload date:
- Size: 673.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
062e50646a92de1fde2e1d9131148f93d6a2656abd165cedbd8733cd968ce8c3
|
|
| MD5 |
6ba4d5fed160e0229fdf454cc8360feb
|
|
| BLAKE2b-256 |
711472a9e49001ae0630a565a6e5be71610f9f00a3207118fd2378c1a3abb3a5
|
File details
Details for the file sw_lab_manager-0.0.4-py3-none-any.whl.
File metadata
- Download URL: sw_lab_manager-0.0.4-py3-none-any.whl
- Upload date:
- Size: 677.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ae18413b96d070ee325b0e2b92a43a3c66bbd3752c6fa4c35f6ff222ed8310e
|
|
| MD5 |
4bd4bc17b03548307fc84bc33c9cf2dc
|
|
| BLAKE2b-256 |
a260784aaf24cebe6c7b3d4842afcc50cc53a029bbfc6cecd8da8b8ec44df7a3
|