TRASAQU
Retail & Grocery Store Management Application
TRASAQU is a production retail and grocery business management application live on Google Play. Engineered independently from product requirements through production release, it enables store owners and staff to manage product inventory, POS sales transactions, business expenses, financial reports, multi-store operations, employee role-based access, and subscriptions across an offline-first Flutter mobile application, a Cloudflare Workers + D1 + R2 serverless backend, and a companion React/TypeScript admin dashboard.
Independent Product Engineer
Retail & Grocery (UMKM)
Flutter · Dart · Cubit
Drift (SQLite) · Offline-First
Cloudflare Workers · TypeScript
Cloudflare D1 & R2
Google Play Billing + RTDN
React · TypeScript · Tailwind
Production — Live on Google Play
NestJS (Migrated to Workers)
FROM IDEA TO PRODUCTION ON GOOGLE PLAY
Every engineering stage—from domain research and system architecture to backend migration, CI/CD automation, and live Google Play production operations—was executed end-to-end.

Solving Real Operational Friction for Retail & Grocery Businesses
TRASAQU is a retail and grocery store management application designed for small and medium retail businesses (UMKM) that previously relied on paper ledgers or disconnected spreadsheets. In daily store operations, merchants face recurring challenges: untracked stock discrepancies across packaging units (cartons, packs, pieces), unrecorded cash expenses, forgotten customer credit (kasbon), lack of role separation for cashiers, and unstable store internet connectivity during peak checkout hours.
Rather than acting as a simple calculator cashier app, TRASAQU models the complete retail operational lifecycle for store owners and employees across seven core operational pillars:
Why Retail First?
Instead of attempting to support every business vertical from day one, I chose Retail and Grocery (Sembako) as the initial production domain. This provided a high-frequency operational environment to validate POS transactions, multi-unit inventory, purchasing, store-scoped permissions, financial reporting, offline persistence, and cloud synchronization before introducing other verticals with distinct workflow rules.
“Build the concrete domain first. Generalize after recurring patterns become clear.”
Generalize from proven production patterns, not speculative assumptions.
Concrete domain rules accelerate validation with real retail store operators.
Avoids brittle, overly generic schemas during initial product-market fit.
Retail ledger and inventory structures establish a strong foundation for shared platform services.
Direct operational feedback from live Google Play merchants informs future vertical expansion.
Independent Engineering Ownership Across the Entire Lifecycle
As an independent product engineer, I owned the complete technical and product lifecycle of TRASAQU without a separate backend, DevOps, or QA team:
- •Retail domain research & workflow mapping
- •Product Requirements Document (PRD)
- •Pricing & subscription tier modeling
- •Feature prioritization & release scoping
- •Semi-Clean layered Flutter architecture
- •Simplified Atomic Design UI system
- •NestJS → Cloudflare Workers migration
- •Store-scoped multi-tenant RBAC model
- •BLoC / Cubit state management
- •Repository Pattern & GetIt DI
- •Barcode scanner & ESC/POS thermal print
- •Direct Google Play Billing integration
- •Drift (SQLite) local relational schema
- •pending_sales_transaction mutation queue
- •Idempotent local-to-cloud sync engine
- •Cloudflare D1 migrations & R2 storage
- •Cloudflare Workers REST API handlers
- •Firebase Auth & JWT token rotation
- •RTDN subscription webhook verification
- •Centralized Dio interceptors & error handling
- •React.js, TypeScript & Tailwind CSS
- •TanStack Query server-state caching
- •Single-flight 401 refresh mutex in Axios
- •Merchant, store, billing & voucher views
- •Unit testing for Cubits & repositories
- •Widget testing for core UI flows
- •Strict static analysis (flutter analyze)
- •Offline edge-case & billing verification
- •GitHub Actions build & test workflows
- •Android Keystore signing & AAB packaging
- •Firebase App Distribution staging track
- •Google Play production release & monitoring
Retail Operations Covered End to End
Fast cashier checkout, camera barcode scanning, item/order discounts, cash & non-cash settlement, Bluetooth thermal receipt printing, and cart hold.
Traceable stock movement ledger (stock-in, sale deduction, adjustment, stock opname) rather than destructive single-column overwrites.
Master SKU catalog, packaging unit conversion (e.g., carton → pack → piece), wholesale/retail pricing tiers, and barcode mapping.
Supplier purchase orders, incoming stock batch verification, supplier payable tracking, and operational store expense logging.
Operate multiple store branches under one owner account with isolated inventory, staff assignments, and active store context switching.
Granular role-based access control for Owner, Cashier, Warehouse, and Finance enforced at both the mobile UI and backend API layers.
Daily/monthly sales summaries, gross profit calculation, expense breakdowns, inventory valuation, and top-selling product insights.
Customer credit records, partial repayment history, due date tracking, and settlement audit logs.
Free vs. Pro plan entitlements (Pro Solo, Pro Starter, Pro Business), trial handling, and first-period voucher discounts via Google Play Billing.
Multi-Client Production Architecture
Clear separation of responsibilities across the offline-first Flutter mobile application, the React/TypeScript admin dashboard, and the shared Cloudflare Workers + D1 + R2 backend:
Cubit · Repository Pattern · Simplified Atomic UI · Dio Interceptors · Drift SQLite · Google Play Billing
Tailwind CSS · TanStack Query · Axios Single-Flight Refresh Mutex · Merchant & Billing Backoffice
Stateless TypeScript handlers · Schema validation · Store-scoped guards
Relational SQLite cloud storage · Multi-store tenant isolation · Versioned SQL migrations
Product photos, receipt logos, and business media assets
On-device relational persistence & pending_sales_transaction queue
Semi-Clean Layered Flutter Architecture, Simplified Atomic Design & Drift Offline Engine
The Flutter mobile application uses a pragmatic Semi-Clean / Layered Architecture rather than rigid ceremony. Cubit manages presentation state and feature workflow orchestration, while Repositories coordinate access between Remote Data Sources (Dio REST API) and Local Data Sources (Drift SQLite). Dependency injection is wired through get_it, keeping presentation widgets decoupled from persistence and network implementation details.
Simplified Atomic Design widgets, camera barcode scanner & thermal print dialogs
Immutable state emissions, form validation & workflow orchestration
Single source-of-truth coordinator between local SQLite and remote REST API
RemoteDataSource & LocalDataSource contract boundaries
Dio HTTP client with interceptors & Drift SQLite local database
To maintain visual consistency across POS, inventory, expense, and reporting modules without over-nesting widget trees, UI components are organized using a Simplified Atomic Design hierarchy:
Design tokens, typography, status badges, currency formatters, buttons, and themed text inputs.
SKU search bars with barcode triggers, unit selector chips, quantity steppers, and empty/error state cards.
POS cart summary sheets, multi-unit conversion forms, receipt preview modals, and role permission matrices.
Feature-scoped screens wired to scoped BlocProvider / BlocConsumer lifecycles.
Retail cashiers cannot stop serving customers when mobile data or store Wi-Fi drops. TRASAQU prioritizes local-first execution for daily store operations and queues mutations for background synchronization when connectivity returns:
Products, packaging units, categories, customers, and active store settings are persisted in Drift SQLite for instant zero-latency lookup at the cashier counter.
Offline checkouts are written atomically to pending_sales_transaction with client-generated idempotency keys and sync status flags (pending, syncing, synced, failed).
In-progress carts and held customer orders survive app restarts; queued sales flush sequentially to Cloudflare Workers once network reachability is restored.
- • Browsing product catalog, SKU prices, and multi-unit conversions
- • Barcode scanning, cart item calculation, and discount application
- • Holding/parking customer carts (
offline_holder) across sessions - • Recording POS sales transactions into
pending_sales_transaction - • Printing customer receipts via Bluetooth ESC/POS thermal printers
- • Initial account authentication, Firebase sign-in, and JWT token rotation
- • Creating new store branches, inviting employees, and modifying RBAC roles
- • Purchasing Pro subscriptions via Google Play Billing & RTDN verification
- • Synchronizing
pending_sales_transactionqueue to Cloudflare D1 - • Multi-branch consolidated reporting and cloud media uploads to Cloudflare R2
Engineering Boundary Note: Multi-store context is isolated per active store_id. Real-time distributed conflict resolution across multiple simultaneously offline cashier terminals in the same branch is outside the current implementation and remains a planned future enhancement.
Companion Web Administration & Platform Operations Dashboard
Alongside the Flutter mobile application, TRASAQU includes a web-based administration dashboard built with React.js, TypeScript, and Tailwind CSS. Rather than forcing mobile patterns onto the web, the dashboard uses idiomatic web architecture—combining modular feature API layers, TanStack Query for server-state caching and invalidation, and a centralized Axios client consuming the shared Cloudflare Workers API.
Tailwind CSS responsive views, KPI cards, filterable tables & modal dialogs
Custom TanStack Query hooks managing pagination, caching & mutations
Domain modules for merchants, stores, subscriptions, vouchers & telemetry
Shared HTTP client injecting auth headers and active store context
Single-flight 401 token rotation mutex with queued request replay
When an admin page mounts multiple TanStack Query hooks simultaneously after an access token expires, naive interceptors trigger parallel 401 refresh storms. The centralized Axios client serializes token rotation using a single-flight mutex:
The first 401 response acquires the refresh lock so only one token refresh call is sent to Cloudflare Workers.
Concurrent requests that receive 401 while a refresh is in flight are held in an in-memory promise queue.
Once the new JWT pair arrives, queued requests automatically receive the updated bearer token and replay transparently.
Platform KPI overview, merchant/user directory, multi-store inspection, subscription tier catalog (Free, Pro Solo, Pro Starter, Pro Business), and promotional voucher management.
Administrative UI view initialized in AuditLogsPage; full server-side audit filtering integration is in progress.
Self-serve custom enterprise entitlement builder and automated anomaly alerts planned for future B2B partner rollouts.

