Aplikasi pembelajaran fisika interaktif untuk simulasi gerak parabola, dikembangkan dengan React Native (Expo) untuk platform Web dan Mobile (Android/iOS), dilengkapi dengan AI chatbot tutor.
- Web App: https://mobile-lilac-mu.vercel.app
- Backend API: https://virtual-lab-lemon.vercel.app
- π Sistem Autentikasi - Login/Register dengan JWT + Google OAuth (Firebase)
- π― Simulasi Gerak Parabola - Visualisasi interaktif dengan animasi
- π Sistem Kuis - Quiz interaktif dengan tracking skor terbaik
- π€ AI Chatbot Tutor - Powered by Google Gemini AI (khusus topik gerak parabola)
- π Materi Pembelajaran - Konten edukatif tentang gerak parabola
- πΎ Database Integration - MongoDB untuk user data dan history
- π± Cross-Platform - Satu codebase untuk Web, Android, dan iOS
- Framework: React Native + Expo SDK 54
- Navigation: Expo Router (file-based routing)
- State Management: React Context API
- Authentication: Firebase Auth + Google Sign-In
- UI Components: React Native core components
- Styling: StyleSheet (React Native)
- Runtime: Node.js + Express.js
- Database: MongoDB Atlas
- AI: Google Gemini Pro API
- Authentication: JWT (JSON Web Tokens)
- Deployment: Vercel Serverless Functions
virtual-lab/
βββ api/ # Backend API (Vercel Serverless)
β βββ index.js # Main API routes
β βββ ask.js # AI Chatbot endpoint
βββ models/ # MongoDB Models
β βββ User.js
β βββ Simulation.js
β βββ Score.js
βββ mobile/ # React Native App (Expo)
β βββ app/ # Expo Router pages
β β βββ _layout.tsx # Root layout
β β βββ index.tsx # Landing page
β β βββ login.tsx # Login screen
β β βββ register.tsx # Register screen
β β βββ (tabs)/ # Tab navigation
β β βββ simulation.tsx
β β βββ materi.tsx
β β βββ quiz.tsx
β β βββ chatbot.tsx
β β βββ profile.tsx
β βββ src/
β β βββ config/ # Firebase config
β β βββ context/ # React Context (Auth)
β β βββ services/ # API & Auth services
β β βββ constants/ # App constants & colors
β βββ assets/ # Images & icons
β βββ app.json # Expo config
β βββ eas.json # EAS Build config
β βββ package.json
βββ public/ # Legacy web frontend (vanilla JS)
βββ vercel.json # Vercel deployment config
βββ package.json # Backend dependencies
βββ README.md
GEMINI_API_KEY=your_gemini_api_key
MONGODB_URI=mongodb+srv://...
JWT_SECRET=your_jwt_secret
NODE_ENV=productionEXPO_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key
EXPO_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
EXPO_PUBLIC_FIREBASE_PROJECT_ID=your_project_id
EXPO_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
EXPO_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
EXPO_PUBLIC_FIREBASE_APP_ID=your_app_id
EXPO_PUBLIC_API_URL=https://your-backend.vercel.app# Install dependencies
npm install
# Run development server
npm run dev
# Server berjalan di http://localhost:3000# Masuk ke folder mobile
cd mobile
# Install dependencies
npm install
# Run untuk Web
npx expo start --web
# Run untuk Android (memerlukan emulator/device)
npx expo start --android
# Run untuk iOS (memerlukan Mac + Xcode)
npx expo start --ios# Dari root folder
vercel --prod# Dari folder mobile
cd mobile
vercel --prodcd mobile
# Build APK (untuk distribusi langsung)
npx eas-cli build --profile production-apk --platform android
# Build AAB (untuk Google Play Store)
npx eas-cli build --profile production --platform androidcd mobile
# Build untuk App Store
npx eas-cli build --profile production --platform ios| Endpoint | Method | Deskripsi | Auth |
|---|---|---|---|
/api/auth/register |
POST | Registrasi user baru | β |
/api/auth/login |
POST | Login user | β |
/api/auth/google |
POST | Login dengan Google | β |
/api/auth/change-password |
POST | Ubah password | β |
/api/history |
GET | Ambil riwayat simulasi | β |
/api/history/:id |
DELETE | Hapus satu riwayat | β |
/api/history |
DELETE | Hapus semua riwayat | β |
/api/simulation |
POST | Simpan hasil simulasi | β |
/api/score |
GET | Ambil skor terbaik | β |
/api/score |
POST | Update skor | β |
/api/leaderboard |
GET | Leaderboard | β |
/api/ask |
POST | AI Chatbot | β |
Aplikasi mendukung 2 metode login:
-
Local Authentication
- Username & password
- Password di-hash dengan bcrypt
-
Google OAuth
- Firebase Authentication
- Popup sign-in untuk web
- Native Google Sign-In untuk mobile
- Simulasi gerak parabola interaktif
- Quiz dengan timer dan scoring
- AI Chatbot untuk tanya jawab
- Profile dengan riwayat simulasi
- Responsive design (mobile-first)
- PWA support
- Same features as mobile
-
Firebase Auth Error (Web)
- Pastikan domain sudah ditambahkan di Firebase Console β Authentication β Authorized domains
-
API Connection Error
- Cek
API_URLdisrc/constants/index.ts - Pastikan backend sudah running
- Cek
-
Google Sign-In tidak berfungsi di APK
- Pastikan SHA-1 fingerprint sudah ditambahkan di Firebase Console
- Cek
eas.jsonuntuk keystore configuration
-
Build APK gagal
- Jalankan
npx eas-cli build --profile production-apk --platform android --clear-cache
- Jalankan
ISC
18223024 & 18223086
| NIM | Tugas |
|---|---|
| 18223024 | Frontend (React Native), UI/UX Design, Simulasi Gerak Parabola, Integrasi Firebase Auth, Laporan Tugas |
| 18223086 | Backend API, Database MongoDB, AI Chatbot (Gemini), Deployment Vercel & Expo, Laporan Tugas |