diff --git a/README.md b/README.md index 7a4f46b..854f1bc 100644 --- a/README.md +++ b/README.md @@ -49,10 +49,10 @@ The API listens on `http://localhost:3001` and the frontend on ## Rationale -Crypto users who hold or actively monitor addresses need a lightweight, -reliable way to know when on-chain activity occurs without polling block -explorers manually. Koin Ping fills that gap: it watches a set of Ethereum -addresses, evaluates configurable alert rules (incoming transactions, outgoing +Crypto users who hold or actively monitor addresses need a lightweight, reliable +way to know when on-chain activity occurs without polling block explorers +manually. Koin Ping fills that gap: it watches a set of Ethereum addresses, +evaluates configurable alert rules (incoming transactions, outgoing transactions, large transfers, balance thresholds), and notifies the user through Discord webhooks. @@ -91,9 +91,9 @@ koin_ping_0.2.0/ authentication middleware. Exposes CRUD endpoints for addresses, alert rules, alert events, and notification configuration. -**Poller** (`cmd/poller`): long-running daemon that polls Ethereum via -JSON-RPC, compares observed transactions against persisted alert rules, fires -alert events to the database, and dispatches Discord notifications. +**Poller** (`cmd/poller`): long-running daemon that polls Ethereum via JSON-RPC, +compares observed transactions against persisted alert rules, fires alert events +to the database, and dispatches Discord notifications. **Frontend** (`frontend/`): React 19 SPA built with Vite. Authenticates with Firebase, communicates with the API via fetch, and renders the address/alert @@ -101,17 +101,17 @@ management UI. ## TODO -- [ ] Switch frontend package manager from npm to yarn (per repo policy) -- [ ] Rename `go.mod` module path from `github.com/kjannette/koin-ping` to - `sneak.berlin/go/koin-ping` (per repo policy) -- [ ] Move database migrations to `internal/db/migrations/` and embed them - in the binary -- [ ] Pin all Docker base images by `@sha256` in Dockerfile -- [ ] Install `golangci-lint` locally and pass `make lint` -- [ ] Add vitest unit tests for the React frontend -- [ ] Add a `make db-reset` / `make migrate` target for schema management -- [ ] Set HTTP server read/write timeouts (currently unbounded) -- [ ] Replace `log.Printf` calls with structured `log/slog` +- [ ] Switch frontend package manager from npm to yarn (per repo policy) +- [ ] Rename `go.mod` module path from `github.com/kjannette/koin-ping` to + `sneak.berlin/go/koin-ping` (per repo policy) +- [ ] Move database migrations to `internal/db/migrations/` and embed them in + the binary +- [ ] Pin all Docker base images by `@sha256` in Dockerfile +- [ ] Install `golangci-lint` locally and pass `make lint` +- [ ] Add vitest unit tests for the React frontend +- [ ] Add a `make db-reset` / `make migrate` target for schema management +- [ ] Set HTTP server read/write timeouts (currently unbounded) +- [ ] Replace `log.Printf` calls with structured `log/slog` ## License diff --git a/REPO_POLICIES.md b/REPO_POLICIES.md index a024cbd..a0abedf 100644 --- a/REPO_POLICIES.md +++ b/REPO_POLICIES.md @@ -145,13 +145,13 @@ style conventions are in separate documents: - Database migrations live in `internal/db/migrations/` and must be embedded in the binary. - - `000_migration.sql` — contains ONLY the creation of the migrations tracking - table itself. Nothing else. - - `001_schema.sql` — the full application schema. - - **Pre-1.0.0:** never add additional migration files (002, 003, etc.). There - is no installed base to migrate. Edit `001_schema.sql` directly. - - **Post-1.0.0:** add new numbered migration files for each schema change. - Never edit existing migrations after release. + - `000_migration.sql` — contains ONLY the creation of the migrations + tracking table itself. Nothing else. + - `001_schema.sql` — the full application schema. + - **Pre-1.0.0:** never add additional migration files (002, 003, etc.). + There is no installed base to migrate. Edit `001_schema.sql` directly. + - **Post-1.0.0:** add new numbered migration files for each schema change. + Never edit existing migrations after release. - All repos should have an `.editorconfig` enforcing the project's indentation settings. diff --git a/backend-go/ENV_TEMPLATE.md b/backend-go/ENV_TEMPLATE.md index 6992c7f..214ce14 100644 --- a/backend-go/ENV_TEMPLATE.md +++ b/backend-go/ENV_TEMPLATE.md @@ -37,16 +37,20 @@ cp ENV_TEMPLATE.md .env ## Firebase Setup -For Firebase Admin SDK to work, you need to set up Application Default Credentials: +For Firebase Admin SDK to work, you need to set up Application Default +Credentials: **Option 1: Use Firebase Project ID (easiest for development)** + - Just set `FIREBASE_PROJECT_ID` in .env - Firebase Admin will use Application Default Credentials **Option 2: Use Service Account Key (production)** + 1. Go to Firebase Console > Project Settings > Service Accounts 2. Click "Generate new private key" 3. Download the JSON file 4. Either: - - Set `GOOGLE_APPLICATION_CREDENTIALS=/path/to/serviceAccountKey.json` in .env - - Or keep it in backend/ and add to .gitignore + - Set `GOOGLE_APPLICATION_CREDENTIALS=/path/to/serviceAccountKey.json` in + .env + - Or keep it in backend/ and add to .gitignore diff --git a/backend-go/README.md b/backend-go/README.md index 8f6f137..dcf3e15 100644 --- a/backend-go/README.md +++ b/backend-go/README.md @@ -1,4 +1,7 @@ +Start DB: + +brew services start postgresql@15 + Run Backend: -cd /Users/kjannette/workspace/koin_ping/backend-go -go run ./cmd/api \ No newline at end of file +cd /Users/kjannette/workspace/koin_ping/backend-go go run ./cmd/api diff --git a/frontend/README.md b/frontend/README.md index ff3f869..701613b 100644 --- a/frontend/README.md +++ b/frontend/README.md @@ -5,24 +5,27 @@ React + Vite frontend for the on-chain monitoring and alerting system. ## Getting Started 1. Install dependencies: - ```bash - npm install - ``` + + ```bash + npm install + ``` 2. Run the development server: - ```bash - npm run dev - ``` + + ```bash + npm run dev + ``` 3. Build for production: - ```bash - npm run build - ``` + + ```bash + npm run build + ``` 4. Preview production build: - ```bash - npm run preview - ``` + ```bash + npm run preview + ``` ## Project Structure @@ -34,5 +37,5 @@ React + Vite frontend for the on-chain monitoring and alerting system. ## Development -The frontend runs on port 3000 and proxies API requests to the backend running on port 5000. - +The frontend runs on port 3000 and proxies API requests to the backend running +on port 5000.