Initial commit: homelab infrastructure wiki
- Full Obsidian vault content - Host configs (ice, grizzley, ubuntu, proxmox, truenas, panda, hyte) - Media stack documentation - Traefik HA setup - Automation scripts - Bachelor party planning
This commit is contained in:
89
bachelor-party/voting-app.md
Normal file
89
bachelor-party/voting-app.md
Normal file
@@ -0,0 +1,89 @@
|
||||
---
|
||||
title: Cabo Vote — Voting App
|
||||
type: concept
|
||||
tags: [bachelor-party, voting-app, deployment]
|
||||
created: 2026-04-30
|
||||
updated: 2026-05-04
|
||||
confidence: high
|
||||
---
|
||||
|
||||
# Cabo Vote — Bachelor Party Voting App
|
||||
|
||||
Real-time polling app for the Cabo bachelor party. Tracks votes and live prices.
|
||||
|
||||
## Service Details
|
||||
|
||||
| Property | Value |
|
||||
|----------|-------|
|
||||
| **Host** | ubuntu (192.168.50.61) |
|
||||
| **Container** | `reccollection-backend-local` (Node.js) |
|
||||
| **Port** | 3001 |
|
||||
| **URL** | cabo-vote.local.tophermayor.com |
|
||||
| **Traefik** | ubuntu:8080 → backend:3001 |
|
||||
| **Data dir** | `/home/bear/RecCollection/data` (bind mount) |
|
||||
| **Data file** | `votes.json` |
|
||||
|
||||
## Data Flow
|
||||
|
||||
```
|
||||
price-watch/history.jsonl ← scraped prices (two sources)
|
||||
│ ← manual promotion
|
||||
seed-data.js ← hardcoded via buildSeedData()
|
||||
│ ← server restart / reload
|
||||
votes.json ← app's authoritative data store
|
||||
│
|
||||
├──→ server.js ← Express API + WebSocket
|
||||
│
|
||||
└──→ cabo-vote.local ← served as static web app
|
||||
```
|
||||
|
||||
## API Endpoints
|
||||
|
||||
| Method | Endpoint | Description |
|
||||
|--------|----------|-------------|
|
||||
| GET | `/api/categories` | All poll categories |
|
||||
| GET | `/api/options` | All options with votes and prices |
|
||||
| GET | `/api/results` | Aggregated vote counts |
|
||||
| GET | `/` | Static web UI |
|
||||
|
||||
## Key Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `voting_app/server.js` | Express server, WebSocket, API routes |
|
||||
| `voting_app/seed-data.js` | Hardcoded seed prices, `buildSeedData()` |
|
||||
| `voting_app/data/votes.json` | Persisted votes and prices |
|
||||
| `voting_app/price-watch/history.jsonl` | Raw scraped price history |
|
||||
| `voting_app/price-watch/latest-report.md` | Most recent scrape report |
|
||||
|
||||
## Price Update Process
|
||||
|
||||
1. **Scrape** — Agent (MacBook Codex or grizzley Hermes) scrapes travel sites → `history.jsonl`
|
||||
2. **Promote** — Manual step: extract prices from report, edit `buildSeedData()` in `seed-data.js`
|
||||
3. **Restart** — Server reloads: `mergeSeedData()` merges new seed with preserved votes → `votes.json`
|
||||
4. **Serve** — Fresh prices appear in the UI and API
|
||||
|
||||
The `mergeSeedData()` function preserves existing votes when reloading — only the price data from `buildSeedData()` is refreshed.
|
||||
|
||||
## Seed Version
|
||||
|
||||
Current: **v5** (April 29, 2026)
|
||||
|
||||
## Deployment
|
||||
|
||||
The app is not containerized separately — it runs as the `reccollection-backend-local` container on ubuntu. It was originally a RecCollection app repurposed for the bachelor party.
|
||||
|
||||
To check the container:
|
||||
```bash
|
||||
ssh bear@ubuntu "docker ps | grep reccollection"
|
||||
```
|
||||
|
||||
To restart (reload prices from votes.json):
|
||||
```bash
|
||||
ssh bear@ubuntu "docker restart reccollection-backend-local"
|
||||
```
|
||||
|
||||
## Related
|
||||
|
||||
- [[bachelor-party/project|Project Overview]]
|
||||
- [[bachelor-party/data-sources|Data Sources]] — Two-agent price tracking
|
||||
Reference in New Issue
Block a user