How arshdeepsingh2267/dine-time works
Project Type and Purpose
• This is a cross-platform mobile application (built on Expo/React Native with the new App Router) for restaurant table reservations.
• Core features include user authentication (sign-in/sign-up), browsing restaurants, selecting dates/slots, picking guest counts, viewing booking history, and profile management.
• It leverages Firebase (Auth & Firestore) as its backend and uses NativeWind (Tailwind CSS for React Native) for styling.
High-Level Architectural Components
a. Mobile Client (Expo/React Native)
• App Router (app/) for file-based navigation
• Screens & Layouts (app/(auth)/, app/(tabs)/, app/restaurant/[restaurant].jsx)
• UI Components (components/restaurant/*.jsx)
b. State Management
• store/restaurants.js (Zustand or Redux-like store for restaurant data and slot selections)
c. Business Logic & Validation
• utils/authSchema.js, utils/guestFormSchema.js (Yup or Zod schemas for form validation)
d. API / Service Layer
• config/firebaseConfig.js (initializes Firebase SDK, Auth, Firestore)
• config/bulkupload.js (CLI script for bulk loading restaurant data into Firestore)
e. External Services
• Firebase Authentication (user sign-up, sign-in, session management)
• Firestore Database (restaurants, bookings, user profiles)
• (Optional) Firebase Storage or Cloud Functions if extended
f. Build & Tooling
• babel.config.js, metro.config.js (Expo/React Native bundling)
• tailwind.config.js & nativewind-env.d.ts (styling setup)
• tsconfig.json (TypeScript support)
Relationships and Data Flows
• User taps a screen → React Navigation (App Router) loads a layout/screen component
• Screen component reads/writes to the local store for UI state (e.g., selected date, guest count)
• On actions (e.g., “Find Slots”), the component calls Firebase service methods (via firebaseConfig)
• Firebase Auth handles user credentials → issues a token → stored in local async storage by Expo
• Firestore queries/updates restaurant and booking collections → returns data to screen
• Bulk data upload script (config/bulkupload.js) runs offline/admin → writes initial restaurant records to Firestore
Architectural Patterns & Principles
• File-based routing (App Router) separates concerns by feature (auth, tabs, restaurant)
• Component-driven UI: small, reusable components under components/restaurant
• Centralized state store for cross-screen data sharing
• Service/Config layer abstracts away Firebase initialization and raw SDK calls
• Validation schemas decouple form logic from UI
Essential Details to Capture
• Separation of concerns: UI vs. state vs. service vs. validation
• File-based routing structure under app/
• Key external dependencies (Firebase Auth & Firestore)
• Data flow from user action → state → Firebase → UI update
• Deployment/build pipeline (Expo bundler, Babel, Tailwind config)