GiftDoor Svelte Themes

Giftdoor

GiftDoor is a fully free and open-source digital advent calendar platform that lets people create and share personalised 25-day gift experiences with loved ones anywhere in the world.

๐ŸŽ GiftDoor

GiftDoor is a Cloudflare-first, SvelteKit-powered digital advent calendar. Each day unlocks a private surpriseโ€”messages, media, or gift codesโ€”delivered fast at the edge.

This repository now includes ready-to-run examples for Cloudflare D1 (SQLite) and R2 (S3-compatible storage).


๐Ÿš€ Stack

  • SvelteKit + TypeScript
  • Cloudflare Workers (adapter-cloudflare)
  • Cloudflare D1 for relational data
  • Cloudflare R2 for media storage
  • Vite for dev/build

๐Ÿ”ง Quick start

  1. Install dependencies (already run if you used the CLI):

    npm install
    
  2. Create or point to your Cloudflare resources, then update wrangler.toml with their IDs/names: ```toml [[d1_databases]] binding = "DB" database_name = "giftdoor-db" database_id = ""

    preview_database_id is optional for wrangler dev; set it if you create a preview DB

[[r2_buckets]] binding = "BUCKET" bucket_name = "giftdoor-media" preview_bucket_name = "giftdoor-media-dev"


3) Run locally:
```sh
# Cloudflare runtime with Miniflare (needed to hit D1/R2)
wrangler dev --persist
# App will be served on http://127.0.0.1:8787

# Or fast Vite dev without bindings
npm run dev -- --open

๐Ÿ—„๏ธ D1 example (src/routes/api/d1/+server.ts)

  • GET /api/d1 โ€” creates a gifts table if needed and returns the 10 most recent rows.
  • POST /api/d1 โ€” insert a gift row:
    { "title": "Day 1 surprise", "note": "A warm hello", "day": 1 }
    

You can hit these from the homepage UI or with curl:

curl -X POST http://localhost:5173/api/d1 \
  -H "content-type: application/json" \
  -d '{"title":"GiftDoor hello","day":1,"note":"stored in D1"}'

๐Ÿ“ฆ R2 example (src/routes/api/r2/+server.ts)

  • POST /api/r2 โ€” stores a text object at demos/<filename>.txt.
  • GET /api/r2 โ€” lists objects in the demos/ prefix.
  • GET /api/r2?key=demos/<filename>.txt โ€” fetches a specific object.

Example upload:

curl -X POST http://localhost:5173/api/r2 \
  -H "content-type: application/json" \
  -d '{"filename":"first-note","content":"hello from GiftDoor"}'

๐Ÿ“‚ Project map

  • src/routes/+page.svelte โ€” landing page with interactive D1/R2 testers.
  • src/routes/api/d1/+server.ts โ€” Cloudflare D1 read/write demo with automatic table creation.
  • src/routes/api/r2/+server.ts โ€” Cloudflare R2 upload/list demo.
  • wrangler.toml โ€” bindings for DB (D1) and BUCKET (R2).
  • svelte.config.js โ€” uses @sveltejs/adapter-cloudflare.

โœจ What is GiftDoor?

GiftDoor allows a gifter to build a digital advent calendar by filling each of the 25 days with personalised digital gifts. A recipient receives a private link and can open one door per day, unlocking automatically by date.

Itโ€™s designed for:

  • Families living apart
  • Long-distance couples
  • Friends in different countries
  • Parents surprising children
  • Businesses sending seasonal appreciation calendars

MVP feature targets

  • User accounts (email / magic link)
  • Create a 25-day digital advent calendar
  • Recipient invite via email
  • Daily door unlocking logic
  • Gift types: text, images, links, gift card codes
  • Basic themes and mobile-first recipient experience
  • Daily reminder emails and open tracking

๐Ÿ“„ License

MIT โ€” free to use, modify, and distribute with attribution.

Top categories

Loading Svelte Themes