Repository navigation
Local Development and Environment Setup
Vicky Patel edited this page Nov 19, 2026
·
1 revision
Complete Installation Runbook for Windows, macOS, and Linux
Before setting up SafaiOS locally, ensure the following core tools are installed:
| Tool | Minimum Version | Purpose |
|---|---|---|
| Git | 2.38+ |
Source control management and branching |
| Python | 3.11.x |
Core ML runtime, dataset pipelines, and regression tests |
| Docker Desktop |
4.x+ (Linux engine) |
Local Supabase stack (Postgres 17, Storage, Auth, Studio) |
| Supabase CLI | 2.x+ |
Local database migrations, pgTAP tests, and linter |
git clone https://github.com/TheVicky1/Safai_OS.git
cd Safai_OS# Create dedicated virtual environment
python3.11 -m venv .venv
source .venv/bin/activate
# Upgrade pip and install package in editable development mode
pip install --upgrade pip
pip install -e ".[dev]"# Run all 151 unit and regression tests
pytest tests/ -vcp .env.example .envWindows development requires special attention to execution policies and Docker Desktop WSL integration.
If PowerShell blocks virtual environment activation scripts, run this one-time command in PowerShell:
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned# In PowerShell:
git clone https://github.com/TheVicky1/Safai_OS.git
cd Safai_OS
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install --upgrade pip
pip install -e ".[dev]"
# Run tests
pytest tests/ -vOn Windows, Docker Desktop requires the WSL 2 backend (Virtual Machine Platform):
-
Verify WSL status:
wsl --status - If WSL is not enabled, open an Elevated (Administrator) PowerShell and run:
wsl --install --no-distribution dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
- Restart your computer.
- Launch Docker Desktop and verify that
docker inforeturns server information.
Once Docker is running, you can launch the complete local backend in seconds:
# 1. Start local Supabase containers (PostgreSQL 17, Storage, Auth, Studio)
supabase start
# 2. Apply all schema migrations and seeds to local Postgres
supabase db reset
# 3. Execute the 24-point pgTAP security and RLS test suite
supabase test db
# 4. Run database lint checks
supabase db lint --level error --fail-on error- Supabase Studio (Web UI): http://localhost:54323
- REST API Gateway: http://localhost:54321
-
Local PostgreSQL Connection:
postgresql://postgres:postgres@localhost:54322/postgres
Before committing changes, execute the local quality gates:
# 1. Python ML & core unit test matrix
pytest tests/ -v
# 2. Database authorization tests (requires supabase start)
supabase test db
# 3. Database linting
supabase db lint --level error --fail-on error- π Vision & Civic Impact
- ποΈ System Architecture
- π€ Computer Vision & YOLO11s
- ποΈ Database & Security Foundation
- π Incident Lifecycle & Verification
- πͺ Safai Coins & Civic Ledger
- π± Contributor Guide & Issues
- π» Local Development Setup
- π§ͺ Testing & Quality Gates
- π§ Troubleshooting & FAQ