Documentation Index
Fetch the complete documentation index at: https://mintlify.com/ihfaz297/MND/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, ensure you have the following installed:Node.js 18+
Download from nodejs.org
Flutter 3.0+
Install from flutter.dev
Git
Version control for cloning the repo
Android Studio / Xcode
For mobile app development (optional)
New to Flutter? You can skip the mobile app setup and just run the backend to explore the API.
Backend Setup
Install Dependencies
- express - Web framework
- cors - Cross-origin support for mobile apps
- typescript - Type-safe development
- axios - HTTP client for Google APIs
Make Your First API Request
Now that the backend is running, let’s plan a route from Tilagor to Campus at 8:00 AM:Response Breakdown
The API returns 3 route options (real data from source code):Complete API Response
Complete API Response
Route Categories Explained:
- fastest: Minimum total time
- cheapest: Prioritizes free bus travel
- alternative: Balanced time/cost tradeoffs
- fallback: Local-only when no bus available
Flutter Mobile App Setup
Configure API Endpoint
Create a The API config is loaded in
.env file in mnd_flutter/:.env
lib/config/api_config.dart:lib/config/api_config.dart
Run the App
- Android Emulator
- iOS Simulator
- Chrome (Web)
- Load environment variables from
.env - Fetch 19 locations from
/api/nodes - Display the route planning screen
Understanding the Code
Here’s how the Flutter app calls the backend API (from real source code):Service Layer: Making API Requests
lib/services/route_service.dart
UI Layer: Displaying Routes
lib/screens/home/home_screen.dart (excerpt)
Data Models
The API response maps to Flutter models:Troubleshooting
Backend: Port 3000 already in use
Backend: Port 3000 already in use
Error:Solution:
- Change the port in
.env: - Kill the process using port 3000:
Flutter: Can't connect to backend
Flutter: Can't connect to backend
Error:Solution:
- Check backend is running: Visit
http://localhost:3000/api/healthin browser - Check IP address: Use the network IP shown in backend startup logs
- Android Emulator: Use
http://10.0.2.2:3000/api - Firewall: Allow port 3000 in Windows Firewall / macOS Security
- Same WiFi: Ensure phone and computer are on same network
No route options returned
No route options returned
Symptom:Possible Causes:
- Invalid node IDs: Use
/api/nodesto get valid IDs (e.g.,TILAGOR, notTilagor) - Time format: Use 24-hour format
HH:MM(e.g.,08:30, not8:30 AM) - Graph data not loaded: Check backend logs for “Loaded X nodes”
Google Maps not showing
Google Maps not showing
Error:Solution:
- Get API key: Google Cloud Console
- Enable APIs:
- Maps SDK for Android
- Maps SDK for iOS
- Directions API
- Add to
.env: - Android: Also add to
android/app/src/main/AndroidManifest.xml
Flutter dependencies failed
Flutter dependencies failed
Error:Solution:
- Update Flutter:
flutter upgrade - Clear cache:
flutter pub cache clean - Retry:
flutter pub get
Next Steps
Explore API Endpoints
Learn about all available endpoints beyond
/routesUnderstand the Algorithm
Deep dive into the multi-strategy route planner
Customize the Graph
Add new locations, routes, or transport modes
Deploy to Production
Host the backend on Render, Heroku, or AWS