DEV Community

עדי מולדבסקי
עדי מולדבסקי

Posted on

Building Tickr: A TikTok-Style App Where Videos Have Permadeath

I built Tickr — a short video feed where every video has a real-time life timer. Watch it and the timer goes up. Skip it and the timer goes down. When it hits zero, the video is permanently deleted.

No algorithm. No likes. No followers. Just survival.

The Core Problem: Real-Time Timers Without a Server Loop

The naive approach would be running a process that decrements every video's timer every second. With hundreds of videos, that's expensive and fragile.

Instead, I store two values per video in DynamoDB:

  • life_seconds — total accumulated life
  • last_updated_at — timestamp of the last watch/skip event

The remaining time is calculated on read:

remaining = life_seconds - (now - last_updated_at)
Enter fullscreen mode Exit fullscreen mode

No background jobs. No cron. The timer is just math.

Auto-Deleting Dead Videos

DynamoDB has a built-in TTL feature. When a video's remaining life hits zero, I set a TTL attribute. DynamoDB automatically deletes it within minutes — no cleanup Lambda needed.

A DynamoDB Stream catches the deletion event and promotes the next queued video into the arena.

Real-Time with WebSockets

API Gateway WebSocket API handles the real-time connection. When a user watches a video, the client sends a watch event. When they swipe away, a skip event fires.

The server tracks connection time — the client never sends "I watched for X seconds." This prevents cheating. The server measures the actual WebSocket connection duration and credits the video accordingly.

The Stack

  • Lambda — all business logic (videos, upload, moderation, WebSocket handlers)
  • API Gateway — REST API + WebSocket API
  • DynamoDB — videos table with GSI for status-based queries
  • S3 + CloudFront — video storage and CDN delivery
  • Rekognition — content moderation (frame extraction + label detection)
  • Fargate Spot — seeder tasks that fetch content to bootstrap the arena

Frontend

React + Vite with a TikTok-style vertical swipe feed. Key decisions:

  • Only the active video + neighbors get a src attribute (prevents memory overload)
  • Framer Motion for death animations (glitch dissolve when timer hits zero)
  • WebSocket reconnection with exponential backoff

What It Costs

Running this on AWS serverless costs almost nothing at low scale. Lambda free tier covers most invocations. DynamoDB on-demand pricing means I pay per request. The most expensive part is the Fargate seeder tasks (~$2/day).

Try It

Check it out at getickr.com — swipe through some videos and watch the timers tick. Upload your own 15-second clip and see if it survives.

Is "attention = life" compelling gameplay, or just stressful? Would love to hear what you think.

Top comments (0)