πŸ’° DigiGold App

End-to-End Digital Gold Investment Platform

I independently designed, built, and deployed the DigiGold App, handling backend services, React Native Expo mobile app, and infrastructure setup. Below is a detailed breakdown of my tech stack choices with cost and scalability considerations.

πŸ’³ Online Payments (In Progress)

Currently, online payment integration is in development. We are in discussions with a payment provider, and approval is pending. Once integrated, all scheme transactions will be seamlessly linked with payment records for full auditability.

☁️ Architecture Diagram

πŸ’³ Scheme Domain Design

The DigiGold app supports structured gold saving schemes, designed to handle metals, business rules, rewards, and financial transactions in a scalable way. Below is the conceptual breakdown:

  • Metals: Core entity representing the investment asset. Supports Gold and Silver initially, but extendable Platinum, etc. Each metal has attributes such as purity, live price.
  • Schemes: Defines user-facing savings plans (Daily, Weekly, Monthly). Includes duration, minimum contribution, and maturity conditions.
  • Scheme Business Rules: Encodes plan logic β€” e.g., Maximum scheme allowed, Scheme transaction window etc..
  • Scheme Rewards: Incentives applied on top of schemes, such as bonus gold grams on maturity or discounts on making charges. Configurable per scheme and tied into reward disbursement workflows.
  • Scheme Transactions: Records all user contributions and resulting gold allocation (grams purchased at real-time price). Immutable ledger ensuring auditability and reconciliation with payments.

βœ… Result: A domain-driven design that ensures DigiGold schemes are flexible, auditable, and extensible for new metals, business rules, and reward models. This structure provides a strong foundation for compliance, customer trust, and growth.

☁️ Serverless vs Server

I chose Serveress over server-based deployments. For ~1000 MAUs, Serverless pay-per-request model ensures cost efficiency, while traditional servers would incur fixed monthly costs even when idle.

☁️ Serverless Compute Choice β€” AWS Lambda vs Fargate Serverless

For 1,000 MAUs, each using the app ~10 times/month and triggering 5–10 API calls per session, the monthly traffic is 50k–100k API calls. Below is the cost breakdown for AWS Lambda and AWS Fargate Serverless.

  • Duration per request: 200 ms
  • Lambda memory sizes: 128 MB and 512 MB
  • Fargate configs: 0.25 vCPU + 0.5 GB, 0.5 vCPU + 1 GB
Configuration AWS Lambda AWS Fargate Serverless
128 MB / 0.25 vCPU + 0.5 GB $0 (covered by free tier)
2,500 GB-s, 100k requests < 400k GB-s + 1M requests free
$0.068 / month
100k Γ— (0.25 vCPU + 0.5 GB Γ— 0.2s)
512 MB / 0.5 vCPU + 1 GB $0 (covered by free tier)
10,000 GB-s < 400k GB-s free
$0.137 / month
100k Γ— (0.5 vCPU + 1 GB Γ— 0.2s)

βœ… At 1,000 MAUs (≀100k API calls/month): Lambda runs entirely free, while Fargate Serverless costs just a few cents.
βœ… Scaling beyond free tier: Lambda costs grow per request + GB-s, while Fargate Serverless charges per vCPU-second + GB-second (predictable for heavier workloads).
βœ… Why Lambda here? Zero cost at current scale, automatic scaling, minimal ops overhead.

πŸ—„οΈ Database Choice β€” CockroachDB Serverless vs Aurora Serverless v2

For database, I compared CockroachDB (serverless, distributed SQL) with Aurora. With 50M free Request Units (RUs) on CockroachDB, small-to-medium scale workloads fit entirely in free tier.

For 1,000 MAUs (~100k API calls/month), each request consumes ~ 2 Request Units (RUs). That’s ~ 200k RUs/month, plus ~ 5 GB storage for user & transaction data.

  • Workload: 70% reads, 30% writes
  • RU consumption: ~2 RUs per API call β†’ 100k Γ— 2 = 200k RUs
  • Storage baseline: ~5 GB
