A Python based local web application for uploading MODAQ files to S3 with progress tracking, duplicate detection, and configuration.
- Drag-and-drop file upload - Select individual files or entire folders
- MCAP timestamp extraction - Automatically extracts timestamps using modaq_toolkit
- Hive-partitioned S3 paths - Files are organized by
year/month/day/hour/minute - Duplicate detection - Checks if files already exist in S3 before uploading
- Real-time progress - Server-Sent Events (SSE) for live upload progress
- S3 file browser - Navigate and search uploaded files
- Application updates - Built-in git pull and pip install functionality
- NLR branding - Official NLR color palette and styling
- Python 3.11 or higher
- AWS credentials configured in
~/.aws/credentials - Access to an S3 bucket
- Clone the repository:
git clone <repository-url>
cd modaq_upload- Create a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- (Optional) Install development dependencies:
pip install -r requirements-dev.txtpython app.pyThe application will be available at http://localhost:5000.
For production use on a Linux machine, use the automated installation script which sets up a systemd service with Gunicorn.
cd deploy
sudo python3 install.pyThis will:
- Install system dependencies (python3, python3-venv, git)
- Create a
modaqsystem user - Copy the application to
/opt/modaq-upload - Create a Python virtual environment and install dependencies
- Set up logging at
/var/log/modaq-upload - Install and enable a systemd service
- Configure AWS credentials for the modaq user:
sudo -u modaq aws configure --profile default- Edit the application settings:
sudo nano /opt/modaq-upload/settings.json- The application runs at
http://localhost:8080
Check status
sudo systemctl status modaq-uploadView logs
sudo journalctl -u modaq-upload -fRestart after config changes
sudo systemctl restart modaq-uploadStop the service
sudo systemctl stop modaq-uploadcd deploy
sudo python3 uninstall.pySettings can be configured in two ways:
Create a .env file in the project root:
cp .env.example .envEdit .env with your settings:
# AWS Profile name from ~/.aws/credentials
MODAQ_AWS_PROFILE=<profile_name>
# AWS Region
MODAQ_AWS_REGION=<AWS region, e.g. us-west-2>
# S3 Bucket name for uploads
MODAQ_S3_BUCKET=<your-bucket-name>
# Default folder to open when selecting files (optional)
MODAQ_DEFAULT_UPLOAD_FOLDER=</path/to/mcap/files>
# Custom display name shown in the header (optional)
MODAQ_DISPLAY_NAME=<My Custom Name>Environment variables take precedence over settings configured in the web UI.
- Navigate to the Settings page
- Select your AWS profile from the dropdown
- Enter your S3 bucket name
- Click Test Connection to verify access
- Click Save Settings
Settings are saved to settings.json (gitignored).
- Go to the Upload page
- Drag and drop MCAP files or click to select
- Review the analysis results showing timestamps and S3 paths
- Check "Skip duplicates" to avoid re-uploading existing files
- Click Upload Files to start
- Monitor progress in real-time
- Go to the Browse Files page
- Navigate through the Hive-partitioned folder structure
- Use the search box to find specific files
- Go to Settings > Application Updates
- Click Check for Updates to see if updates are available
- Click Update Application to:
- Pull latest changes from git
- Reinstall Python dependencies
- Update modaq_toolkit to the latest version
- Restart the application after updating
Files are uploaded to S3 using a Hive-partitioned path format:
year=YYYY/month=MM/day=DD/hour=HH/minute=M0/filename.mcap
Where:
- Minutes are rounded to 10-minute buckets (00, 10, 20, 30, 40, 50)
- Timestamps are extracted from the MCAP file data
pytest tests/ -vWith coverage:
pytest tests/ --cov=app --cov-report=htmlruff check app/ tests/
ruff format app/ tests/mypy app/npm run lint # Check
npm run lint:fix # Auto-fixnpm run typecheck # tsc --checkJs via jsconfig.jsonnpm run test # Run all JS tests
npm run test:watch # Watch mode
npm run test:coverage # With coverage reportnpm run check # Biome + tsc + VitestSee docs/ARCHITECTURE.md for project structure and API endpoint reference.
BSD 3-Clause License. See LICENSE for details.
