Add README, update docker-compose and CLAUDE.md
Docker runs on port 4041 alongside local dev on 4000. Include btcdata docker-compose for unified startup. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
# btcprice
|
# btcprice
|
||||||
|
|
||||||
Bitcoin price tracker UI — Clojure Kit web application. Serves the HTML/HTMX/Tailwind UI. Connects to btcdata for live price data via SSE.
|
Bitcoin price tracker UI — Clojure Kit web application. Serves the HTML/Tailwind UI. Connects to btcdata for live price data via SSE.
|
||||||
|
|
||||||
## Build & Development Commands
|
## Build & Development Commands
|
||||||
|
|
||||||
@@ -9,6 +9,18 @@ Bitcoin price tracker UI — Clojure Kit web application. Serves the HTML/HTMX/T
|
|||||||
- `make test` — Run tests
|
- `make test` — Run tests
|
||||||
- `make tailwind` — Watch Tailwind CSS for changes
|
- `make tailwind` — Watch Tailwind CSS for changes
|
||||||
- `make uberjar` — Build production JAR
|
- `make uberjar` — Build production JAR
|
||||||
|
- `docker compose up -d` — Start btcprice + btcdata containers
|
||||||
|
|
||||||
|
## Docker
|
||||||
|
|
||||||
|
Docker runs alongside local dev on different ports:
|
||||||
|
|
||||||
|
| Service | Local dev | Docker |
|
||||||
|
|----------|----------------|----------------|
|
||||||
|
| btcprice | localhost:4000 | localhost:4041 |
|
||||||
|
| btcdata | localhost:4100 | localhost:4101 |
|
||||||
|
|
||||||
|
btcprice's docker-compose includes btcdata via `include: ../btcdata/docker-compose.yml`.
|
||||||
|
|
||||||
## REPL Commands
|
## REPL Commands
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
# btcprice
|
||||||
|
|
||||||
|
Bitcoin price tracker UI. Serves an HTML page with live price updates streamed from [btcdata](../btcdata) via Server-Sent Events.
|
||||||
|
|
||||||
|
## Quick Start
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Start btcdata first (provides price data)
|
||||||
|
cd ../btcdata && make run
|
||||||
|
|
||||||
|
# Local dev
|
||||||
|
make run # starts on port 4000
|
||||||
|
make tailwind # watch Tailwind CSS (separate terminal)
|
||||||
|
|
||||||
|
# Docker (starts both btcprice + btcdata)
|
||||||
|
docker compose up -d # btcprice on 4041, btcdata on 4101
|
||||||
|
```
|
||||||
|
|
||||||
|
## Environment Variables
|
||||||
|
|
||||||
|
| Variable | Default | Description |
|
||||||
|
|---|---|---|
|
||||||
|
| `PORT` | `4000` | HTTP server port |
|
||||||
|
| `BTCDATA_URL` | `http://localhost:4100` | btcdata service URL (injected into browser JS) |
|
||||||
|
|
||||||
|
## How It Works
|
||||||
|
|
||||||
|
The server renders an HTML page that includes a vanilla JavaScript `EventSource` connecting directly to btcdata's SSE endpoint (`BTCDATA_URL/api/price/stream`). Price updates are rendered client-side with color-coded changes (green up, red down).
|
||||||
|
|
||||||
|
## Tech Stack
|
||||||
|
|
||||||
|
Clojure · Kit · Undertow · Reitit · Hiccup · Tailwind CSS v4
|
||||||
+6
-17
@@ -1,22 +1,11 @@
|
|||||||
services:
|
include:
|
||||||
btcdata:
|
- path: ../btcdata/docker-compose.yml
|
||||||
build: ../btcdata
|
|
||||||
restart: unless-stopped
|
|
||||||
ports:
|
|
||||||
- "4100:4100"
|
|
||||||
environment:
|
|
||||||
BTCDATA_PORT: "4100"
|
|
||||||
JDBC_URL: "jdbc:postgresql://postgres:5432/btcprod?user=postgres&password=ratata,123"
|
|
||||||
CORS_ORIGIN: "http://localhost:4040"
|
|
||||||
extra_hosts:
|
|
||||||
- "postgres:host-gateway"
|
|
||||||
|
|
||||||
app:
|
services:
|
||||||
|
btcprice:
|
||||||
build: .
|
build: .
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
ports:
|
||||||
- "4040:4040"
|
- "4041:4040"
|
||||||
environment:
|
environment:
|
||||||
BTCDATA_URL: "http://btcdata:4100"
|
BTCDATA_URL: "http://localhost:4101"
|
||||||
depends_on:
|
|
||||||
- btcdata
|
|
||||||
|
|||||||
Reference in New Issue
Block a user