# MechBase PLC — Project Context
## Critical Paths (DO NOT GUESS)
| What | Path | Notes |
|---|---|---|
| Source | `~/projects/mechbase-plc/` | Flask backend + C++ interpreter |
| Venv | `venv/` | Python 3.13 — **NOT** `.venv/` |
| App | `app.py` | Flask, runs on port **5003** |
| L5X parser | `src/l5x_parser.py` | Parses Allen-Bradley .L5X XML files |
| Ladder test | `src/ladder_test.py` | Ladder logic testing utilities |
| Static UI | `static/` | CSS, JS for in-app UI |
| Templates | `templates/` | Jinja2 HTML templates |
| Tests | `tests/`, `test_server.py` | Test suite |
## Run
```bash
cd ~/projects/mechbase-plc && source venv/bin/activate
python app.py
```
## Port Conflict Warning
- MechBase uses port **5003** — same as Command Sovereignty.
- Do NOT run both simultaneously.
## Architecture
- Serves the UI, handles API calls, runs the ladder interpreter
- L5X files are XML-based Allen Bradley PLC program format
- C++ interpreter for ladder logic execution