How ebrahimgad123/medremind-reactnative works
Project type and purpose
• This is a cross-platform mobile application built with Expo and React Native (TypeScript).
• It provides medication reminders, scheduling, and local notification functionality.
• There is no separate backend server in the repo; all data storage and scheduling logic lives on the device (AsyncStorage and Expo Notifications).
File structure
• Top level:
• android/ — native Android “shell” (Gradle scripts, MainActivity.kt, MainApplication.kt)
• app/ — Expo Router pages (file-based routing: addMedication.tsx, auth.tsx, home.tsx, etc.)
• components/ — reusable UI (CircularProgress, NotificationDrawer)
• utils/ — helper modules (Storage.ts for AsyncStorage; notification.ts for scheduling via Expo Notifications)
• assets/ — fonts and images
• constant/ — value definitions (constantHome.tsx)
• config files: app.json, eas.json, tsconfig.json, package.json, metro (implicit via Expo)
README
• Confirms it’s generated by create-expo-app.
• Uses file-based routing in the app/ directory via Expo Router.
• No explicit backend instructions → client-only.
Main components
a. Developer & Toolchain
• Expo CLI / Metro Bundler (local dev server)
• npm / eas (build & publish)
b. Mobile Host (Android & iOS runtimes)
• Native shell (MainActivity.kt & MainApplication.kt on Android; similar on iOS in Expo client)
• JavaScriptCore / Hermes runtime
c. JavaScript Application
• App entry (_layout.tsx) and Router → Screen modules under app/
• Reusable UI components (components/)
• Domain logic (utils/, constant/)
• Assets loader (fonts/images)
d. Persistence & Notifications
• AsyncStorage (via utils/Storage.ts)
• Expo Notifications API (via utils/notification.ts + native bridge)
e. External Services (optional)
• Expo push notification service (for remote pushes, if used)
• Over-the-air updates (Expo Updates)
Relationships & data flow
• Developer invokes Expo CLI → Metro Bundler serves JS bundle → Device runtime loads bundle
• User interacts with UI screens → components call domain logic in utils → state read/write to AsyncStorage
• Scheduling a reminder → utils/notification.ts calls Expo Notifications native API → OS schedules local push
• At runtime, Notifications → delivered to app → NotificationDrawer component renders
Architectural patterns & design principles
• File-based routing (one TSX file = one screen)
• Modular separation: UI (components) vs. business logic (utils/constant)
• Native-JS bridge (Expo’s managed workflow)
• Client-only data layer (no remote API)