DEV Community

kenghow
kenghow

Posted on

I shipped a $49 React Native template with the backend included — here's the architecture

After building a fitness tracker as a side project, I realized the backend plumbing (auth, cloud sync, AI proxy with quota, RLS) was ~4 weeks of work that most React Native templates skip entirely.

So I rebranded mine as Reptron and shipped it as a template.

Live: https://8628671192007.gumroad.com/l/mbmmh

The architecture


mermaid
flowchart LR
    App[📱 React Native App] -->|JWT| Worker[⚡ Cloudflare Worker<br/>auth + quota]
    App -->|JWT| Supabase[☁️ Supabase<br/>Postgres + RLS]
    Worker -->|server secret| Groq[🤖 Groq Llama 3.1]
\`\`\`

(The Groq API key never ships in the app bundle — it lives as a Cloudflare secret on the Worker.)

## What's actually in it

### Production backend (the actual value)

- **Cloudflare Worker proxy** that hides the Groq API key — verifies Supabase JWT via cached JWKS (1h TTL), enforces 50 req/user/day quota in KV (26h TTL covers the UTC day boundary)
- **Supabase Postgres with RLS** — users only see their own data, verified at the database level
- **Idempotent cloud sync** — workouts push to Supabase on Finish, pull on sign-in, last-write-wins per `client_id`

### App layer

- **Auth + sync** wired through Zustand + MMKV with persisted session
- **AI Coach** with Groq Llama 3.1 8B streaming SSE, system prompt seeded with last 5 workouts + PRs
- **EN + TH i18n** out of the box
- **88 passing Vitest tests**, strict TypeScript, `tsc --noEmit` clean

## Why I'm positioning as a "backend stack" not a UI kit

There's a Flutter UI kit on Gumroad with 35+ polished screens for $99. That's a different product for a different buyer. Reptron has minimal UI you customize anyway — the value is the working backend you'd otherwise spend weeks building.

The README explicitly redirects UI shoppers elsewhere. Self-selecting buyers = lower refund rate.

## Stack

Expo SDK 54 · TypeScript strict · Zustand 5 · MMKV · NativeWind v4 · Supabase · Cloudflare Workers · `jose` JWT · Groq · Vitest

## What's deferred (transparently, in the listing)

- iOS (code is iOS-compatible but only Android is tested)
- Google/Apple OAuth (email/password only — OAuth is a 1-day add-on)
- RevenueCat / paywall (`tier` column exists, wiring is the buyer's call)
- Offline queue (workouts log to MMKV; failed cloud pushes are dropped silently)

## Numbers

- Build time: ~5 days solo
- Bundle: 303 KB zip
- Price: $49 (Gumroad), planning $39 on CodeCanyon
- Free updates: 6 months
- Setup support: 30 days

## Looking for honest feedback

1. The "backend stack" positioning — does it land, or sound vague?
2. Price — $49 too low for the value, or too high without proven sales?
3. Anything missing from the listing you'd want before buying a dev template?

If you build something with this, I'd love to hear about it.
Enter fullscreen mode Exit fullscreen mode

Top comments (0)