Case study 02 / 05Live

Duleko
Local Skills Marketplace for Nepal
Trust, privacy and money rules enforced in the database, not just the UI.
- Role
- Tech lead & sole developer
- frontend, database design, deployment
- Timeline
- 2026 – Present
- Full-Stack Application
- Status
- Live
- duleko.com · Android on Google Play
- Core stack
- React 19 · TypeScript
- Supabase, PostgreSQL, TanStack Query
- Tables, all with RLS
- 44
- Database migrations
- 87
- Languages (EN / NE)
- 2
- Hosting cost
- $0
Gallery
Inside Duleko
01Overview
The problem, and what I built
The problem
Skilled local workers are usually found by word of mouth, with little way to judge who is reliable, and many people are on phones, on slow connections and more at home in Nepali. The goal: a mobile-first, review-driven marketplace that costs nothing to run and finds people nearby without revealing where they live.
What I built
A bilingual (English / नेपाली) skills marketplace for Nepal on the web and Android: find ID-verified local workers nearby.
Work lifecycle (pending → accepted → confirmed → completed) enforced in Postgres with triggers, RPCs and Row Level Security on all 44 tables, so no client or older Android build can skip a step.
A job board with hiring posts that collect workers' price offers and 30-day service adverts, priced per job, hour, day or km, plus tracking of deals agreed over a phone call, with staff settling the disputed ones.
A privacy-first map on Leaflet and OpenStreetMap: people pick a work area instead of sharing GPS, members see a ~1 km square and guests only counts per ~5 km area.
A two-step verified badge only staff checks can grant: orange for an ID or a certificate for a skill, green for both, with documents in a private bucket behind 10-minute links.
Payment details, a marginal 5/4/3% monthly fee billed by Nepali month, and referral codes giving both sides a fee-free job, without Duleko ever holding money.
Sign-in by mobile + PIN, email or Google, realtime chat, and alerts in-app, by email, by SMS and on Android without Firebase, every string type-checked in English and Nepali.
02Architecture
How it fits together
Client
- React 19 + TypeScript
- TanStack Router + Query
- Tailwind CSS v4
- Leaflet + OpenStreetMap
- EN / नेपाली, Bikram Sambat dates
- Android app via Capacitor 8
Auth, API & realtime
- Supabase Auth: mobile + PIN, email, Google
- Google on Android: Custom Tab + PKCE
- Auto-generated API + RPCs
- Realtime: chat, alerts, presence
- Edge functions: email / SMS and contact sync
- Android WorkManager phone alerts
Database & storage
- PostgreSQL, RLS on all 44 tables
- Lifecycle and job board triggers
- Owner-only work areas
- ID and certificate checks in a private bucket
- Fees billed by Nepali month
- Outboxes drained by pg_cron
Built with
- React 19
- TypeScript
- Supabase
- PostgreSQL
- TanStack Query
- TanStack Router
- Tailwind CSS
- Vite
- Capacitor
- Leaflet
03Decisions
Key engineering decisions
Business rules live in Postgres, not the frontend
A trigger enforces the work lifecycle under Row Level Security, so only the worker can accept and only the hirer can confirm a job is done (or it completes after 3 days). RPCs turn a chosen job-board offer into a work request and decline the rest.
Trade-offHarder to iterate on than UI code, but no modified client, direct API call or old Android build can bypass it.
A work area, not live GPS
The exact point sits in a table only its owner can read. Members see the middle of a ~1 km square, guests only counts per ~5 km area, and the other side of an active job can open the exact place.
Trade-offLess precise than a live dot, but no query, screen or bug can reveal where someone lives.
The verified badge comes only from staff checks
ID photos go to a private bucket readable only by the owner and staff through 10-minute links. Only review_kyc() and review_certificate() can write the badge: an approved ID or a certificate for one of the member's skills makes it orange, both make it green, and a name change removes the ID half.
Trade-offMembers wait for a person to look, but the badge always means staff have seen the ID or certificate behind it.
Fees in the database, money never held
Members pay each other directly to accounts only the other side of a job can see. One SQL function works out the marginal 5/4/3% fee, the price freezes on acceptance, and an overdue fee pauses new work.
Trade-offAdmins confirm fee payments by hand, but Duleko never touches anyone's money.
One rule for calls, and deals tracked but not charged
Numbers sit behind a single can_call() check that follows each person's 'Who can call me' setting, and chat rejects phone numbers. After a call the caller is asked if they made a deal; it counts once the worker confirms or 7 days pass, with no fee.
Trade-offRelies on honest answers, but Duleko sees work it used to miss, and staff settle disputed deals or remove made-up ones.
Alerts without a push service or spam
Triggers write alerts to an outbox that pg_cron drains every minute, with chat emails throttled and capped daily. On Android, a WorkManager job polls one Postgres function every 15 minutes for the notification bar.
Trade-offEmail and phone alerts can lag by minutes, but there's no Firebase, server or bill, and inside the app everything is live.
04Lessons
What was hard, and what I learned
What was hard
- Making a multi-party workflow safe when worker, hirer, guest and staff can each see and change different data.
- Keeping older Android builds working against one shared database through every migration.
- Getting Google sign-in into the Android app, where Google refuses WebView sign-ins: a Chrome Custom Tab with PKCE.
- Staying inside free tiers, which shaped Supabase, scheduled outboxes and phone alerts without a push service.
What I learned
- Push authorisation as close to the data as possible - the UI then only has to reflect it.
- Privacy is a data-model decision: a point nobody can read can't leak through any screen.
- A trust badge is only worth what it is checked against - so only the step that checks it may grant it.
- Old app builds never go away - every migration has to keep them working.
05Outcome
Where it landed
A live, bilingual marketplace on the web and as an Android app on Google Play, running on free tiers with 44 tables under Row Level Security built up over 87 migrations.
In their words
When I needed someone to turn my vision for Duleko into a real, working platform, Sanjay Gupta was the first person who came to mind. Having known him for over four years, I have always been impressed by his dedication, curiosity, and genuine passion for building something meaningful for Nepal.
Throughout Duleko’s journey, Sanjay has taken ownership of its technical development, consistently delivering improvements while helping shape important decisions. Beyond coding, he has actively engaged with our early users, valued their feedback, and worked to make the platform more intuitive and reliable. His responsiveness, timely delivery, and ability to think ahead have made him an invaluable part of our team. What truly sets Sanjay apart is his rare combination of technical ability, initiative, and genuine commitment to turning an idea into something meaningful.

Sunil K. ChaudharyFounder, Duleko