Scaffold and Phase 1

This commit is contained in:
2026-05-02 19:46:42 -05:00
parent ab74e7cad4
commit d909cb7c30
92 changed files with 4967 additions and 0 deletions
+61
View File
@@ -0,0 +1,61 @@
# Ops Deployment & Network Guide
## Docker Compose (production)
```bash
cp .env.example .env
# Fill in all values in .env
docker compose up -d
# Server: http://localhost:3001
# Client: http://localhost:8080
```
Run migrations after first boot:
```bash
docker compose exec server node -e "require('./dist/lib/prisma').prisma.\$executeRaw\`SELECT 1\`"
# or directly:
docker compose run --rm server npx prisma migrate deploy
```
## Development (local)
```bash
# Start DB + Redis only
docker compose -f docker-compose.dev.yml up -d
# Install dependencies
npm install
# Generate Prisma client
npm run db:generate
# Run first migration
npm run db:migrate
# Seed demo data
npm run db:seed
# Start both server and client with hot-reload
npm run dev
```
Client: http://localhost:5173
Server: http://localhost:3001
Prisma Studio: `npm run db:studio`
## Unraid Deployment
1. Place the repo in `/mnt/user/appdata/storybid/`.
2. Copy `.env.example``.env` and fill in all values.
3. From the Unraid terminal: `docker compose up -d`
4. Optionally add a **Community Applications** custom app pointing to `docker-compose.yml`.
## UniFi Event-Network Setup
See [unifi-dns.md](./unifi-dns.md) for step-by-step instructions to:
- Create a dedicated event SSID.
- Add a local DNS record (`auction.event.lan` → server LAN IP).
- Configure the `LOCAL_HOSTNAME` env var so the app can fail over to it.
+49
View File
@@ -0,0 +1,49 @@
# UniFi Event-Network Setup
## Goal
When the WAN link degrades during an event, bidder devices on the event Wi-Fi
should automatically fall back to the on-site server over the local LAN, with
no visible interruption beyond the connectivity banner turning yellow.
## Steps
### 1 Note the server's LAN IP
Find the static or DHCP-reserved IP for the event server on your UniFi network
(e.g. `192.168.1.50`). Set a DHCP reservation so it never changes.
### 2 Create a local DNS record
In **UniFi Network → Settings → Networks → DNS Records** (or **Local DNS** in
older firmware), add:
| Hostname | IP |
|-----------------------|----------------|
| `auction.event.lan` | `192.168.1.50` |
Set this same hostname in `.env`:
```
LOCAL_HOSTNAME=auction.event.lan
```
### 3 Create a dedicated event SSID
- SSID name: e.g. `GalaAuction`
- Password: share on the event program or check-in desk
- VLAN: optional; keep on the same LAN as the server
- Band steering: enable for cleaner 5 GHz preference
### 4 Test failover
1. Join `GalaAuction` on a test device.
2. Confirm `https://bid.example.org` loads normally (WAN path).
3. Disconnect the WAN cable or block WAN traffic in UniFi.
4. Confirm the connectivity banner turns yellow ("Local network offline-capable").
5. Confirm bidding still works — bids are accepted via `auction.event.lan`.
### 5 Battery backup
Plug the server, UniFi gateway, and all access points into a UPS. A 10-minute
runtime is enough to survive a generator switchover or brief power blip.