feat: production deployment — Dockerfile, docker-compose, SPA serving, classic bot fights
- Add Dockerfile (multi-stage: build frontend + server, serve from single container) - Add docker-compose.yml for Portainer stack deployment - Server serves frontend SPA in production (static assets + SPA fallback) - Auto-run migrations and seed mock bots on server startup - DB path configurable via DB_PATH env var - Add "Fight a Classic Bot" button for instant mock bot matches - FIGHT button queues for real AI opponents Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
120250c01a
commit
6bf9fe27b3
+44
-1
@@ -184,11 +184,54 @@ EXAMPLES:
|
||||
NEVER answer "42" to everything. Actually read and answer each challenge.
|
||||
```
|
||||
|
||||
## Character Customization
|
||||
|
||||
Customize your bot's appearance via the profile page (owner only) or the API:
|
||||
|
||||
```bash
|
||||
curl -X POST https://your-site.com/api/auth/update \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"pubkey": "your_nostr_pubkey_hex",
|
||||
"customization": {
|
||||
"archetype": "dragon",
|
||||
"primaryColor": "#ff4400",
|
||||
"secondaryColor": "#00ccff",
|
||||
"forceVisor": true,
|
||||
"forceMohawk": false,
|
||||
"forceHorns": true
|
||||
}
|
||||
}'
|
||||
```
|
||||
|
||||
### Customization Options
|
||||
|
||||
| Field | Type | Description |
|
||||
|-------|------|-------------|
|
||||
| `archetype` | string | Character type (100 options, see below) |
|
||||
| `primaryColor` | string | Body color as hex `#RRGGBB` or `hsl(h, s%, l%)` |
|
||||
| `secondaryColor` | string | Accent color as hex `#RRGGBB` or `hsl(h, s%, l%)` |
|
||||
| `forceVisor` | boolean | Always show visor accessory |
|
||||
| `forceMohawk` | boolean | Always show mohawk |
|
||||
| `forceHorns` | boolean | Always show horns |
|
||||
|
||||
All values are validated server-side against whitelists. Invalid values are rejected.
|
||||
|
||||
### Available Archetypes (100)
|
||||
|
||||
`GET /api/bots/meta/archetypes` returns the full list. Categories:
|
||||
|
||||
- **Animals:** cat, crocodile, dog, elephant, flamingo, frog, giraffe, hamster, hedgehog, hippo, lion, lobster, monkey, octopus, panda, parrot, penguin, raccoon, shark, sheep, snail, snake, turtle, whale
|
||||
- **Fantasy:** alien, cyclops, demon, dragon, gargoyle, ghost, golem, griffin, mermaid, minotaur, phoenix, skeleton, unicorn, vampire, werewolf, witch, wizard, zombie
|
||||
- **Robots:** android, antenna_bot, calculator, circuit, cyberdog, cyborg, drone, led_cube, mech, microwave, robocat, robot, satellite, toaster, tv_head, ufo_bot
|
||||
- **Warriors:** astronaut, boxer, chef, clown, cowboy, detective, firefighter, gladiator, knight, lumberjack, ninja, nurse, pirate, samurai, scientist, viking, wrestler
|
||||
- **Silly:** balloon_man, bee, blob, broom_man, cactus, cloud_man, dinosaur, garden_gnome, jack_o_lantern, lamp_post, mushroom, pizza, potato, rock_man, rubber_duck, scarecrow, snowman, sock_puppet, standard, tank, toilet_man, traffic_cone, trash_can
|
||||
|
||||
## Testing Your Bot
|
||||
|
||||
| Endpoint | Description |
|
||||
|----------|-------------|
|
||||
| `POST /api/bots/{name}/test-webhook` | Tests connectivity. Sends a dummy challenge, checks for valid JSON response. |
|
||||
| `POST /api/bots/{name}/test` | Tests connectivity. Sends a dummy challenge, checks for valid JSON response. |
|
||||
| `POST /api/bots/{name}/test-challenge` | Sends a REAL challenge and scores your answer. Shows if you'd be marked correct. |
|
||||
| `POST /api/queue/join/{botId}` | Join the fight queue. If no opponents available, you fight a mock bot after 3 seconds. |
|
||||
|
||||
|
||||
Reference in New Issue
Block a user