Work / DwarSeva / Architecture
DwarSeva architecture
One NestJS GraphQL server and a Postgres database serve a phone app, an admin console and a marketing site. Nothing is recorded as live, and no bill has been read. No SMS or email provider is wired, so nothing is sent; outside production the codes go to the server log.
last verified 2026-10-30
Known cost a month
$0
The wiki says the owner pays $0 today. No bill or receipt was read. The same note puts EC2 near $15 and store fees near $8 at list price, if it were all running.
Is it live?
Not known
On 2026-10-04 no host answered. ops/release.yml records nothing as live.
What makes cost grow
Nothing metered
No per-use paid API is called. Cost grows with servers and storage, not with use.
How it fits together
Pick something a user does to see its path and what it costs.
$0, and no SMS goes out
- The phone asks for a code.
- The server makes a code, stores only its hash, and allows one resend a minute.
Cost
Every number says where it came from.
| Service | Pays for | Today | Grows with | Basis |
|---|---|---|---|---|
| Mobile app | Expo 54. Residents, guards and society admins in one app, tabs chosen by role | $0 | Nothing | StatedCLAUDE.md; wiki/concepts/role-gate.md |
| Website and admin console | Next.js sites on Cloudflare Pages (cd.yml also tries AWS) | Not read | Page views, if the free tier is passed | Not known |
| api | NestJS 11 and Apollo GraphQL. One worker. Runs on EC2 in ap-south-1 per cd.yml | Not read | Instance size, not use | Not knownwiki/concepts/architecture.md gives ~$15 at list price; no bill read |
| Postgres | Societies, units, members, bills, visitors, OTP hashes. Prisma 7. Host not recorded | Not read | Rows and storage | Not known |
| Photo storage | Not read | Visitor photos stored | Not known | |
| Expo push | Pushes a notice to residents and guards | $0 | Nothing | Assumed |
| Email and SMS | $0 | Nothing until a provider is added | In code | |
| EAS and the stores | Mobile builds, and the App Store and Google Play listings | Not read | Builds | Not knownwiki/concepts/architecture.md names ~$8 for store fees; eas.json submit block holds placeholder ids |
What breaks when something fails
| If this fails | The user sees | Their data | Basis |
|---|---|---|---|
| Website and admin console | The marketing site and the super-admin console do not load. The phone app is unaffected. | None held there | AssumedThe sites call the API; no data is stored in them |
| api | Nothing works: every screen reads and writes through this server. | Safe in Postgres. Nothing is kept on the phone. | AssumedNo offline code was looked for; no incident recorded |
| Postgres | Every request fails. Health check cannot pass. | Not known: no backup or restore step is recorded. | Not known |
| Photo storage | The photo upload fails with "Upload failed". If the bucket is not set up, the server returns the photo inline as a base64 data URI instead. | In the fallback, the photo is not stored on the server at all. | In codeapps/server/src/api/upload/visitor-photo.controller.ts |
| Expo push | No push arrives. The notice is already saved, so it shows in the app. | Safe | In code |
| Email and SMS | Not applicable: users never receive a code or a link. | Codes are stored only as hashes in production | In code |
Where the data goes
| Users, phone and email | Postgres |
| Visitor photos | The bucket, or inline in the response if none is set up |
| Login sessions | Postgres. A 02:00 job cleans them. |
What we do not know yet
- Hosting is being migrated (owner, 2026-10-30): task T015 moves it from AWS and Cloudflare Pages to Cloud Run in asia-south1. Costs here are before the move.
- The real monthly bill: no AWS, Cloudflare, EAS or database cost is recorded. $0 comes from one wiki line, not a receipt.
- Whether anything is live. ops/release.yml has live: null for every surface; no host answered on 2026-10-04.
- Where Postgres runs, and whether it is backed up. Only a DATABASE_URL in SSM is mentioned.
- Hosting is declared twice: cd.yml also deploys admin to EC2 and the website to S3/CloudFront, while setup.md says Cloudflare Pages. Which one is real, and whether both are billed, is not known.
- No test suite exists. CI runs lint, typecheck and builds only, and cd.yml ignores lint failures.
- The root Dockerfile runs apps/web/server.js, which is not in this repo.