A comprehensive React Native mobile application for facility booking and management, built with Expo and TypeScript.
- Authentication Flow: Secure login and registration
- Facility Browser: Browse available facilities with Indonesian localization
- Interactive Calendar: Custom weekly date picker with month navigation
- Time Selection: Grid-based time slot selection with real-time availability
- Booking Process: Complete booking flow with confirmation
- Profile Management: User profile viewing and editing capabilities
- Facility Management: Browse available facilities with search and filtering
- Booking Management: View, manage, and cancel personal bookings
- User Profiles: Complete profile management with authentication
- Node.js (v18 or higher)
- npm or yarn
- Expo CLI (
npm install -g expo-cli) - iOS Simulator or Android Emulator for development
-
Clone the repository
git clone <repository-url> cd react-native-booking
-
Install dependencies
npm install
-
Start development server
npm start # or expo start -
Run on device/simulator
# iOS npm run ios # Android npm run android # Web (for testing) npm run web
src/
├── components/ # Reusable UI components
│ ├── forms/ # Form-specific components
│ │ ├── DatePicker.tsx # Custom weekly calendar
│ │ └── Input.tsx # Styled input component
│ └── ui/ # General UI components
│ ├── Button.tsx # Custom button component
│ └── FacilityCard.tsx # Facility display card
├── hooks/ # Custom React hooks
│ ├── useFacilities.ts # Facility data management
│ ├── useBookings.ts # Booking operations
│ └── useProfile.ts # User profile management
├── services/ # API and external services
│ └── api.ts # Centralized API service
├── store/ # Global state management
│ └── authStore.tsx # Authentication state (Zustand)
├── types/ # TypeScript definitions
│ ├── facility.ts # Facility-related types
│ ├── booking.ts # Booking-related types
│ └── auth.ts # Authentication types
└── utils/ # Utility functions
├── validation.ts # Form validation schemas
└── storage.ts # Local storage utilities
app/ # Expo Router file-based routing
├── (auth)/ # Authentication flow
│ ├── login.tsx # Login screen
│ └── register.tsx # Registration screen
├── (main)/ # Main application
│ ├── (tabs)/ # Bottom tab navigation
│ │ ├── index.tsx # Facilities list (Home)
│ │ ├── bookings.tsx # My bookings
│ │ └── profile.tsx # User profile
│ ├── detail/ # Facility details
│ │ └── [id].tsx # Dynamic facility detail
│ ├── booking/ # Booking creation
│ │ └── [id].tsx # Booking form
│ └── booking-detail/ # Booking management
│ └── [id].tsx # Booking detail & cancellation
└── _layout.tsx # Root layout and providers
- React Native (0.74.5): Cross-platform mobile development framework
- Expo (51.0.28): Development platform and build toolchain
- TypeScript: Static typing for enhanced developer experience and code quality
- Expo Router (3.5.23): File-based routing system
- Why chosen: Convention over configuration, automatic type safety
- Benefits: Reduced boilerplate, excellent TypeScript integration
- Use case: Seamless navigation between screens with type-safe parameters
- Zustand (4.5.5): Lightweight global state management
- Why chosen: Simplicity over Redux, smaller bundle size
- Benefits: Minimal boilerplate, excellent TypeScript support
- Use case: Authentication state, user preferences
- TanStack Query (5.56.2): Powerful data fetching and caching
- Why chosen: Best-in-class server state management
- Benefits: Automatic caching, background updates, optimistic updates
- Use case: API calls, data synchronization, offline support
- React Hook Form (7.53.0): Performant form state management
- Zod (3.23.8): TypeScript-first schema validation
- Why chosen: Excellent performance, minimal re-renders
- Benefits: Type-safe validation, reduced boilerplate
- Use case: Login, registration, booking forms
- Expo SecureStore: Encrypted storage for sensitive data
- AsyncStorage: General application data storage
- Security approach: JWT tokens in SecureStore, app data in AsyncStorage
- Benefits: Platform-specific secure storage, automatic encryption
- Expo CLI: Development and build toolchain
- Metro: JavaScript bundler optimized for React Native
- TypeScript ESLint: Code linting and formatting