Configuration CockroachDB Serverless Aurora Serverless v2
Compute / RUs 200k RUs < 50M free
$0 (well under free quota)
Billed in ACUs (~$0.06/ACU-hour)
For 0.5–1 ACU baseline = ~ $21–$43/month
Storage (5 GB) $0 (10 GB free storage) ~$0.10/GB = $0.50/month
Scaling Auto-scales RUs within quota
Generous free tier for early stage
Auto-scales ACUs in fine-grained steps
Better for heavier workloads

βœ… At 1,000 MAUs: CockroachDB Serverless runs entirely free (200k RUs β‰ͺ 50M free, 5 GB β‰ͺ 10 GB free).
βœ… Aurora Serverless v2: Always-on baseline capacity (~0.5–1 ACU) costs ~$20–40/month, even at low traffic.
βœ… Why CockroachDB here? Zero cost at current scale, built-in HA, and no upfront compute billing. Aurora shines at higher scale with enterprise-grade AWS ecosystem integration.

πŸ” Cognito + Custom SMS Sender

For the DigiGold app, I implemented AWS Cognito with a Custom SMS Sender to deliver OTPs and MFA codes through an existing business SMS provider, ensuring better deliverability, branding, and cost efficiency.

  • Authentication: Cognito generates and validates OTPs securely.
  • Custom SMS Flow: Lambda decrypts codes (AWS Encryption SDK + KMS) and sends via provider API.
  • Secrets Management: Provider credentials stored in AWS Secrets Manager.
  • Operational Benefits: Full control of sender IDs, delivery receipts, and compliance with regional SMS rules.
  • Scalability: Lambda auto-scales with demand; no infrastructure to manage.
πŸ’° Cost Breakdown @ 1,000 MAUs
  • AWS KMS: ~$1 / month (for encryption key usage)
  • SMS Delivery: ~10,00 OTPs Γ— β‚Ή0.15 = ~β‚Ή150 / month (~$2)
  • Total: ~β‚Ή230 / month (~$3)

βœ… Result: Seamless multi-factor authentication with secure, branded SMS delivery, leveraging Cognito’s security while keeping costs predictable with the existing SMS provider.

βš™οΈ Backend Framework & Data Layer

For the DigiGold app, I built the backend using NestJS with Fastify as the HTTP adapter, and TypeORM for the data access layer. This combination provided high performance, scalability, and a clean developer experience.

Aspect NestJS + Fastify NestJS + Express
Performance πŸš€ 2x faster request handling
Lower latency under concurrent load
Standard performance
Slower under high concurrency
Resource Usage Lightweight, better memory efficiency
Ideal for serverless/Lambda
Higher memory footprint
More overhead for small instances
Ecosystem Compatible with NestJS decorators, DI, and middleware
Fully supported
Mature ecosystem, large community
Well-known in industry
TypeORM Integration First-class support
Works seamlessly with Postgres, CockroachDB, Aurora
Same ORM support
But slightly more overhead per query
πŸ“Š Data Layer (TypeORM)
  • Unified ORM layer with Postgres-compatible DBs (CockroachDB, Aurora).
  • Entity-driven design with migrations and schema sync.
  • Optimized queries to stay within free RU limits for CockroachDB.
πŸ“± Mobile App (React Native Expo)
  • Expo for rapid development, OTA updates, and smaller team velocity.
  • Integrated with backend APIs via Axios/GraphQL (secured with Cognito JWT).
  • Firebase Crashlytics & Analytics for app monitoring and user insights.
  • Firebase Cloud Messaging for push notifications.

βœ… Result: A backend optimized for serverless performance and low cost, paired with a cross-platform mobile app (iOS + Android) for a seamless DigiGold user experience.

☁️ Lambda with TypeORM vs Plain JavaScript Functions

While simple JavaScript functions could directly query the database inside AWS Lambda, I chose TypeORM with NestJS for DigiGold. This decision provided strong consistency, maintainability, and scalability for a financial-grade application.

