Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/midudev/mundial-de-clicks/llms.txt

Use this file to discover all available pages before exploring further.

Getting Mundial de Clicks running locally requires zero configuration. All environment variables have sensible defaults baked into src/lib/config.ts — the Redis connection defaults to localhost:6379 via buildRedisUrl(), so as long as Docker is running with DragonFly on the standard port, the app connects automatically without a single line in .env.
Prerequisites
  • Node.js ≥ 22.12.0 — enforced by the engines field in package.json
  • pnpm (the project uses pnpm@11.5.0 as its package manager)
  • Docker (with Docker Compose) — to run DragonFly, Postgres, and Umami

Setup

1

Clone the repository and install dependencies

git clone https://github.com/midudev/mundial-de-clicks.git
cd mundial-de-clicks
pnpm install
2

Start the infrastructure with Docker Compose

docker compose up -d
This single command starts three services defined in docker-compose.yml:
  • DragonFly — the Redis-protocol in-memory vote store, exposed on localhost:6379, with snapshot persistence to a named Docker volume every 5 minutes
  • Postgres — the relational database that Umami requires for storing analytics events
  • Umami — the self-hosted analytics dashboard, exposed on localhost:3001
If you only need the voting backend and don’t care about analytics, you can start just DragonFly:
docker compose up -d dragonfly
The app detects that DRAGONFLY_HOST resolves and connects; the Umami-related environment variables (PUBLIC_UMAMI_SCRIPT_URL, PUBLIC_UMAMI_WEBSITE_ID) are not set, so hasUmami is false and no analytics script is injected.
3

Start the development server

pnpm dev
Astro starts in SSR mode with the Node adapter. Open http://localhost:4321 in your browser — you’ll see the voting grid, the live ranking, and the clicks-per-minute counter already updating.

Local Services

ServiceURLNotes
Apphttp://localhost:4321The voting web app (Astro SSR)
Umamihttp://localhost:3001Analytics dashboard — default login: admin / umami
DragonFlylocalhost:6379Redis protocol — connect with any Redis client

Available Commands

CommandAction
pnpm devStart the Astro development server at localhost:4321 with HMR
pnpm buildCompile a production build into ./dist/
pnpm previewServe the production build locally (runs the compiled entry.mjs)
pnpm checkRun astro check for TypeScript type-checking across .astro and .ts files
No Docker? No problem. If you skip docker compose up entirely, the app still starts. When neither REDIS_URL nor DRAGONFLY_HOST is set, the hasDragonfly flag in src/lib/features.ts is false and all vote operations fall back to an in-process Map (castVotesMemory / readWorldMemory). There is no persistence — votes disappear on server restart — but the complete UI, SSE stream, optimistic updates, and ranking animations all work. This is ideal for fast frontend iteration without spinning up any infrastructure.

Build docs developers (and LLMs) love