32 lines
968 B
Markdown
32 lines
968 B
Markdown
# AGENTS.md
|
|
|
|
## Project Overview
|
|
|
|
Single-file Go HTTP server for electronic signature capture and archiving. Frontend HTML is embedded into the Go binary via `//go:embed`.
|
|
|
|
## Build & Run
|
|
|
|
```bash
|
|
# Local development
|
|
go run main.go
|
|
# Server starts on port 10081
|
|
|
|
# Cross-compile (Windows/Linux)
|
|
build.bat
|
|
# Outputs to dist/ with timestamped filenames
|
|
```
|
|
|
|
## Architecture
|
|
|
|
- `main.go` — Entire backend. Embeds `index.html`, serves it at `/`, handles `POST /upload` to save base64 PNGs to `uploads/<name>/<name>+<date>.png`
|
|
- `index.html` — Standalone frontend (Tailwind CDN, Phosphor Icons, canvas-based signature)
|
|
- `uploads/` — Runtime signature storage (gitignored)
|
|
|
|
## Key Constraints
|
|
|
|
- No `go.mod` present — initialize one if adding dependencies
|
|
- No tests exist
|
|
- Frontend uses CDN resources (Tailwind, Phosphor Icons) — no local build step
|
|
- Upload handler validates name non-empty, strips base64 prefix, saves as PNG
|
|
- Port is hardcoded to `:10081`
|