Skip to content

Work / Chitragupt / Architecture

Chitragupt architecture

An Indian tax-and-money app. A website on Cloud Run and an Android app talk to Firebase in Mumbai. About 190 functions read uploaded documents, with regex first and Claude Haiku only as a fallback. It has not launched and has no customers.

last verified 2026-10-30

Known cost a month
₹156
Google Cloud only, forecast ₹165 for October, against a ₹500 alert. Claude, Razorpay, RevenueCat and KYC are not read.
What makes cost grow
Documents the regex cannot read
Only those go to Claude Haiku. Ask AI is the other model call, capped at 5 questions a day on AI Self.

How it fits together

Pick something a user does to see its path and what it costs.

On the phone and browserOur servers · asia-south1 (Mumbai)Outside servicesAndroid app and websiteAndroid app and websiteExpo app (iOS not shipped); the site is Next.js$0chitragupt-webchitragupt-webCloud Run · 1 GiB · 1 CPU · serves the site₹3.08: Hosting ₹2.91, Cloud Run ₹0.17Cloud FunctionsCloud Functions192 deployed · max 5 instances each · Node 24 · about 20 scheduled jobs₹0, after ₹284.90 of free tierFirestore, Storage, AuthFirestore, Storage, AuthAll user data, documents and sign-in₹9.61 Storage; no Firestore lineClaude Haiku 4.5Claude Haiku 4.5Reads odd documents; answers Ask AINot readRazorpayRazorpayWebsite unlock payments, refunds, CA paymentsNot readRevenueCatRevenueCatAndroid unlocks through Play BillingNot readZeptoMail (Zoho India)ZeptoMail (Zoho India)Sign-in codes and all emailNot readKYC vendorKYC vendorPAN and Aadhaar check before hiring a CANot readSentry and PostHogSentry and PostHogErrors from functions; anonymous events from the appNot readCloud SchedulerCloud SchedulerRuns the timed jobs · the biggest line₹117.97, 76% of the billRegistry, keys, secretsRegistry, keys, secrets
Not read
  1. The app asks for a code.
  2. The function stores a code and rate-limits by IP.
  3. It asks ZeptoMail to send it.
  4. No code arrives and the user cannot sign in.

Cost

Every number says where it came from.

ServicePays forTodayGrows withBasis
Android app and websiteExpo app (iOS not shipped); the site is Next.js$0NothingStatedCLAUDE.md; wiki/decisions/payments.md (iOS is out of scope)
chitragupt-webCloud Run · 1 GiB · 1 CPU · serves the site₹3.08: Hosting ₹2.91, Cloud Run ₹0.17Page requestsMeasuredCloud Billing report, Oct 1-30, read 2026-10-30
Cloud Functions192 deployed · max 5 instances each · Node 24 · about 20 scheduled jobs₹0, after ₹284.90 of free tierUploads, calls and the 5-minute payment checkMeasuredCloud Billing report, Oct 1-30, read 2026-10-30
Firestore, Storage, AuthAll user data, documents and sign-in₹9.61 Storage; no Firestore lineStored documents (200 MB free, 5 GB paid per user) and readsMeasuredCloud Billing report, Oct 1-30, read 2026-10-30
Claude Haiku 4.5Reads odd documents; answers Ask AINot readDocuments that fail regex; Ask AI questionsNot known
RazorpayWebsite unlock payments, refunds, CA paymentsNot readPayments takenNot known
RevenueCatAndroid unlocks through Play BillingNot readRevenue from app purchasesNot known
ZeptoMail (Zoho India)Sign-in codes and all emailNot readEmails sentNot known
KYC vendorPAN and Aadhaar check before hiring a CANot readKYC checksNot known
Sentry and PostHogErrors from functions; anonymous events from the appNot readEventsNot known
Cloud SchedulerRuns the timed jobs · the biggest line₹117.97, 76% of the billNumber of scheduled jobsMeasuredCloud Billing report, Oct 1-30, read 2026-10-30

What breaks when something fails

If this failsThe user seesTheir dataBasis
chitragupt-webThe website is down. The phone app and the functions are separate.Safe in Firestore and StorageAssumed.github/workflows/deploy.yml deploys it on its own; no outage test named
Cloud FunctionsUploads stay unread, sign-in and payments fail.Stored files are kept. Hourly sweep retries documents left in parse_pending.In codeapps/functions/src/index.ts; triggers/scheduled/hourly-sweep-parse-pending.ts
Firestore, Storage, AuthNothing works.Single region, no second copy recordedStatedwiki/decisions/infrastructure.md (multi-region rejected)
Claude Haiku 4.5The document waits and is retried, or lands as needs_classification. Ask AI says it is unavailable and gives the question back.Safe; the file stays in StorageIn codeparser/llm-fallback.ts (3 tries, 60 s each); ai/ask-ai.ts decrementAiQuota
RazorpayCannot pay on the web. A payment taken while we are down is found by a check every 5 minutes.SafeIn codetriggers/scheduled/five-minutely-razorpay-reconciler.ts; firebase.json webhook rewrite
RevenueCatCannot buy in the app. The six per-AY products are not created yet, so there is nothing to buy today.SafeStated.context/ops/release.yml (in_app_products: not_created); tasks.md T006
ZeptoMail (Zoho India)No sign-in code arrives. The screen still says it was sent.SafeIn code
Sentry and PostHogNothing visible.SafeIn code_lib/sentry.ts is a quiet no-op without a DSN

Where the data goes

Uploaded tax documentsStorage in Mumbai. Text-less PDFs and photos also go whole to Anthropic when regex fails.
Text of other documentsTo Anthropic, with PAN, email and phone swapped for placeholders and Aadhaar dropped
Ask AI questions and parsed fieldsTo Anthropic, scrubbed of PAN, Aadhaar, email and phone patterns
Camera scansRead on the phone with Google ML Kit; only text is uploaded
Firebase user ID and store receiptsRevenueCat, United States
Anonymous app eventsPostHog, EU
Recipient email addressesZeptoMail, India data centre

What we do not know yet

  • Hosting is being migrated (owner, 2026-10-30), but the target is not written down yet: wiki/decisions/infrastructure.md still describes today. Costs here are before the move.
  • Claude, Razorpay, RevenueCat, ZeptoMail, KYC, Sentry and PostHog bills are not read.
  • Haiku cost per document and per question: no log or bill is recorded. The only figure is a code comment, $0.008 to $0.012 a document, not tested.
  • wiki/synthesis/pricing.md and ops/release.yml are old (2026-08-10 and 2026-10-04). The deployed function count and Cloud Run revision may have moved.
  • Razorpay fee per payment, Play developer fee and EAS cost are not recorded.
  • No customers and no tag deploy have happened, so usage numbers do not exist; growth is left out on purpose.