Split data layer into btcdata service

Remove DB, Binance WebSocket, and Kraken pollers from btcprice.
UI now uses vanilla EventSource connecting to btcdata for live
price updates. btcprice is now a pure UI service with no database.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-23 20:07:48 +01:00
co-authored by Claude Opus 4.6
parent c688846a26
commit 397d9f7b5c
21 changed files with 69 additions and 580 deletions
+7 -11
View File
@@ -1,15 +1,14 @@
# btcprice
Bitcoin price tracker - Clojure Kit web application.
Bitcoin price tracker UI — Clojure Kit web application. Serves the HTML/HTMX/Tailwind UI. Connects to btcdata for live price data via SSE.
## Build & Development Commands
- `make run` — Start dev server on port 3000
- `make repl` — Start nREPL on port 7888
- `make run` — Start dev server on port 4000
- `make repl` — Start nREPL
- `make test` — Run tests
- `make tailwind` — Watch Tailwind CSS for changes
- `make uberjar` — Build production JAR
- `docker compose up -d` — Start PostgreSQL
## REPL Commands
@@ -18,10 +17,6 @@ Bitcoin price tracker - Clojure Kit web application.
(go) ;; Start system
(reset) ;; Reload code & restart
(halt) ;; Stop system
(reset-db) ;; Drop & re-migrate database
(migrate) ;; Run pending migrations
(rollback) ;; Rollback last migration
(query-fn) ;; Get database query function
```
## Architecture
@@ -29,9 +24,10 @@ Bitcoin price tracker - Clojure Kit web application.
- **Framework:** Kit (Integrant-based)
- **Server:** Undertow
- **Routing:** Reitit
- **Templates:** Hiccup + HTMX
- **Templates:** Hiccup + vanilla JS EventSource
- **Styling:** Tailwind CSS v4
- **Database:** PostgreSQL + conman + Migratus
- **Data backend:** btcdata (separate service at BTCDATA_URL, default http://localhost:4100)
- **No database** — all data comes from btcdata
## Source Layout
@@ -50,6 +46,6 @@ src/clj/pmagnus/btcprice/
│ └── formats.clj # Content negotiation
└── routes/
├── api.clj # /api routes (JSON)
├── ui.clj # UI routes (HTML)
├── ui.clj # UI routes (HTML + EventSource)
└── utils.clj # Route utilities
```