To get started with this Flutter project, ensure that the necessary environment is set up:
- Git (https://git-scm.com/downloads)
- Docker (https://www.docker.com/products/docker-desktop/)
- Flutter SDK (https://flutter.dev/docs/get-started/install)
- Visual Studio Code (This is the editor used for this documentation)
Once your environment is ready, clone the project repository by running the following command:
git clone https://github.com/trufi-association/HackathonKigali.git
If you want to run the backend services (Photon and OTP) locally using Docker, you can use Docker Compose.
cd Backend/trufi-server-otp
docker compose compose up -d
cd Backend/trufi-server-photon
docker compose compose up -d
cd Backend/
docker compose compose up -d
-
Open a terminal and navigate to the project directory:
cd Frontend/kigali_mobility
-
Install the necessary dependencies by running the following command:
flutter pub get
-
Once the dependencies are installed, ensure that a physical device is connected or that an emulator is running.
-
To run the application, either press
F5
in Visual Studio Code or use the following command in the terminal:flutter run
By following these steps, your Flutter application should be running successfully on a connected device or emulator.
By default, the application is configured to use the OTP-Kigali servers. However, if you want to override the services and use your own local servers for Photon and OTP, follow these steps:
-
Go to the directory where the
main.dart
file is located:cd Frontend/kigali_mobility/lib
-
Open the
main.dart
file and locate the following commented code:// Configure endpoints // ApiConfig().openTripPlannerUrl = ""; // ApiConfig().searchPhotonEndpoint = ""; // ApiConfig().reverseGeodecodingPhotonEndpoint = "";
-
Uncomment the lines and replace the URLs with your own local server endpoints.
By doing this, your application will now interact with your local services for Photon and OTP instead of the default OTP-Kigali servers.
(Cochabamba-Bolivia-logs)[https://drive.google.com/drive/folders/1wjXc4zviwOaw7gVwGlQyeM3eXeUiigT2?usp=sharing]