How davidsosamoriana/food_ordering_app works
Project Type and Purpose
• This is a cross-platform mobile application built with Expo (React Native) that follows Expo’s file-based routing.
• It appears to be a shopping or e-commerce style app (tabs for cart, search, profile; auth flows; Appwrite SDK for backend/data).
File Structure Analysis
Top-level directories:
• app/ – file-based router: layouts and screens under (auth) and (tabs)
• components/ – reusable UI components (buttons, inputs, loading screen)
• contexts/ – React contexts (AuthContext) for dependency injection of auth state
• store/ – Zustand store for persistent client-side state (auth.store.ts)
• lib/ – Appwrite SDK wrapper (appwrite.ts), data API (data.ts), database seeding (seed.ts)
• constants/ – application constants
Configuration: babel.config.js, metro.config.js, tsconfig.json, tailwind.config.js, eslint.config.js
Key Insights from README
• Expo-managed project using create-expo-app
• File-based routing for screen definitions
• Run via “npx expo start” to target emulator, Expo Go, or development build
Main Components & Their Interactions
a. Mobile App (React Native/Expo)
– Screens & Layouts (app/(auth), app/(tabs), app/_layout.tsx)
– UI Components (components/)
– Styling via Tailwind (nativewind + tailwind.config.js)
b. State Management
– AuthContext (provides user session info)
– Zustand store (auth.store.ts) for reactive state
c. Data Layer
– lib/appwrite.ts: initializes Appwrite client (authentication, database, storage)
– lib/data.ts: exports data-access functions (CRUD)
– lib/seed.ts: script to populate initial data in backend
d. Assets & Constants
– assets/: static media referenced by UI
– constants/: shared app constants (e.g., route names, API keys)
e. External Service
– Appwrite server (self-hosted or cloud) providing Auth, Database, Storage APIs
Architectural Patterns & Design Principles
• Layered architecture:
– Presentation layer (screens + UI components)
– State & Context layer (Zustand stores + React contexts)
– Data layer (Appwrite wrapper + business logic)
• File-based routing organizes navigation into segments
• Separation of concerns: UI, state, API, assets are in clear directories
• Single source of truth for auth state in both Context and store