Files
backend/docs/frontend-development.md
Andriy Oblivantsev ef3957b618
CI / test (push) Successful in 4s
Demo app, collections/features CRUD, QR codes, docs
Demo app (web/):
- Collections: select, rename, remove (x button per row), delete
- Features: add point (lon/lat validation), remove, list in selected collection
- QR codes for pk (private) and pb (public) keys
- Restore public key from private key
- 409 Conflict handled for already-registered login
- Title: Momswap Geo Backend Use-Cases Test

Backend:
- PATCH /v1/collections/{id} for rename
- DELETE /v1/collections/{id}
- Clearer lon/lat validation errors (-180..180, -90..90)

Client:
- updateCollection, deleteCollection, derivePublicKey

Docs:
- docs/frontend-development.md (demo app, local dev)
- README links to all docs

Made-with: Cursor
2026-03-01 13:41:54 +00:00

71 lines
1.9 KiB
Markdown

# Frontend Development
Development guide for the Momswap Geo demo app (`web/`) and TypeScript client (`libs/geo-api-client`).
## Demo app (`web/`)
Vue 3 + Vuetify 3 single-page app, no bundler. Served by the backend at `/web/`.
### Structure
```
web/
├── index.html # Entry page, Vue/Vuetify from CDN
├── app.js # Vue app, state, handlers
├── api.js # GeoApiClient wrapper for browser
└── qr.js # QR code generation (pk/pb keys)
```
### Running locally
1. Start the API:
```bash
go run ./cmd/api
# or: docker compose up -d
```
2. Open `http://localhost:8122/web/`
### Dependencies
- Vue 3 and Vuetify 3 from CDN (no npm install in `web/`)
- `libs/geo-api-client/dist/index.js` — built ESM client
- `qr.js` — imports `qrcode` from esm.sh
### Build step for client
The demo app uses the pre-built client. After changing `libs/geo-api-client`:
```bash
cd libs/geo-api-client
bun run build
```
With Docker, the image build runs this automatically.
### Features (use-cases test)
- Connection & Identity: API URL, key generation, pk/pb display, QR codes, restore pb from pk, register, login
- Collections: create, select, rename, remove
- Features: add point (lon/lat validation -180..180, -90..90), remove, list
## TypeScript client (`libs/geo-api-client`)
Reusable API client with Ed25519 signing. See [TypeScript Frontend Integration](typescript-frontend-integration.md) for full API and integration flow.
### Build & test
```bash
cd libs/geo-api-client
bun install
bun test
bun run build
```
## Related docs
| Document | Description |
|----------|-------------|
| [TypeScript Frontend Integration](typescript-frontend-integration.md) | API client usage, integration flow, examples |
| [Ed25519 Security Use Cases](ed25519-security-use-cases.md) | Auth flows, registration, signatures |
| [Geo Auth Backend Plan](geo-auth-backend-plan.md) | Architecture and planning |