Aspect Lambda + TypeORM Lambda + Plain JS Functions
Code Organization βœ… Entity-driven models, repositories
βœ… Reusable services, clean architecture
❌ Ad-hoc SQL strings
❌ Harder to maintain and scale
Database Portability βœ… Works seamlessly with Postgres, CockroachDB, Aurora
βœ… Easy migration scripts
❌ Vendor lock-in (raw queries)
❌ No migration tooling
Security & Validation βœ… Automatic query sanitization
βœ… Strong typing with entities
❌ Risk of SQL injection
❌ Manual validation required
Maintainability βœ… Standardized patterns
βœ… Onboarding-friendly for teams
❌ Logic scattered in functions
❌ Harder to debug complex flows
Performance in Lambda ⚑ Slightly higher cold start due to ORM init
But optimized with connection pooling + Fastify
⚑ Lower cold start overhead
But higher dev/ops cost in the long run

βœ… Why TypeORM? Even though plain JS functions are lighter, TypeORM ensures long-term scalability, security, and developer productivity β€” all critical for a financial app like DigiGold, where data integrity and maintainability matter more than a few milliseconds of cold-start latency.

πŸ“± React Native Expo vs Plain React Native CLI

For the DigiGold mobile app, I chose React Native with Expo over plain React Native CLI to accelerate development, streamline deployment, and ensure consistent cross-platform behavior.

Aspect React Native + Expo Plain React Native CLI
Setup & Development Speed βœ… Simplified setup
βœ… Pre-configured tooling, OTA updates via Expo
βœ… Fast iteration with Expo Go app
❌ Manual configuration for iOS/Android
❌ Slower iteration without Expo tools
Cross-Platform Consistency βœ… Single build system for iOS & Android
βœ… Handles native dependencies internally
❌ Separate native project management required
❌ More risk of platform-specific bugs
Build & Deployment βœ… OTA updates without app store resubmission
βœ… EAS Build supports staging & production builds
❌ Requires Xcode/Android Studio for every build
❌ OTA updates require custom infrastructure
Performance & Flexibility ⚑ Slightly larger binary and minor performance overhead for managed workflow
⚑ Can eject if full native control is needed
⚑ Leaner binaries
⚑ Full native control by default

βœ… Why Expo? Chose Expo for faster development, OTA updates, cross-platform consistency, and simplified integration with backend (Cognito + TypeORM) and analytics tools (Firebase). Ejected only when deeper native control was required.

πŸ” Monitoring, Engagement & CI/CD

  • Firebase Crashlytics β†’ Real-time error reporting for React Native app
  • Firebase Analytics β†’ User behavior insights and engagement tracking
  • Firebase Cloud Messaging β†’ Push notifications for user engagement
  • AWS CloudWatch β†’ Logs, metrics, and alerts for backend (Lambda, Fastify + NestJS)
  • CI/CD with GitHub Actions β†’ Automated build, test, and deployment pipelines for both backend and mobile app (staging & production)

βœ… Result: Full-stack monitoring with real-time alerts, actionable analytics, and automated deployment pipelines for faster iteration and reliable production releases.

πŸ§ͺ Integration Testing & Code Coverage

To ensure the DigiGold app is reliable and production-ready, I built a strong integration testing suite covering backend services, authentication flows, and database interactions.

  • Automated tests written in Jest within the NestJS framework.
  • Covered end-to-end flows: user onboarding β†’ authentication β†’ gold schemes β†’ gold transactions.
  • CI/CD integration: GitHub Actions runs all tests on every commit/pull request before deployment.
  • Achieved Test Parallism with test containers, and making sure every tests run isolated.
  • Achieved 90%+ coverage, aiming for 99%+ full coverage.
Integration Test Coverage Report

Current coverage: 90%+ (Target: 99%+)

βœ… Result: Reliable deployments with confidence in backend correctness, reducing production issues and ensuring financial-grade stability.