●Platform Operations Dashboard
Live administration backoffice built with React, TypeScript, and Tailwind CSS for monitoring merchant accounts, active store branches, subscription health, voucher redemptions, and platform transaction metrics.
Current Cloudflare Workers + D1 + R2 Architecture (Migrated from NestJS)
TRASAQU's current production backend runs on Cloudflare Workers for stateless API execution, Cloudflare D1 for relational SQLite persistence, and Cloudflare R2 for product and business media storage. In the earlier backend implementation, TRASAQU was built with NestJSon a self-managed Cloud VPS. As an independent engineer operating the product end-to-end, I migrated the backend from NestJS/VPS to Cloudflare's serverless stack so routing, secrets, database persistence, and object storage run within a unified, low-maintenance production environment.
- • Mobile Client: Flutter / Dart (Cubit, Repository Pattern, Drift SQLite, Dio)
- • Backend API Execution: Cloudflare Workers (TypeScript REST handlers)
- • Relational Database: Cloudflare D1 (SQLite with versioned migrations)
- • Object & Media Storage: Cloudflare R2 (product images & business media)
- • Subscription Billing: Direct Google Play Billing + Workers RTDN webhooks
- • Earlier Backend Framework: NestJS (TypeScript modular controllers & services)
- • Earlier Hosting: Self-managed Linux Cloud VPS deployment
- • Architecture Evolution: Domain logic, authentication, store-scoped RBAC, inventory ledger rules, and API contracts were adapted from NestJS modules into stateless Cloudflare Workers handlers backed by D1 and R2.
- • Local SQLite persistence (Drift) for catalog, cart hold, and offline POS checkout
- • Queuing offline mutations (
pending_sales_transaction) and replaying on reconnect - • UI role affordances, barcode scanning, and Bluetooth ESC/POS receipt printing
- • Initiating Google Play Billing purchase flows and attaching bearer/store headers via Dio
- • Authoritative authentication, JWT issuance/rotation, and store-scoped RBAC enforcement
- • Transactional stock movement ledger commits and multi-unit inventory reconciliation in D1
- • Server-side Google Play purchase verification, RTDN lifecycle processing, and voucher validation
- • Aggregating store financial reports and managing signed media storage in Cloudflare R2
TRASAQU integrates directly with Google Play Billing from Flutter without third-party subscription middleware such as RevenueCat. Purchase tokens and subscription lifecycle events are verified authoritatively by the Cloudflare Workers backend:
Supports Free tier alongside Pro Solo, Pro Starter, and Pro Business plans governing multi-store limits, staff seats, and cloud sync capabilities.
After checkout on Android, the Flutter app sends the Google Play purchase token to Cloudflare Workers, which validates the purchase directly with Google Play Developer APIs before granting D1 entitlements.
Real-Time Developer Notifications (RTDN) notify the backend of renewals, cancellations, grace periods, and expirations so entitlement states stay accurate even when the app is closed.
Supports trial eligibility checks and promotional voucher codes engineered for first-billing-period discounts with server-side redemption limits.
Store-Scoped Authorization & Application Security Architecture
Permission Resolution Chain
Permissions are never hardcoded globally to a user record; instead, they are resolved dynamically from the user's membership in the currently active store:
Why a Contextual Store Membership Model?
A flat user.store_id column breaks as soon as an owner opens a second branch or assigns a staff member different responsibilities across locations:
Every API request carries the active store context, and Cloudflare Workers guards verify store membership and permission scope before executing any D1 query.
- • Flutter Secure Storage: Encrypted on-device storage for JWT access/refresh tokens and session credentials
- • Centralized Dio Interceptors: Automated bearer token injection, active store header propagation, and single-flight 401 token refresh queuing
- • Firebase Auth & Session Management: Verified identity onboarding paired with backend-issued JWT sessions
- • Backend RBAC & Validation: Store-scoped authorization guards, strict payload schema validation, structured error responses, and Workers runtime logging
- • Certificate Pinning & Root Detection: Planned as future mobile hardening if high-risk enterprise tiers require it (previously implemented in my enterprise Astra/SERA work on TRACtoGo, FMS Driver, and VIMA)
- • Play Integrity Attestation: Planned device attestation integration for automated abuse prevention
- • Granular Security Audit Stream: Expanding administrative audit log retention and anomaly alerting
Stock Is a History of Movements, Not Just a Single Overwritten Number
Storing inventory as a single mutable integer column makes it impossible to audit shrinkage or reconcile offline sales. TRASAQU records every stock change as an immutable movement ledger entry (purchase stock-in, POS sale deduction, manual adjustment, or stock opname) so current balances remain historically traceable.
A Single POS Sale Orchestrates Multiple Domains
Completing a cashier checkout involves a coordinated 16-step pipeline across authentication, store RBAC, unit conversion, stock ledger deduction, and financial accounting—far beyond a simple INSERT INTO sales statement:
Problems Solved Beyond Basic CRUD
Store internet drops during peak checkout hours can halt sales and frustrate customers.
Persist catalog in Drift SQLite and queue offline checkouts in pending_sales_transaction.
Cashier checkout must remain fast and uninterrupted regardless of network stability.
Access tokens expiring mid-shift while multiple API requests are in flight.
Centralized Dio & Axios refresh interceptors with single-flight request queuing.
Prevents race-condition logout loops and keeps auth logic out of UI screens.
Retailers buy in cartons/packs but sell in individual pieces or packs.
Normalized base-unit conversion ratios paired with an immutable stock movement ledger.
Prevents fractional rounding drift and preserves full auditability.
A user may be an Owner in Store A but help as a Cashier in Store B.
Store-membership role resolution evaluated per active store header on every API call.
Enforces strict tenant isolation and accurate permission boundaries.
Keeping subscription entitlements accurate across renewals, trials, and first-period vouchers.
Direct Google Play Billing on Flutter verified server-side via Cloudflare Workers & RTDN webhooks.
Eliminates third-party billing middleware fees while ensuring authoritative server entitlements.
Maintaining a stateful NestJS Linux VPS added patching and infrastructure overhead.
Migrated backend services to Cloudflare Workers, D1 relational SQLite, and R2 storage.
Allows a solo engineer to operate a production backend with minimal DevOps maintenance.
Architectural Choices With Explicit Trade-Offs
Clear separation across UI, Cubit, Repository, and Data Sources without redundant boilerplate.
Complex cross-domain rules require disciplined repository boundaries as features grow.
Type-safe relational SQL on Android for fast local catalog queries and pending sales persistence.
Requires explicit schema migration management and idempotent sync replay logic.
Replaced self-managed NestJS/VPS with zero-maintenance serverless execution, SQL, and object storage.
Required refactoring stateful NestJS patterns into stateless request-driven Workers handlers.
Full control over Pro Solo/Starter/Business tiers, first-period vouchers, and RTDN verification.
Higher initial backend implementation effort compared to using a wrapper like RevenueCat.
Designed Beyond the Happy Path
Centralized Dio & Axios interceptors queue concurrent requests and rotate tokens once.
Drift SQLite serves cached catalog and records sales into pending_sales_transaction.
Scoped Cubit states reset and active store context header updates across API calls.
Transactional D1 stock movement commits validate stock balances on sync.
RTDN webhooks update entitlements while preserving existing merchant historical data.
Distributed conflict resolution across multiple simultaneously offline cashier devices is planned for future iterations.
Automated Quality Gates, CI/CD Workflows & Google Play Production
Engineering responsibility extended all the way to live production delivery. Code quality is enforced through Flutter static analysis (flutter analyze), unit tests covering Cubit state transitions and repository synchronization logic, and widget tests for core UI flows. Release workflows are automated with GitHub Actions—handling dependency resolution, code generation, test execution, Android Keystore signing, staging distribution via Firebase App Distribution, and production release packaging (.aab) for Google Play Store.
Unit tests, widget tests, and strict flutter analyze lint gates
Automated builds, codegen, Android signing & Firebase App Distribution
Workers deployment, D1 SQL migrations, R2 buckets & secret management
Production — Live on Google Play (com.trasaqu.trasaqu)
Production — Live on Google Play
Package: com.trasaqu.trasaqu · Official Android Production Release
Retail First. Shared Platform Next.
TRASAQU intentionally launched with a concrete Retail and Grocery domain rather than attempting to model every business category at once. With core platform capabilities validated in production on Google Play, shared foundation layers can be reused as future domain-specific verticals are introduced.
- • Products & SKU
- • Packaging Units
- • Barcode Scan
- • Stock Movements
- • Raw Ingredients
- • Recipe / COGS
- • Menu Modifiers
- • Table / Kitchen
- • Weight / Kg Pricing
- • Service Stages
- • Ready & Pickup
- • Order Tracking
- • Vehicle Records
- • Service Work Orders
- • Mechanic Assignment
- • Spare Parts SKU
Different Businesses Share Transactions — Not Identical Workflows
Forcing every industry into a single generic POS screen creates brittle conditional logic. TRASAQU reuses shared platform infrastructure (auth, RBAC, billing, sync) while allowing each business vertical to maintain purpose-built domain workflows.
From Independent Production Release to Collaborative Expansion
The live TRASAQU Retail platform was independently designed, architected, and shipped to production on Google Play by me. As TRASAQU expands beyond its initial Retail and Grocery scope, future multi-vertical development is planned in collaboration with Kōhī Labs as a technology partner.
- • Domain Research, PRD & UX/UI Design
- • Offline-First Flutter Mobile App + React Admin Web
- • Cloudflare Workers + D1 + R2 Backend (Migrated from NestJS)
- • Direct Google Play Billing + RTDN & Play Store Release
- • Technology & Product Engineering Collaboration
- • Shared Multi-Tenant Platform Scaling
- • Distributed Multi-Terminal Conflict Resolution
- • New Business Verticals (F&B, Laundry, Auto Workshop)
Expand by Domain Validation, Not Feature Bloat
Verified Production Technology Stack
Key Engineering Lessons From End-to-End Ownership
Multi-branch retail requirements directly shaped the contextual StoreMember RBAC model and unit conversion tables.
Mobile UI role checks improve usability, but Cloudflare Workers store-scoped guards guarantee tenant security.
Recording stock as movement events rather than overwritten numbers prevents silent inventory drift.
Separating local Drift SQLite mutation queues from online-only cloud operations keeps POS checkouts fast and predictable.
End-to-End Product Engineering Summary
TRASAQU demonstrates my ability to take a real-world business problem from product definition and architecture to a live production release on Google Play. I engineered the offline-first Flutter mobile application (Semi-Clean layered architecture, Cubit, Repository Pattern, Simplified Atomic Design, Drift SQLite mutation queues, and direct Google Play Billing), migrated the backend from NestJS to Cloudflare Workers with D1 and R2 storage, implemented RTDN subscription webhook verification, built the companion React/TypeScript admin dashboard, and automated CI/CD delivery with GitHub Actions.