- Framework: NestJS (Node.js)
- Database: PostgreSQL with Prisma ORM
- Cache: Redis
- Real-time: Socket.IO
- Authentication: JWT with Argon2 password hashing
- API Documentation: Swagger/OpenAPI
POST /auth/sign-up- Create new accountPOST /auth/sign-in- Exchange credentials for tokensPOST /auth/refresh- Rotate access + refresh tokensPOST /auth/sign-out- Revoke current sessionGET /auth/me- Get authenticated user + guest profile
GET /reservations- List user's reservationsPOST /reservations- Create draft stayGET /reservations/:id- Get single reservationPOST /reservations/:id/check-in- Check in to reservation
POST /orders- Place new order (idempotent)GET /orders- List user's orders (active/all)GET /orders/:id- Get single order
GET /menu- List menu items (with category filter)
POST /digital-key/unlock- Record unlock attemptPOST /digital-key/verify-pin- Verify PIN for digital key
POST /guests/guest-info- Submit guest information
GET /itinerary- Get itinerary for stayPOST /itinerary/activities/:id/book- Book activity
- Billing (
/billing) - Checkout (
/checkout) - Housekeeping (
/housekeeping) - Loyalty (
/loyalty) - Notifications (
/notifications) - Payments (
/payments) - Recommendations (
/recommendations) - Rooms (
/rooms) - Users (
/users)
- User signs in → Returns
{ tokens: { accessToken, refreshToken }, user } - Access token used in
Authorization: Bearer <token>header - Refresh token rotation for session management
- Device info tracking (IP, user agent, device label)
-
axios (~1.7.7)
- HTTP client with interceptors
- Request/response transformation
- Timeout and retry handling
-
expo-secure-store (~2.0.0)
- Secure storage for JWT tokens
- Encrypt sensitive data
-
socket.io-client (~4.7.5)
- Real-time communication
- Order status updates
- Digital key events
- Notifications
-
zustand (~5.0.0)
- Lightweight state management
- Auth state, user session
-
@tanstack/react-query (~5.0.0)
- Data fetching, caching, synchronization
- Automatic retries, refetching
- Optimistic updates
-
react-hook-form (~7.53.0)
- Form state management
- Performance optimized
-
zod (~3.23.0)
- Schema validation
- Type-safe validation
- jwt-decode (~4.0.0)
- JWT token inspection
- Expiration checking
src/
├── api/
│ ├── client.ts # Axios instance with interceptors
│ ├── endpoints.ts # API endpoint definitions
│ └── types.ts # API response types
├── services/
│ ├── auth.service.ts # Authentication logic
│ ├── orders.service.ts # Orders API calls
│ ├── reservations.service.ts
│ └── ...
├── store/
│ ├── auth.store.ts # Auth state (Zustand)
│ └── user.store.ts # User data state
├── hooks/
│ ├── useAuth.ts # Auth hook
│ ├── useApi.ts # API query hook
│ └── useWebSocket.ts # WebSocket hook
├── utils/
│ ├── storage.ts # Secure storage wrappers
│ └── validation.ts # Zod schemas
└── constants/
└── config.ts # API base URL, constants
- Install all required dependencies
- Set up TypeScript types for API responses
- Configure axios instance with interceptors
- Set up secure storage utilities
- Create environment configuration
- Create auth store with Zustand
- Implement token storage/retrieval
- Build auth service (sign-in, sign-up, refresh)
- Create auth hooks (useAuth)
- Add token refresh interceptor
- Update login/signup screens with real API calls
- Create API client with base configuration
- Define API endpoints for each module
- Set up React Query configuration
- Create service layer for each backend module
- Implement error handling and retry logic
- Update HomeScreen with real reservations data
- Connect OrdersScreen to orders API
- Connect ItineraryScreen to itinerary API
- Connect ProfileScreen to user API
- Connect DigitalKeyScreen to digital-key API
- Update Menu/Ordering flows with real data
- Set up Socket.IO client
- Implement WebSocket hooks
- Connect to order status updates
- Connect to digital key events
- Connect to notifications
- Add loading indicators
- Implement error boundaries
- Add offline handling
- Implement retry mechanisms
- Test all API integrations
- Optimize bundle size
- Add request/response logging
- Performance tuning
LoginScreen → Auth Service → API → Token Storage → Auth Store → App State
Screen Component → React Query Hook → Service Layer → API Client → Backend
Socket.IO Client → Event Listeners → State Update → UI Re-render
- Token Storage: Use expo-secure-store for token persistence
- SSL Pinning: Implement certificate pinning for production
- Request Signing: Add request signatures for sensitive operations
- Rate Limiting: Respect backend rate limits
- Input Validation: Validate all inputs on client side
- Error Messages: Don't expose sensitive error details
const API_CONFIG = {
baseURL: __DEV__ ? 'http://localhost:3000' : 'https://api.innsync.com',
timeout: 10000,
retryAttempts: 3,
retryDelay: 1000,
};| Screen | Backend Module | Key Endpoints |
|---|---|---|
| LoginScreen | Auth | POST /auth/sign-in |
| SignupScreen | Auth | POST /auth/sign-up |
| HomeScreen | Reservations | GET /reservations |
| OrdersScreen | Orders | GET /orders, POST /orders |
| ItineraryScreen | Itinerary | GET /itinerary |
| ProfileScreen | Users, Auth | GET /auth/me |
| DigitalKeyScreen | Digital Key | POST /digital-key/verify-pin |
| OnboardingScreen | Guests | POST /guests/guest-info |
| ViewFolioScreen | Billing | GET /billing |
- Install dependencies
- Set up project structure
- Implement authentication system
- Build API client layer
- Integrate screens one by one
- Add real-time features
- Test and optimize
- Backend uses idempotency keys for orders - implement on mobile
- Socket.IO for real-time order updates and digital key events
- Token rotation implemented in backend - handle refresh on mobile
- Rate limiting enabled on backend - implement exponential backoff
- Device info tracking - send device metadata on auth