MWMartin Wassim
Return to Selected Work
ARCHITECTURAL DOSSIER // 2024—2026
PROJECT 01Full-Stack Application / Gamification EngineFlagship Product

VELORA

A daily mission platform designed to turn consistent action into measurable progress.

martinx.work/work/velora
VELORA Architectural Presentation
TIMELINE

2024 — 2026

DISCIPLINE

Full-stack · Product Engineering

ROLE

Lead Software Architect

AFFILIATION

Systemize EG · Cairo

Core Runtime • Engineering Toolchain
Next.js 16React 19TypeScriptTailwind CSSSupabasePostgreSQLVercel
01 // Operational & Technical Friction

The Problem Space

Most gamified habit apps allow trivial client-side spoofing, have brittle reward engines, and fail to provide verifiable proof of completion.

02 // The Architected Solution

Systemized Implementation

Built a secure, server-authoritative web platform where every mission submission, photo proof, XP reward, and streak increment is evaluated through atomic PostgreSQL procedures and Row-Level Security.

03 // Production Implementation & Workflow

How It Operates in Production

Implemented using Next.js 16 App Router with React 19 server components. Integrated Supabase for PostgreSQL database, authentication, and encrypted object storage for photo proofs. Designed a relational schema enforcing streak continuity via automated triggers.

Engineering Depth

Engineered an automated cron-driven mission publisher, Supabase Storage photo-proof pipeline with client compression, and strict RLS policies ensuring users can only read their authorized scopes.

04 // Architectural Flow & State MachineBespoke Pipeline
STATE MACHINE

VELORA // GAMIFICATION STATE MACHINE & POSTGRES TRANSACTIONS

SERVER-AUTHORITATIVE • ACTIVE
PHASE 01 // CRON SCHEDULER

Daily Mission Generation

Automated UTC midnight cron job publishes randomized, balanced quest rotations with verified XP weights.

NODE 01ONLINE
PHASE 02 // CLIENT COMPRESSION

Proof Upload & Direct S3/Supabase

Browser compresses photo evidence to <250KB before issuing direct presigned URL upload to storage.

NODE 02ONLINE
Core Innovation
PHASE 03 // POSTGRESQL RLS

Atomic Verification & XP Transaction

PostgreSQL stored procedures evaluate timezone boundary and execute atomic balance credits with row locking.

NODE 03VERIFIED
PHASE 04 // SUPABASE REALTIME

Live Leaderboard Broadcast

Calculates global and weekly rank deltas, streaming instant updates to connected subscriber clients via WebSocket.

NODE 04ONLINE

Data Flow & Infrastructure

The client layer communicates with Next.js Server Actions and Route Handlers, validating inputs with TypeScript schemas. The database layer consists of PostgreSQL with Row-Level Security (RLS) policies, database triggers for streak updates, and scheduled Supabase Edge Functions for daily reset routines.

Architectural Highlight

Rewards are enforced server-side, with PostgreSQL security policies designed to prevent players from manipulating their own progress.

05 // Key Engineering Decisions
Server-authoritative progression: All XP calculations, level thresholds, and streak validations execute strictly in database transactions or server functions to prevent tampering.
Atomic streak transitions: PostgreSQL stored procedures verify submission timestamps against user timezone offsets before awarding streak milestones.
Optimistic UI with rollback: Mission toggle and submission provide instantaneous feedback on client devices while rolling back cleanly if network or verification fails.
Storage optimization: Image proofs are resized and compressed on the client before direct signed upload to Supabase Storage, reducing transfer overhead by over 70%.
06 // Challenges & Mitigations
Handling timezone anomalies when evaluating consecutive daily mission streaks across global midnight boundaries.
Preventing concurrent submission race conditions where double-clicking a mission completion button could double-award XP.
Structuring Row Level Security policies that allow public leaderboard aggregation without exposing private user audit logs.
07 // Verified Capabilities

Core System Features

Daily missions engine with automated publishing schedules
XP, coin economy, and dynamic level scaling algorithm
Continuous streak tracking with freeze and recovery logic
Multi-tier achievements system with custom visual badges
Daily consecutive login rewards with increasing multipliers
Live competitive leaderboards filtered by global and weekly rank
Mission submission workflow with photo-proof upload verification
Dedicated Administrator control plane for mission authoring and player audits