A local web app that runs at http://localhost:8080.
All data is stored in a PostgreSQL database (arena).
brew install postgresql@17
brew services start postgresql@17PostgreSQL starts automatically on login — no manual start needed after this.
echo 'export PATH="/opt/homebrew/opt/postgresql@17/bin:$PATH"' >> ~/.zshrc
source ~/.zshrccreatedb arenapip3 install -r requirements.txtCopy the example file and edit it:
cp .env.example .envBy default the app connects to postgresql://localhost/arena.
Set DATABASE_URL in .env to override (e.g. remote server).
python3 app.py| URL | Description |
|---|---|
| http://localhost:8080 | Antenna mapper UI |
| http://localhost:8080/db | Read-only database viewer |
| http://localhost:8080/api/health | Health / connectivity check |
arena-app/
├── app.py Entry point — Flask app factory, starts server
├── config.py Configuration (reads DATABASE_URL from env / .env)
├── models.py SQLAlchemy models + database helper functions
├── routes/
│ ├── api.py REST API blueprint (/api/*)
│ └── views.py HTML page routes (/, /floorplan, /db)
├── templates/
│ ├── index.html Main SPA — HTML structure only
│ └── db.html Database viewer page
├── static/
│ ├── css/main.css All styles (design tokens, layout, components)
│ ├── js/app.js Antenna grid, floor plan, USRP rack, form logic
│ ├── js/phone.js Draggable phone marker
│ └── img/
│ └── floorplan.svg Floor plan image
├── .env.example Environment variable template
├── requirements.txt Python dependencies
└── README.md
Open a session:
psql arenaUseful commands inside psql:
| Command | What it does |
|---|---|
\dt |
List tables |
SELECT * FROM antenna_mappings; |
View all mappings |
SELECT * FROM phone_positions; |
View phone position |
\q |
Quit |
Backup / restore:
pg_dump arena > arena_backup.sql # backup
psql arena < arena_backup.sql # restore| Method | Path | Description |
|---|---|---|
| GET | /api/mappings |
Return all antenna mappings |
| POST | /api/mappings |
Replace all antenna mappings |
| GET | /api/phones |
Return phone marker position |
| POST | /api/phones |
Update phone marker position |
| GET | /api/export/json |
Download config as JSON |
| GET | /api/export/csv |
Download config as CSV |
| GET | /api/health |
DB connectivity check |
antenna_mappings — one row per configured antenna
| Column | Type | Notes |
|---|---|---|
antenna_id |
text PK | e.g. AR2_A1 |
p1_serial |
text | USRP IP, Port 1 |
p1_model |
text | X410, X310, … |
p1_port |
text | A:0, B:1, … |
p2_serial |
text | USRP IP, Port 2 |
p2_model |
text | |
p2_port |
text |
phone_positions — single row for the draggable phone marker
| Column | Type | Notes |
|---|---|---|
id |
integer PK | always 1 |
left |
float | % of floor plan width |
top |
float | % of floor plan height |