Skip to main content

Academic Lab Management System

Project description

Lab Management System (labman)

An opinionated lab management system for academic labs, now available as a CLI tool.

PyPI version Python versions GitHub Release License

Directory Structure

  • labman/: Main package directory
    • lib/: Backend modules
    • templates/: HTML templates
    • static/: Static assets
    • server.py: Flask application
    • cli.py: CLI entry point

Installation

Prerequisites

  • Python 3.10+
  • uv (recommended) or pip

Install from pip

pip install ra-labman

Install from source

git clone https://github.com/lokeshmohanty/labman.git
cd labman
uv pip install -e .

Usage

1. Initialize Configuration

Run this command to create the .env configuration file interactively:

labman init

This will ask for:

  • Lab Name
  • Network Config (HOST_IP, SERVER_PORT, ALLOWED_HOSTS)
  • SMTP settings

2. Start the Server

Development mode (default):

labman serve
# OR
labman serve dev

Starts Flask development server.

Production mode:

labman serve prod
# OR
labman serve prod --host 0.0.0.0 --port 9000
  • Starts gunicorn in daemon mode (background).
  • Logs output to logs/YYYY-MM-DD.log.

Check Status:

labman status
  • Shows if the server is running (PID) and the latest log entry.

Stop Production Server:

labman serve stop
  • Stops the running gunicorn process (using gunicorn.pid or matching process name).

3. Management Commands

View Logs:

labman log

Shows the latest log file and follows it (tail -f).

Backup Database:

labman backup
# OR
labman backup now

Creates a copy of the database in backup/YYYY-MM-DD.db.

Automated Backup:

labman backup auto daily
# Options: daily, weekly, monthly

Sets up a cron job to backup the database automatically.

Stop Automated Backup:

labman backup stop

Removes the automated backup cron job.

4. Access the Application

Open your browser at http://<HOST_IP>:<SERVER_PORT> (default: http://localhost:9000).

Default Login (first run):

  • Email: Checks .env SMTP_USERNAME or admin@example.com
  • Password: admin123 (Change immediately!)

Features

  • User Management: Admin/User roles, secure auth with email activation.
  • Research Groups: Hierarchical organization with member management.
  • Meeting Management: Scheduling, RSVP, email notifications.
  • Content Library: File sharing with access control and notifications.
  • Inventory: Equipment and server tracking.
  • Email Notifications: Automatic notifications with retry mechanism and background queue.
  • CLI Tools: Built-in server management, logging, and backup.

Dashboard Meetings Research

Email Notification System

The system includes a robust email notification system with:

  • Automatic Retry: Failed emails are automatically retried up to 3 times with exponential backoff
  • Background Queue: Mass notifications (meetings, content) are sent asynchronously to avoid blocking
  • Failure Logging: Failed emails are logged to database for manual review and retry
  • Graceful Degradation: Application continues to work even if email server is unavailable

Development

To contribute:

  1. Install in editable mode: uv pip install -e .
  2. Run tests: pytest
  3. Check code quality: ruff check labman/

Testing

Run included tests and utilities:

# Test Email Configuration
labman test email

# Populate Test Data
labman test data

# Clear Test Data
labman test clear

Troubleshooting

Email Not Sending

  1. Check SMTP Configuration:

    labman test email
    

    This will test your SMTP settings and show any errors.

  2. Verify .env Settings:

    • SMTP_SERVER: Your SMTP server address (e.g., smtp.gmail.com)
    • SMTP_PORT: Usually 587 for TLS or 465 for SSL
    • SMTP_USERNAME: Your email address
    • SMTP_PASSWORD: Your email password or app-specific password
    • SENDER_EMAIL: Email address to send from (usually same as SMTP_USERNAME)
  3. Gmail Users: You may need to:

    • Enable "Less secure app access" OR
    • Generate an "App Password" if using 2FA
  4. Check Failed Emails: Failed emails are logged in the database and can be retried manually by an admin.

Database Issues

If you encounter database errors:

# Backup current database
labman backup now

# Check database integrity
sqlite3 data/your_lab.db "PRAGMA integrity_check;"

Server Won't Start

  1. Check if port is already in use:

    lsof -i :9000  # Replace 9000 with your port
    
  2. Check logs:

    labman log
    

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

ra_labman-0.1.2.tar.gz (57.7 kB view details)

Uploaded Source

Built Distribution

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

ra_labman-0.1.2-py3-none-any.whl (82.2 kB view details)

Uploaded Python 3

File details

Details for the file ra_labman-0.1.2.tar.gz.

File metadata

  • Download URL: ra_labman-0.1.2.tar.gz
  • Upload date:
  • Size: 57.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ra_labman-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c35c825746a4f85612b25f1ba974f6e180ddf37dac77bf51bf67021eb52683f3
MD5 c4955a4be357a1dbc3e06de9860761cc
BLAKE2b-256 25aecde11391f53606c270f74d8cb162e6f12a0199b7dace8d9b44eb9e607d2e

See more details on using hashes here.

File details

Details for the file ra_labman-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: ra_labman-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 82.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for ra_labman-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a463fd6a8b00e181a6426a262b41306e9b1f5e401c465c66015605c8c1264b3f
MD5 fd9ac1eaf0fbc2c7a87a2d501630276e
BLAKE2b-256 3b115fb897ffd7ae7d8bef4fdc0edf3a62d4c2f4e12df34ce505f3ddda0ab96a

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