Add README and server.py reference

This commit is contained in:
2026-06-13 10:04:52 +01:00
parent e48d80b192
commit 9d5d05725c
2 changed files with 138 additions and 0 deletions

63
README.md Normal file
View File

@@ -0,0 +1,63 @@
# Apple Form
Apple-style 3-field step-by-step customer form with FastAPI backend.
## Frontend
Single-file HTML (`index.html`) — zero dependencies, native system fonts.
- 3-step wizard: Email → Name → Domain
- Apple design system: `#f5f5f7` backgrounds, Apple Blue `#0071e3` accent, SF Pro typography
- Slide animations between steps, step-dot progress indicator
- SVG checkmark draw animation on success
- POSTs to the backend at `http://192.168.1.121:8080/api/submit`
### Open directly
```bash
firefox index.html
```
Or serve from an HTTP server:
```bash
python3 -m http.server 8000
```
## Backend
FastAPI server in a Proxmox LXC CT:
| Detail | Value |
|---|---|
| CT ID | 121 |
| Hostname | form-login |
| IP | 192.168.1.121 |
| Port | 8080 |
| Database | SQLite (`/srv/form-backend/submissions.db`) |
| Service | `form-backend.service` (enabled, auto-start) |
### Endpoints
| Method | Path | Description |
|---|---|---|
| POST | `/api/submit` | Submit form data `{email, name, domain}``{ok, id}` |
| GET | `/api/submissions` | List all submissions (JSON) |
| GET | `/health` | Health check |
### Test
```bash
curl http://192.168.1.121:8080/health
curl -X POST http://192.168.1.121:8080/api/submit \
-H 'Content-Type: application/json' \
-d '{"email":"jane@example.com","name":"Jane","domain":"example.io"}'
```
### Server code
`server.py` lives at `/srv/form-backend/server.py` on the CT.
```bash
ssh root@192.168.1.109 'pct exec 121 -- systemctl status form-backend'
```