How vigneshpy/moi-app works
Purpose and Active Product Boundary
Moi is an offline-first Expo/React Native mobile app for recording gifts (“moi”) for weddings and other functions. The active product stores all user data locally; it has no account, cloud, or required network path. The repository also retains an archived Express/MongoDB API, but the README identifies it as unused in offline mode.
Workspace and Entrypoints
The pnpm workspace contains mobile and API applications: pnpm-workspace.yaml, apps/mobile/package.json, and apps/api/package.json. Mobile startup and route composition begin in apps/mobile/app/_layout.tsx, with the initial route in apps/mobile/app/index.tsx. Expo Router maps the app/ filesystem into native navigation.
Mobile Navigation and User Flows
The tab shell is defined at apps/mobile/app/(tabs)/_layout.tsx; primary dashboard, event, gift, and profile surfaces live under apps/mobile/app/(tabs)/. Event workflows branch into modal routes for creation, details, and ledger review: apps/mobile/app/modal/events/AddEvents.tsx, apps/mobile/app/modal/events/EventDetails.tsx, and apps/mobile/app/modal/events/Ledger.tsx.
Offline Persistence Layer
SQLite is the system of record on-device. Database initialization/schema ownership is concentrated in apps/mobile/db/index.ts and apps/mobile/db/schema.ts. Domain CRUD and export-oriented data access are separated by entity in apps/mobile/db/events.ts, apps/mobile/db/gifts.ts, and apps/mobile/db/export.ts. This boundary allows UI/state code to operate against local persistence without an API dependency.
State, Presentation, and Localization
Zustand stores coordinate event and gift state between screens and the SQLite layer: apps/mobile/store/eventsStore.ts and apps/mobile/store/giftsStore.ts. Shared visual primitives encode the Tamil wedding design system in apps/mobile/components/ui/AppText.tsx, apps/mobile/components/ui/MangoFrame.tsx, and apps/mobile/theme/tokens.ts. Bilingual English/Tamil resources and i18n setup are in apps/mobile/i18n/index.ts, apps/mobile/i18n/en.json, and apps/mobile/i18n/ta.json.
Device Integrations and Runtime
The mobile runtime is Expo SDK 52 / React Native 0.76, configured by apps/mobile/app.json and apps/mobile/package.json. Local SQLite enables offline use; export uses device-side PDF generation and the native share sheet. Custom font loading is centralized in apps/mobile/theme/useFonts.ts; event/gift domain typing and formatting support reside in apps/mobile/lib/event-types.d.ts and apps/mobile/lib/event-utils.ts.
Archived Server Capability
The legacy backend is an Express service with MongoDB-facing connection/model layers: apps/api/src/index.ts, apps/api/src/connection/db.ts, and apps/api/src/models/eventModel.ts. It exposes route/controller paths for authentication, events, gifts, RSVPs, transactions, SMS, and S3 upload, including apps/api/src/routes/eventRoutes.ts, apps/api/src/controllers/sendSMS.ts, and apps/api/src/controllers/s3Uploader.ts. It can run in Docker or be packaged for AWS Lambda via apps/api/Dockerfile, apps/api/src/lambda.ts, and apps/api/serverless.yml, but is outside the current offline mobile data flow.
Main entry points: (tabs)/_layout.tsx Tab navigation · index.ts Legacy Express API · app/_layout.tsx Root router · package.json Expo mobile runtime
Components 19
Mobile app
Expo Router offline-first client.
- Expo mobile runtime
apps/mobile/package.json - Root router · Bootstraps navigation and route composition.
apps/mobile/app/_layout.tsx - Initial route
apps/mobile/app/index.tsx - Tab navigation · Hosts dashboard, event, gift, and profile surfaces.
apps/mobile/app/(tabs)/_layout.tsx - Event modal flows · Creation, details, and ledger review workflows.
apps/mobile/app/modal/events/AddEvents.tsx - Event and gift state · Coordinates state between screens and persistence.
apps/mobile/store/eventsStore.ts - Tamil wedding UI
apps/mobile/components/ui/AppText.tsx - English and Tamil i18n
apps/mobile/i18n/index.ts - Custom fonts
apps/mobile/theme/useFonts.ts
Offline data
On-device persistence and export.
- SQLite schema and initialization · System of record for all active user data.
apps/mobile/db/index.ts - Event and gift CRUD
apps/mobile/db/events.ts - Export data access
apps/mobile/db/export.ts - PDF and native sharing · Generates exports locally and opens the share sheet.
Archived API
Retained but outside the active product flow.
- Legacy Express API · Archived capability; unused by offline mobile mode.
apps/api/src/index.ts - MongoDB models
apps/api/src/connection/db.ts - API routes · Includes event, gift, RSVP, transaction, and auth paths.
apps/api/src/routes/eventRoutes.ts - SMS and S3 upload
apps/api/src/controllers/sendSMS.ts - Docker and Lambda packaging
apps/api/Dockerfile
Other components
- pnpm workspace · Contains mobile and archived API applications.
pnpm-workspace.yaml
Connections 21
- pnpm workspace → Expo mobile runtime: contains
- pnpm workspace → Legacy Express API: contains
- Expo mobile runtime → Root router: runs
- Root router → Initial route: starts at
- Root router → Tab navigation: composes
- Tab navigation → Event modal flows: opens
- Root router → Custom fonts: loads
- Tab navigation → Event and gift state: reads and updates
- Event modal flows → Event and gift state: reads and updates
- Tab navigation → Tamil wedding UI: renders with
- Tab navigation → English and Tamil i18n: localizes with
- Event and gift state → Event and gift CRUD: persists through
- Event and gift CRUD → SQLite schema and initialization: reads and writes
- Export data access → SQLite schema and initialization: queries
- Event modal flows → Export data access: requests ledger export
- Export data access → PDF and native sharing: supplies export data
- Legacy Express API → API routes: serves
- Legacy Express API → MongoDB models: uses
- API routes → SMS and S3 upload: invokes
- Legacy Express API → Docker and Lambda packaging: packaged for
- Expo mobile runtime → Legacy Express API: no active dependency · Offline mode does not call the archived API.