React Native Expo application integrated with the Vehicles Go API for vehicle rental management with PIX payment processing via Abacate Pay.
β
User Authentication - Login/register with JWT tokens
β
Vehicle Management - View and manage rental vehicles
β
PIX Payments - Recurring weekly PIX payments with QR codes
β
Payment History - Complete payment tracking with status updates
β
Admin Dashboard - Administrative panel for system management
β
Real-time Updates - Webhook integration for payment status
β
TypeScript Support - Full type safety throughout the app
- Node.js 18+
- Expo CLI (
npm install -g expo-cli) - iOS Simulator (for iOS development)
- Android Studio/Emulator (for Android development)
- Clone and install dependencies:
git clone <repository-url>
cd react-native-expo
npm install- Configure environment variables:
cp .env.example .env
# Edit .env with your API configuration- Start the development server:
npm start- Run on device/simulator:
# iOS
npm run ios
# Android
npm run android
# Web
npm run webThe app is configured to work with the Vehicles Go API. Update the API base URL in your .env file:
# For local development
EXPO_PUBLIC_API_URL=http://localhost:8080/api/v1
# For production
EXPO_PUBLIC_API_URL=https://vehicles-go-production.up.railway.app/api/v1- Login/Register - JWT-based authentication
- Profile Management - User profile updates
- Secure Storage - Token management with AsyncStorage
import { authService } from './src/services/authService';
// Login user
const result = await authService.login(email, password);- User Vehicles - Get vehicles assigned to user
- Vehicle Details - Detailed vehicle information
- Rental Management - Rent, return, extend rentals
import { vehicleService } from './src/services/vehicleService';
// Get user's vehicles
const vehicles = await vehicleService.getUserVehicles();- PIX Payments - Create recurring PIX payments
- Payment History - Track all payment transactions
- Payment Status - Real-time payment status updates
import { paymentService } from './src/services/paymentService';
// Create PIX payment
const pixPayment = await paymentService.createPixPayment(vehicleId, amount);- Dashboard Stats - System statistics and metrics
- User Management - Manage all system users
- Payment Management - Oversee all payment transactions
import { adminService } from './src/services/adminService';
// Get dashboard statistics
const stats = await adminService.getDashboardStats();- Create Payment - User initiates PIX payment for vehicle rental
- Generate QR Code - System generates PIX QR code via Abacate Pay
- User Payment - User scans QR code or copies PIX key to pay
- Webhook Update - Abacate Pay notifies system of payment status
- Auto Renewal - System creates recurring weekly payments
import PixPayment from './src/components/PixPayment';
<PixPayment
vehicle={vehicle}
onPaymentCreated={(paymentData) => {
console.log('PIX payment created:', paymentData);
}}
/>- QR Code Generation - Automatic PIX QR code creation
- Copy & Paste - PIX key for manual payment entry
- Expiration Handling - Payment expiration management
- Status Tracking - Real-time payment status updates
- Recurring Setup - Weekly automatic payment renewal
src/
βββ components/ # Reusable UI components
β βββ PixPayment.tsx # PIX payment component
βββ config/ # Configuration files
β βββ api.ts # API configuration
βββ contexts/ # React contexts
β βββ AuthContext.tsx # Authentication state
β βββ VehicleContext.tsx # Vehicle & payment state
βββ screens/ # App screens
β βββ LoginScreen.tsx
β βββ PaymentHistoryScreen.tsx
β βββ AdminDashboardScreen.tsx
β βββ ...
βββ services/ # API services
β βββ api.ts # Base API configuration
β βββ authService.ts # Authentication API
β βββ vehicleService.ts # Vehicle API
β βββ paymentService.ts # Payment API
β βββ adminService.ts # Admin API
βββ types/ # TypeScript type definitions
βββ index.ts
Email: admin@vehicles.com
Password: admin123456
- Dashboard Overview - System statistics and metrics
- User Management - View and manage all users
- Payment Oversight - Monitor all payment transactions
- Overdue Management - Update overdue payment statuses
- System Analytics - Payment and usage analytics
Production: https://vehicles-go-production.up.railway.app/api/v1
Local: http://localhost:8080/api/v1
POST /auth/login- User loginPOST /auth/register- User registrationGET /auth/profile- Get user profile
POST /payments- Create PIX paymentGET /payments- Get user paymentsGET /payments/{id}/history- Payment history
GET /admin/dashboard- Dashboard statisticsGET /admin/users- All users listPOST /admin/payments/update-overdue- Update overdue payments
POST /webhook/abacatepay- Abacate Pay webhook
- API Docs: https://vehicles-go-production.up.railway.app/swagger/index.html
- Abacate Pay: https://docs.abacatepay.com/
- Expo Documentation: https://docs.expo.dev/
npm start # Start Expo development server
npm run android # Run on Android
npm run ios # Run on iOS
npm run web # Run on web
npm run build # Build for productionCopy .env.example to .env and configure:
EXPO_PUBLIC_API_URL=http://localhost:8080/api/v1
NODE_ENV=development
EXPO_PUBLIC_DEBUG=true- Login with admin credentials
- Navigate to admin dashboard
- Test payment management features
- Try updating overdue payments
# Install EAS CLI
npm install -g @expo/eas-cli
# Login to Expo
eas login
# Build for production
eas build --platform all- Production API: Update
EXPO_PUBLIC_API_URLin.env - Build Configuration: Configure
eas.jsonfor build settings - App Store Setup: Configure app store credentials
API Connection Issues:
- Verify API URL in
.envfile - Check network connectivity
- Ensure API server is running
Authentication Problems:
- Clear app storage/cache
- Check token expiration
- Verify API credentials
PIX Payment Issues:
- Confirm Abacate Pay integration
- Check webhook configuration
- Verify payment amounts
Enable debug mode in .env:
EXPO_PUBLIC_DEBUG=true- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
This project is licensed under the MIT License.
π― Next Steps:
- Set up production API environment
- Configure Abacate Pay webhooks
- Test end-to-end payment flow
- Deploy to app stores
- Monitor payment transactions