- JavaScript 56.7%
- Python 29.8%
- Gherkin 11.8%
- Dockerfile 1%
- HTML 0.4%
- Other 0.3%
|
Some checks failed
Stage Router CI Pipeline / isort and Black (Python) (push) Failing after 43s
Stage Router CI Pipeline / ESLint (React) (push) Failing after 41s
Stage Router CI Pipeline / Pytest (FastAPI) (push) Failing after 3s
Stage Router CI Pipeline / Newman (Docker Compose) (push) Has been skipped
Signed-off-by: Daniel Díaz <yosoy@danieldiaz.org> |
||
|---|---|---|
| .forgejo/workflows | ||
| backend | ||
| docs | ||
| features | ||
| frontend | ||
| tests | ||
| .gitignore | ||
| docker-compose.yml | ||
| GEMINI.md | ||
| README.md | ||
Stage Router
A full-stack, containerized application designed to manage live stage plots, automate audio routing, and track hardware endpoints for theatrical productions and live events.
Built with a focus on strict data validation, test-driven development, and modular 2D spatial interfaces.
Quick Start
The entire environment is containerized. You do not need Node or Python installed on your host machine to run the application.
-
Clone the repository:
git clone https://git.sunokaj3.com/daniel/stagerouter.git cd stagerouter -
Set your Pre-Shared Key (Optional but recommended): The application is secured via a Pre-Shared Key (PSK). By default, it is set to
coro. You can override this by exporting an environment variable before starting Docker:export STAGE_ROUTER_PSK="your_custom_password" -
Spin up the stack:
docker compose up -d --build -
Access the Application:
- Frontend UI:
http://localhost:13000 - Backend API Docs:
http://localhost:18080/docs
- Frontend UI:
Architecture Stack
- Frontend: React, Vite,
@dnd-kit/core(Drag and Drop) - Backend: Python 3.11, FastAPI, SQLModel (SQLite)
- Testing: Pytest (Unit/Coverage), Newman (API Contract Testing)
- DevOps: Docker Compose, Forgejo Actions (CI Pipeline)
Security Model
This application uses a stateless Pre-Shared Key (PSK) authentication model.
- The backend protects all
/api/v1/endpoints by looking for theX-Stage-Keyheader. - The frontend intercepts unauthenticated traffic, presents a full-screen login prompt, and securely stores the key in
localStorageto append to future Axios requests.
Testing Strategy
The project maintains a strict 100% test coverage requirement for core routing logic and API endpoints.
Backend Unit Tests: Pytest
Run the Python white-box tests and generate a coverage report:
docker compose exec backend python -m pytest --cov=. --cov-report=term-missing -v
API Contract Tests: Newman
Run the Postman black-box tests against the live Docker network to verify HTTP routing and JSON serialization:
docker compose exec e2e-tests npx newman run /tests/api/stage_router.postman_collection.json -e /tests/api/docker.postman_environment.json
Frontend Linting: ESLint
Ensure React best practices and prevent cascading render loops:
docker compose exec frontend npx eslint src/**/*.jsx
Continuous Integration (CI)
This repository includes a .forgejo/workflows/ci.yml pipeline. Upon every push or pull request to the main branch, the Forgejo runner will automatically:
- Check frontend code syntax using ESLint.
- Run Pytest and fail the build if coverage drops below 95%.
- Spin up the Docker stack and run Newman contract tests against the live API.
Project Structure
stagerouter/
├── backend/
│ ├── main.py # FastAPI application and routing
│ ├── models.py # SQLModel schemas and database entities
│ ├── routing.py # Core audio routing math and logic
│ ├── tests/ # Pytest suite
│ └── requirements.txt
├── frontend/
│ ├── src/
│ │ ├── App.jsx # Master DndContext and state manager
│ │ ├── api/client.js # Axios instance with PSK interceptor
│ │ └── components/ # React components (Performer, Snake, Login)
│ └── package.json
├── tests/ # End-to-End and Contract testing assets
│ └── api/ # Postman collections and environments
├── .forgejo/workflows/ # CI/CD Pipeline definitions
└── docker-compose.yml # Infrastructure orchestration
License
This project is licensed under the MIT License - see the LICENSE file for details.