Automated scripts to set up local development environment for MentorMe Plagiarism Detection System.
start-dev-env.sh- Bash script (Linux/macOS/Git Bash)start-dev-env.ps1- PowerShell script (Windows)
Everything in one command - infrastructure + Python environment + dependencies:
# Linux/macOS/Git Bash
chmod +x start-dev-env.sh
./start-dev-env.sh --full-setup
# Windows PowerShell
.\start-dev-env.ps1 --full-setupWhat it does:
- Creates PostgreSQL container (port 5432)
- Creates RabbitMQ container (ports 5672, 15672)
- Initializes database schema
- Creates
.envconfiguration file - Creates Python virtual environment
- Installs all dependencies (~5-10 minutes)
- Downloads CLIP model from HuggingFace (~3.5GB)
- Verifies setup
Time: ~10-15 minutes (first run)
Just containers + database, manual Python setup:
# Linux/macOS/Git Bash
./start-dev-env.sh
# Windows PowerShell
.\start-dev-env.ps1What it does:
- Creates PostgreSQL + RabbitMQ containers
- Initializes database
- Creates
.envfile
Then manually:
python -m venv venv
source venv/bin/activate # Linux/macOS
# OR
.\venv\Scripts\Activate.ps1 # Windows
pip install -r requirements.txtPre-compile dependencies for faster/offline installs:
# Linux/macOS/Git Bash
./start-dev-env.sh --build-wheelhouse
# Then install offline:
pip install --no-index --find-links=wheelhouse -r requirements.txt| Flag | Description |
|---|---|
--full-setup |
Complete setup: infrastructure + Python + dependencies |
--build-wheelhouse |
Build wheelhouse for offline dependency installation |
| (no flags) | Infrastructure only (containers + database) |
| Service | Port | Access | Credentials |
|---|---|---|---|
| PostgreSQL | 5432 | localhost:5432 | postgres/postgres |
| RabbitMQ (AMQP) | 5672 | localhost:5672 | admin/admin123 |
| RabbitMQ (Management UI) | 15672 | http://localhost:15672 | guest/guest |
.env- Environment configuration (from.env.example)venv/- Python virtual environment (if--full-setup)data/- Data directories (reference_images, temp_images)models/- Model cache directorylogs/- Application logs directory
- Database:
plagiarism_db - Tables:
submissions,reference_images,feedback_logs - Extension: pgvector
- Indexes: B-tree, HNSW vector indexes
Terminal 1 - Worker:
source venv/bin/activate # Linux/macOS
# OR
.\venv\Scripts\Activate.ps1 # Windows
python app.pyTerminal 2 - API Server:
source venv/bin/activate
uvicorn api:app --reload --host 0.0.0.0 --port 8000Access API: http://localhost:8000/docs
- Podman (or Docker) - Container runtime
- Python 3.10+ - Application runtime
- 8GB+ RAM - For CLIP model
- 10GB+ disk - For dependencies and models
- CUDA GPU - For faster CLIP inference (10x speedup)
- curl - For health checks
# Install Podman: https://podman.io/getting-started/installation# Install Python 3.10+: https://www.python.org/downloads/# Stop existing containers
podman stop mentorme-postgres mentorme-rabbitmq
podman rm mentorme-postgres mentorme-rabbitmq
# Or change ports in script (POSTGRES_PORT, RABBITMQ_PORT)# Check PostgreSQL is running
podman ps | grep mentorme-postgres
# Check logs
podman logs mentorme-postgres
# Restart container
podman restart mentorme-postgres# Check RabbitMQ is running
podman ps | grep mentorme-rabbitmq
# Access management UI
open http://localhost:15672 # guest/guest
# Restart container
podman restart mentorme-rabbitmqpodman logs mentorme-postgres
podman logs mentorme-rabbitmq
podman logs -f mentorme-postgres # Follow modepodman stop mentorme-postgres mentorme-rabbitmqpodman rm mentorme-postgres mentorme-rabbitmqpodman restart mentorme-postgres mentorme-rabbitmqpodman psScript creates .env from .env.example with localhost overrides. You can modify:
# Example: Use different CLIP model
CLIP_MODEL=ViT-B/32 # Smaller, faster model (512D)
# Example: Enable GPU
CLIP_DEVICE=cuda
# Example: Enable pgvector instead of FAISS
USE_PGVECTOR=true- System environment variables (highest)
.envfileconfig.pydefaults (lowest)
Does not start the application - You must run python app.py and uvicorn api:app
Does not seed reference images - Use ./seeding/seed-data.sh or python seeding/seed_ref_images.py
Does not expose port 8000 - Only exposed when API is running
Does not use Docker Compose - Uses Podman containers directly
| Feature | This Script | Docker Compose |
|---|---|---|
| Tool | Podman | Docker |
| Python App | Runs on host | Runs in container |
| Development | Faster (direct edits) | Requires rebuild |
| Debugging | Native debugger | Remote debugging |
| Production | Not recommended | Best practice |
| Dependencies | Installed on host | Isolated in container |
# Complete automated setup
./start-dev-env.sh --full-setup
# Start worker
source venv/bin/activate
python app.py
# In another terminal, start API
source venv/bin/activate
uvicorn api:app --host 0.0.0.0 --port 8000# Containers already exist, just start them
podman start mentorme-postgres mentorme-rabbitmq
# Activate venv and run
source venv/bin/activate
python app.py# Stop and remove everything
podman stop mentorme-postgres mentorme-rabbitmq
podman rm mentorme-postgres mentorme-rabbitmq
# Run script again
./start-dev-env.sh --full-setup-
(Optional) Seed reference images:
./seeding/seed-data.sh --ref-images # Or directly: python seeding/seed_ref_images.py --directory data/reference_images -
Test the system:
python tests/simulation_e2e.py --vm-ip localhost \ --image https://example.com/test.jpg \ --student-id ST001 --assign-id A001
-
Access API documentation:
- OpenAPI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
-
Monitor queues:
- RabbitMQ UI: http://localhost:15672
- Documentation: See
DOCUMENTATION.mdfor complete system documentation - Issues: Check logs in
logs/directory - Database: Connect with any PostgreSQL client to
localhost:5432
Last Updated: November 6, 2025
Version: 1.0.0