Demoscene.
Real-time art. Tiny code, big pictures. Show your demo — 4k, 64k, or just one tiny file that moves.
This is a toy prototype. Demos are local-only — stored only in this browser tab. They are NOT saved to the server and NOT shared with anyone yet. The player below is real though — it is a tiny demo running in your browser right now. Refresh = your posts gone, player still works.
How it works (when it’s real)
Everyone posts to the same board. You show your demo, people watch it in the player, upvote, comment, and share it. Smallest + prettiest rises. For now, you’re posting alone — practice your demo.
- Demo = title + size + platform + link + what it does
- Play = click Play in the player above
- Vote = signal. Comment = feedback.
- Download .txt to keep your board
Community — coming soon
Shared state is not connected yet.
🟢 0 sceners posting right now (fake — local toy)
✨ Last demo: —
🎵 Last chiptune: — (not saved)
📜 Rules: Realtime only. Show size. Credit everyone.
⬇ Backend — Demoscene Backend — Template
Right now Demoscene is a tinker toy — demos is a local array in this tab, votes are local counters, comments are local, and Refresh = gone (except local autosave). The player is real — it runs in your browser. Disclaimer is the truth: local-only, not saved, not shared. This backend is the map to make it real: one shared board, per-demo writes, votes as server counts, comments as server rows, size + platform filters, cooldowns, accounts, moderation. Proposed, not connected.
01 / Files to create
api/demoscene/demo.php POST /api/demoscene/demo api/demoscene/demos.php GET /api/demoscene/demos?sort=best&tag= api/demoscene/vote.php POST /api/demoscene/vote api/demoscene/comment.php POST /api/demoscene/comment api/demoscene/snapshot.php GET /api/demoscene/snapshot sql/demoscene_tables.sql
Keep the tinyfiles PHP pattern: /api/bootstrap.php, json_in() / json_out(), prepared PDO.
02 / Database tables
-- sql/demoscene_tables.sql demoscene_demos id BIGINT AUTO_INCREMENT PRIMARY KEY user_id INT NOT NULL title VARCHAR(200) NOT NULL body TEXT NOT NULL link VARCHAR(500) NULL size_kb INT NULL -- 4, 64, or NULL for full demo size_label VARCHAR(20) NOT NULL -- 4k, 64k, demo, chiptune platform VARCHAR(40) NOT NULL DEFAULT 'Web' fx VARCHAR(20) NOT NULL DEFAULT 'plasma' -- plasma, tunnel, stars, bars created_at DATETIME NOT NULL demoscene_votes demo_id BIGINT NOT NULL user_id INT NOT NULL value TINYINT NOT NULL PRIMARY KEY (demo_id, user_id) demoscene_comments id BIGINT AUTO_INCREMENT PRIMARY KEY demo_id BIGINT NOT NULL user_id INT NOT NULL body TEXT NOT NULL created_at DATETIME NOT NULL demoscene_cooldowns user_id INT PRIMARY KEY last_demo_at DATETIME NOT NULL demos_last_hour INT NOT NULL DEFAULT 0
Board is one shared feed. Never store a board per user — store only demos by id, plus votes and comments.
03 / API endpoints
POST /api/demoscene/demo
{ "title": "Plasma Dream", "body": "...", "link": "https://...", "size_label": "4k", "platform": "Web", "fx": "plasma" }
- auth required, 1 demo per hour
- validates title 5-200 chars, body 10-2000 chars, size_label in set
- returns { "ok": true, "id": 123 }
GET /api/demoscene/demos?sort=best&tag=&since=
- returns { "ok": true, "demos": [ { id, title, body, link, size_label, platform, fx, votes, comments } ] }
POST /api/demoscene/vote
{ "demo_id": 123, "value": 1 } — one vote per user per demo
POST /api/demoscene/comment
{ "demo_id": 123, "body": "That plasma is so smooth..." } — 1 comment per 10sVotes are server counts — demoscene_votes — not client counters. Server decides Best / New / Smallest sorting.
04 / Cooldown, moderation & validation
// Cooldown: 1 demo per hour, 1 comment per 10s, 1 vote per 2s // Moderation: no hate / NSFW / spam / stolen work — mods can remove + ban user_id // Validation: title, body, link, size_label, platform, fx — else 400 // Realtime: link must be a live demo, not a pre-rendered video
Keep disclaimer until this ships: “Tinker toy — not live yet. Refresh = gone.”
05 / Frontend wiring
// demos[] is already local. After posting (debounced 800ms): // POST /api/demoscene/demo with new demo // Poll GET /api/demoscene/demos?sort=best every 5s, apply only new demos // On load: GET /api/demoscene/snapshot -> load into demos[] // Player: fx comes from demo.fx — plasma / tunnel / stars / bars // If API fails, fall back to local-only toy + disclaimer.
api/demoscene/ + sql/demoscene_tables.sql — no GitHub needed. Shared board, per-demo writes, votes as server counts, cooldowns + moderation.