Skip to main content

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

  1. Clone or download the project

    git clone <repository-url>
    cd SW-Lab-Manager
    
  2. Install dependencies

    pip install -r requirements.txt
    
  3. Run the application

    python run.py
    
  4. Access the application

    • Open your browser and go to: http://localhost:5000
    • Default admin credentials: admin / admin123

File-Based Storage

The system now uses JSON files for data storage instead of SQLite database:

  • data/users.json: User accounts and authentication data
  • data/labs.json: Laboratory information
  • data/stations.json: Workstation data within labs
  • data/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:

  1. Clear browser cache and cookies
  2. Check that the data/users.json file exists
  3. Verify admin credentials: admin / admin123
  4. Restart the application

Device Monitoring Issues

If devices show as offline:

  1. Check IP addresses are correct in device configuration
  2. Verify network connectivity between the server and devices
  3. Check firewall settings that might block ping requests
  4. Ensure devices are powered on and connected to the network

File Storage Issues

If data files are corrupted:

  1. Backup the data/ directory before making changes
  2. Check JSON syntax in the data files
  3. Restore from backup if needed
  4. Run the migration script to recreate files

Development

Adding New Features

  1. Backend: Add routes in app.py
  2. Frontend: Create templates in templates/
  3. Styling: Update static/css/style.css
  4. JavaScript: Modify static/js/app.js

Data Model Changes

When modifying data structures:

  1. Update the JSON file schemas
  2. Modify the file-based storage functions in app.py
  3. Update the migration script if needed
  4. 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:

  1. Check the troubleshooting section above
  2. Review the data files for corruption
  3. Check the application logs for error messages
  4. 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

sw_lab_manager-0.0.4.tar.gz (673.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sw_lab_manager-0.0.4-py3-none-any.whl (677.6 kB view details)

Uploaded Python 3

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

Hashes for sw_lab_manager-0.0.4.tar.gz
Algorithm Hash digest
SHA256 062e50646a92de1fde2e1d9131148f93d6a2656abd165cedbd8733cd968ce8c3
MD5 6ba4d5fed160e0229fdf454cc8360feb
BLAKE2b-256 711472a9e49001ae0630a565a6e5be71610f9f00a3207118fd2378c1a3abb3a5

See more details on using hashes here.

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

Hashes for sw_lab_manager-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9ae18413b96d070ee325b0e2b92a43a3c66bbd3752c6fa4c35f6ff222ed8310e
MD5 4bd4bc17b03548307fc84bc33c9cf2dc
BLAKE2b-256 a260784aaf24cebe6c7b3d4842afcc50cc53a029bbfc6cecd8da8b8ec44df7a3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page