A React Native Expo application for ChargeHive users to find, book, and manage parking and EV charging station sessions.
The app is currently running in DEMO MODE because the backend is missing the GET /api/services endpoint.
- ✅ App works fully for UI/UX testing
- ✅ Shows 4 demo parking/charging locations on map
- ❌ Booking real sessions requires backend endpoint
See BACKEND_REQUIREMENTS.md for details on the missing endpoint.
- User Signup: Register with email, password, name, and phone number
- User Login: Authenticate using email and password
- Automatic wallet creation: Each user gets a blockchain wallet address upon registration
- Persistent sessions: Auto-login on app restart
- Interactive map showing all available parking and charging stations
- P markers (Red): Parking spots
- C markers (Teal): EV Charging stations
- Location-based services with user's current position
- Service details on marker tap (address, city, hourly rate, status)
- Click markers to book sessions (login required)
- Refresh button to reload services
- Legend to identify marker types
- Balance Display: View token balance (CHV)
- Send Tokens: Transfer tokens to other wallet addresses
- Receive Tokens: Display QR code and wallet address for receiving payments
- Transaction History: View all sent, received, and payment transactions
- Copy wallet address to clipboard
- Book parking or charging sessions from map markers
- Select start and end date/time using date picker
- Real-time calculation of total amount based on duration and hourly rate
- Booking summary with duration, rate, and total cost
- Validation for:
- No past bookings
- End time must be after start time
- Service availability checks
- View all booked sessions (past, active, and upcoming)
- Session status indicators:
- Upcoming (Blue): Future bookings
- Active (Green): Currently in progress
- Completed (Gray): Past sessions
- Detailed information for each booking:
- Service type (Parking/Charging)
- Location details
- Date and time
- Total amount paid
- Booking ID
- Pull to refresh functionality
- React Native with Expo SDK 54
- React 19.1.0
⚠️ See REACT_VERSION_NOTE.md for compatibility concerns - React Navigation (Stack & Bottom Tabs)
- Expo Maps for map functionality
- Expo Location for geolocation
- Axios for API calls
- AsyncStorage for local data persistence
- React Native QR Code SVG for QR code generation
- DateTimePicker for date/time selection
⚠️ Important: React 19 with React Native 0.81.5 may have compatibility issues. See REACT_VERSION_NOTE.md for details and recommendations.
- Node.js 18+ and npm
- Expo CLI (
npm install -g expo-cli) - Expo Go app on your mobile device (iOS/Android) or emulator
- ChargeHive backend running (see backend documentation)
-
Navigate to the project directory:
cd Chargehive-user -
Install dependencies:
npm install
-
Configure API endpoint:
Edit
src/config/api.jsto set your backend URL:export const API_CONFIG = { BASE_URL: 'https://chargehive-backend-dev-c567e0fd7ba7.herokuapp.com/api', // OR for local development: // BASE_URL: 'http://YOUR_LOCAL_IP:3000/api', };
-
Configure Google Maps (Android only):
⚠️ IMPORTANT: Editapp.jsonand replaceYOUR_GOOGLE_MAPS_API_KEY_HEREwith your actual Google Maps API key:"android": { "config": { "googleMaps": { "apiKey": "YOUR_ACTUAL_API_KEY_HERE" // ← Replace this! } } }
Get your API key from Google Cloud Console.
Without a valid API key, the Android app will crash or maps won't work!
-
Start Expo development server:
npx expo start
-
Run on your device:
- Scan the QR code with Expo Go app (Android) or Camera app (iOS)
OR
-
Run on emulator/simulator:
- Press
afor Android emulator - Press
ifor iOS simulator (macOS only) - Press
wfor web browser
- Press
Chargehive-user/
├── src/
│ ├── screens/ # All screen components
│ │ ├── LoginScreen.js
│ │ ├── SignupScreen.js
│ │ ├── MapScreen.js
│ │ ├── WalletScreen.js
│ │ ├── HistoryScreen.js
│ │ └── BookingScreen.js
│ ├── navigation/ # Navigation configuration
│ │ └── AppNavigator.js
│ ├── context/ # React Context providers
│ │ └── AuthContext.js
│ ├── services/ # API service layer
│ │ └── api.js
│ ├── config/ # App configuration
│ │ └── api.js
│ └── utils/ # Utility functions
├── assets/ # Images and static assets
├── App.js # Root component
├── app.json # Expo configuration
└── package.json # Dependencies
The app integrates with the ChargeHive backend API. Key endpoints used:
POST /api/user/register- User registrationPOST /api/user/login- User authenticationGET /api/user/profile- Get user profilePOST /api/sessions/book- Book a sessionGET /api/sessions- Get user's booking historyGET /api/services- Get all parking/charging services
See the API documentation in the backend folder for detailed endpoint information.
-
First Launch
- User sees Login screen
- Can navigate to Signup to create account
-
After Registration/Login
- User is automatically logged in
- Redirected to Map screen (main tab)
- Bottom navigation shows: Map | Wallet | History
-
Booking a Session
- Tap on P or C marker on map
- If not logged in, prompted to login
- Select date/time range
- Review total amount
- Confirm booking
- Session appears in History
-
Managing Wallet
- View token balance
- Send tokens to other users
- Receive tokens via QR code
- View transaction history
- Requests location permissions on first launch
- Shows user's current location on map
- Displays all available services with custom markers
- Different colors for parking (red) vs charging (teal)
- JWT token-based authentication
- Token stored securely in AsyncStorage
- Auto-logout on token expiration (401 errors)
- Protected routes require authentication
- React Context API for auth state
- Local state management with useState
- Navigation state persistence
npx expo build:androidnpx expo build:ios- Ensure location permissions are granted
- Check that Google Maps API key is configured (Android)
- Verify internet connection
- Confirm backend is running
- Check API_CONFIG.BASE_URL in
src/config/api.js - For local development, use your computer's IP address, not localhost
- Clear cache:
npx expo start -c - Reinstall dependencies:
rm -rf node_modules && npm install - Update Expo:
npx expo upgrade
For local backend development, make sure your phone/emulator can reach the backend:
- Same WiFi network: Connect your phone to the same WiFi as your computer
- Use computer's IP: Replace
localhostwith your computer's IP address - Backend CORS: Ensure backend allows requests from mobile app
Example:
BASE_URL: 'http://192.168.1.100:3000/api' // Replace with your IP- Wallet functionality is currently using mock data
- Blockchain integration pending
- Payment processing not yet implemented
- Transaction history is simulated
- Real blockchain integration for wallet
- Payment gateway integration
- Push notifications for booking reminders
- Session QR codes for check-in
- Ratings and reviews for services
- Favorite locations
- Route navigation to selected service
For issues or questions, please refer to the main ChargeHive documentation or contact the development team.
This project is part of the ChargeHive ecosystem.