fmt: apply prettier to Markdown and doc files

This commit is contained in:
KS Jannette
2026-02-28 20:07:47 -05:00
parent da8b45012a
commit 62e6c64ddb
5 changed files with 54 additions and 44 deletions

View File

@@ -49,10 +49,10 @@ The API listens on `http://localhost:3001` and the frontend on
## Rationale ## Rationale
Crypto users who hold or actively monitor addresses need a lightweight, Crypto users who hold or actively monitor addresses need a lightweight, reliable
reliable way to know when on-chain activity occurs without polling block way to know when on-chain activity occurs without polling block explorers
explorers manually. Koin Ping fills that gap: it watches a set of Ethereum manually. Koin Ping fills that gap: it watches a set of Ethereum addresses,
addresses, evaluates configurable alert rules (incoming transactions, outgoing evaluates configurable alert rules (incoming transactions, outgoing
transactions, large transfers, balance thresholds), and notifies the user transactions, large transfers, balance thresholds), and notifies the user
through Discord webhooks. through Discord webhooks.
@@ -91,9 +91,9 @@ koin_ping_0.2.0/
authentication middleware. Exposes CRUD endpoints for addresses, alert rules, authentication middleware. Exposes CRUD endpoints for addresses, alert rules,
alert events, and notification configuration. alert events, and notification configuration.
**Poller** (`cmd/poller`): long-running daemon that polls Ethereum via **Poller** (`cmd/poller`): long-running daemon that polls Ethereum via JSON-RPC,
JSON-RPC, compares observed transactions against persisted alert rules, fires compares observed transactions against persisted alert rules, fires alert events
alert events to the database, and dispatches Discord notifications. to the database, and dispatches Discord notifications.
**Frontend** (`frontend/`): React 19 SPA built with Vite. Authenticates with **Frontend** (`frontend/`): React 19 SPA built with Vite. Authenticates with
Firebase, communicates with the API via fetch, and renders the address/alert Firebase, communicates with the API via fetch, and renders the address/alert
@@ -101,17 +101,17 @@ management UI.
## TODO ## TODO
- [ ] Switch frontend package manager from npm to yarn (per repo policy) - [ ] Switch frontend package manager from npm to yarn (per repo policy)
- [ ] Rename `go.mod` module path from `github.com/kjannette/koin-ping` to - [ ] Rename `go.mod` module path from `github.com/kjannette/koin-ping` to
`sneak.berlin/go/koin-ping` (per repo policy) `sneak.berlin/go/koin-ping` (per repo policy)
- [ ] Move database migrations to `internal/db/migrations/` and embed them - [ ] Move database migrations to `internal/db/migrations/` and embed them in
in the binary the binary
- [ ] Pin all Docker base images by `@sha256` in Dockerfile - [ ] Pin all Docker base images by `@sha256` in Dockerfile
- [ ] Install `golangci-lint` locally and pass `make lint` - [ ] Install `golangci-lint` locally and pass `make lint`
- [ ] Add vitest unit tests for the React frontend - [ ] Add vitest unit tests for the React frontend
- [ ] Add a `make db-reset` / `make migrate` target for schema management - [ ] Add a `make db-reset` / `make migrate` target for schema management
- [ ] Set HTTP server read/write timeouts (currently unbounded) - [ ] Set HTTP server read/write timeouts (currently unbounded)
- [ ] Replace `log.Printf` calls with structured `log/slog` - [ ] Replace `log.Printf` calls with structured `log/slog`
## License ## License

View File

@@ -145,13 +145,13 @@ style conventions are in separate documents:
- Database migrations live in `internal/db/migrations/` and must be embedded in - Database migrations live in `internal/db/migrations/` and must be embedded in
the binary. the binary.
- `000_migration.sql` — contains ONLY the creation of the migrations tracking - `000_migration.sql` — contains ONLY the creation of the migrations
table itself. Nothing else. tracking table itself. Nothing else.
- `001_schema.sql` — the full application schema. - `001_schema.sql` — the full application schema.
- **Pre-1.0.0:** never add additional migration files (002, 003, etc.). There - **Pre-1.0.0:** never add additional migration files (002, 003, etc.).
is no installed base to migrate. Edit `001_schema.sql` directly. 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. - **Post-1.0.0:** add new numbered migration files for each schema change.
Never edit existing migrations after release. Never edit existing migrations after release.
- All repos should have an `.editorconfig` enforcing the project's indentation - All repos should have an `.editorconfig` enforcing the project's indentation
settings. settings.

View File

@@ -37,16 +37,20 @@ cp ENV_TEMPLATE.md .env
## Firebase Setup ## 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)** **Option 1: Use Firebase Project ID (easiest for development)**
- Just set `FIREBASE_PROJECT_ID` in .env - Just set `FIREBASE_PROJECT_ID` in .env
- Firebase Admin will use Application Default Credentials - Firebase Admin will use Application Default Credentials
**Option 2: Use Service Account Key (production)** **Option 2: Use Service Account Key (production)**
1. Go to Firebase Console > Project Settings > Service Accounts 1. Go to Firebase Console > Project Settings > Service Accounts
2. Click "Generate new private key" 2. Click "Generate new private key"
3. Download the JSON file 3. Download the JSON file
4. Either: 4. Either:
- Set `GOOGLE_APPLICATION_CREDENTIALS=/path/to/serviceAccountKey.json` in .env - Set `GOOGLE_APPLICATION_CREDENTIALS=/path/to/serviceAccountKey.json` in
- Or keep it in backend/ and add to .gitignore .env
- Or keep it in backend/ and add to .gitignore

View File

@@ -1,4 +1,7 @@
Start DB:
brew services start postgresql@15
Run Backend: Run Backend:
cd /Users/kjannette/workspace/koin_ping/backend-go cd /Users/kjannette/workspace/koin_ping/backend-go go run ./cmd/api
go run ./cmd/api

View File

@@ -5,24 +5,27 @@ React + Vite frontend for the on-chain monitoring and alerting system.
## Getting Started ## Getting Started
1. Install dependencies: 1. Install dependencies:
```bash
npm install ```bash
``` npm install
```
2. Run the development server: 2. Run the development server:
```bash
npm run dev ```bash
``` npm run dev
```
3. Build for production: 3. Build for production:
```bash
npm run build ```bash
``` npm run build
```
4. Preview production build: 4. Preview production build:
```bash ```bash
npm run preview npm run preview
``` ```
## Project Structure ## Project Structure
@@ -34,5 +37,5 @@ React + Vite frontend for the on-chain monitoring and alerting system.
## Development ## 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.