A containerized web application for collecting MOC (Managed Operations Center) project intake requests with SQLite storage.
- π Web Form: User-friendly intake form with interactive example text
- πΎ SQLite Database: Local persistent storage for submissions
- π Admin View: Browse and review submitted intake requests
- π₯ Health Check: Container health monitoring endpoint
- π Security: Automated security scanning (SAST, dependency, container, secrets)
- β Quality: Automated testing, linting, and code quality checks
- π³ Containerized: Production-ready Docker deployment
- Docker and Docker Compose
- Python 3.12+ (for local development)
- Git
# Build and start the application
docker-compose up --build
# Access the application
# - Form: http://localhost:8000
# - Admin View: http://localhost:8000/admin.html
# - Health Check: http://localhost:8000/api/health
# - API Docs: http://localhost:8000/docs# Install dependencies
pip install -r requirements.txt
# Run the application
uvicorn backend.src.app:app --reload --host 0.0.0.0 --port 8000
# Run tests
pytest --cov=backend/src --cov-report=term
# Run security scans
pip-audit -r requirements.txt
bandit -r backend/src/ -c .bandit
# Check code quality
black backend/src/
ruff check backend/src/
radon cc backend/src/ -a -s# Install pre-commit
pip install pre-commit
# Install git hooks
pre-commit install
# Run manually
pre-commit run --all-files- Backend: FastAPI 0.120+, Python 3.12
- Database: SQLite 3.45+ with SQLAlchemy 2.0 ORM
- Frontend: Vanilla HTML/CSS/JavaScript (zero dependencies)
- Container: Multi-stage Docker build with Alpine Linux
- CI/CD: GitHub Actions for testing, linting, and security scanning
.
βββ backend/
β βββ src/
β β βββ api/ # API routes and middleware
β β βββ models/ # SQLAlchemy models and Pydantic schemas
β β βββ services/ # Database and business logic
β βββ tests/
β βββ unit/ # Unit tests (isolated, in-memory DB)
β βββ integration/ # Integration tests (full stack)
βββ frontend/
β βββ index.html # Intake form
β βββ admin.html # Admin view
β βββ static/ # CSS and JavaScript
βββ data/ # SQLite database (Docker volume)
βββ docs/ # Additional documentation
βββ .github/workflows/ # CI/CD pipelines
βββ specs/ # Feature specifications
POST /api/submissions- Submit a new intake requestGET /api/submissions- List all submissions (with pagination)GET /api/submissions/{id}- Get a specific submissionGET /api/health- Health check with database connectivity
See /docs for interactive API documentation.
This project adheres to the Project Constitution:
- All functions β€50 lines
- Cyclomatic complexity β€10 (actual: avg 1.5)
- Automated linting (Ruff) and formatting (Black)
- Multi-stage Docker build (45 MB production image)
- Non-root user (UID 1000)
- Health check endpoint
- Environment variable configuration
- Test coverage β₯80%
- Tests run in <5 seconds
- TDD approach with isolated unit tests
- CI/CD automated testing
- Bandit SAST scan (Python code)
- pip-audit (dependency vulnerabilities)
- Trivy (container image scan)
- Gitleaks (secret detection)
- Pre-commit hooks for prevention
- Branch: Create feature branch from
main - Develop: Write tests first (TDD), implement feature
- Test: Run tests locally, ensure coverage β₯80%
- Quality: Run linters, formatters, complexity checks
- Security: Verify security scans pass
- Commit: Pre-commit hooks run automatically
- Push: CI/CD runs full test suite + security scans
- Review: Create PR, await approval
- Merge: Squash and merge to
main
# Run all unit tests
pytest backend/tests/unit/
# Run with coverage
pytest --cov=backend/src --cov-report=html
# View coverage report
open htmlcov/index.html# Run integration tests
pytest backend/tests/integration/Per Constitutional Principle III, the test suite must complete in <5 seconds:
# Time the test suite
time pytest --quiet --tb=noSee SECURITY.md for detailed security scanning documentation.
- Critical: 24 hours
- High: 7 days
- Medium: 30 days
- Low: Best effort
Please report security vulnerabilities via GitHub Security Advisories or email.
See CONTRIBUTING.md for development guidelines.
Copyright Β© 2026 RHR. All rights reserved.
# Reset database
docker-compose down -v
docker-compose up --build# Clear pytest cache
rm -rf .pytest_cache/
# Reinstall dependencies
pip install -r requirements.txt --force-reinstall# Clean Docker cache
docker system prune -af
# Rebuild without cache
docker-compose build --no-cacheFor questions or issues:
- Open a GitHub issue
- Check the documentation
- Review the specification