Environment Setup - utourismboard/explore-uganda-application-documentation GitHub Wiki
Environment Setup Guide
Table of Contents
Development Environment
System Requirements
- Operating System: Windows 10/11, macOS 10.15+, or Linux
- RAM: Minimum 8GB (16GB recommended)
- Storage: 20GB free space
- Android Studio or VS Code
- Git
Required Tools
# Version requirements
Flutter: 3.19.0
Dart: 3.3.0
Node.js: 18.x or later
Firebase CLI: Latest version
Android Studio: Latest version
Flutter Setup
Installing Flutter
- Download Flutter SDK from flutter.dev
- Extract the archive and add to PATH
- Run flutter doctor to verify installation:
flutter doctor
Dart SDK Setup
The Dart SDK comes bundled with Flutter. Verify installation:
dart --version
IDE Configuration
VS Code Setup
- Install VS Code
- Install required extensions:
- Flutter
- Dart
- Flutter Widget Snippets
- Firebase Explorer
- Mermaid Markdown Syntax
Android Studio Setup
- Install Android Studio
- Install Flutter and Dart plugins
- Configure Android SDK
- Setup Android Emulator
Editor Settings
{
"editor.formatOnSave": true,
"dart.lineLength": 80,
"dart.previewFlutterUiGuides": true,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [80],
"editor.selectionHighlight": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
}
}
Firebase Setup
Firebase CLI Installation
npm install -g firebase-tools
firebase login
Project Configuration
- Create Firebase project
- Download google-services.json
- Configure Firebase in app:
// Example firebase configuration
const firebaseConfig = {
apiKey: "your-api-key",
authDomain: "your-auth-domain",
projectId: "your-project-id",
storageBucket: "your-storage-bucket",
messagingSenderId: "your-sender-id",
appId: "your-app-id"
};
Local Configuration
Environment Variables
Create a .env
file in the project root:
API_BASE_URL=https://dev-api.exploreuganda.app/v1
MAPS_API_KEY=your_google_maps_key
ENVIRONMENT=development
Development Configuration
// lib/config/app_config.dart
class AppConfig {
static const String apiBaseUrl = String.fromEnvironment(
'API_BASE_URL',
defaultValue: 'https://dev-api.exploreuganda.app/v1',
);
static const String mapsApiKey = String.fromEnvironment(
'MAPS_API_KEY',
defaultValue: '',
);
}
Running the App
# Development
flutter run --dart-define=ENVIRONMENT=development
# Staging
flutter run --dart-define=ENVIRONMENT=staging
# Production
flutter run --dart-define=ENVIRONMENT=production
Troubleshooting
Common Issues
-
Flutter Doctor Issues
- Run
flutter doctor -v
for detailed diagnostics - Follow the suggested fixes
- Run
-
Android Studio Issues
- Verify Android SDK installation
- Check PATH variables
- Update all components
-
Firebase Setup Issues
- Verify google-services.json placement
- Check Firebase configuration
- Ensure correct package name
Getting Help
- Check Flutter GitHub Issues
- Visit Stack Overflow
- Contact [email protected]