Frontend
Table of contents
Getting started
The frontend of the Junqo-platform is a Flutter application.
Its main goal is to provide a user interface to interact with the backend.
Prerequisites
- Flutter: Version 3.22.2 or higher. Install Flutter
- Dart: Comes with Flutter, but ensure it’s up to date.
- Python 3: For updating environment configs. Install Python 3
Installation
-
Clone the repository:
git clone https://github.com/Junqo-org/junqo-platform.git -
Navigate to the project directory:
cd junqo-platform -
Navigate to the frontend directory:
cd junqo_front -
Get the Flutter dependencies:
flutter pub get
Configuration
To configure the frontend, you can use flutter build environment variables when building the app or .env files in the junqo_front/config/ directory. If an environment variable is not found, the default value will be used.
Here is the list of environment variables used by the frontend:
API_URL: The URL of the backend API. Default:http://localhost:4200/api/v1
Create a .env file in the junqo_front/config/ directory and add the following environment variables:
# Url of the junqo-platform backend
API_URL=http://localhost:4200/api/v1
Local Development Setup
- Ensure you have an emulator or a physical device connected.
- Run the application:
flutter run
Running the Application
-
To run the application in debug mode:
flutter run -
To build the application for release:
flutter build apk
Development Environment Configuration
- VS Code: Install the Flutter and Dart extensions.
- Android Studio: Install the Flutter and Dart plugins.
Hot Reload/Restart
- Hot Reload: Press
rin the terminal or use the hot reload button in your IDE. - Hot Restart: Press
Rin the terminal or use the hot restart button in your IDE.
Common Development Commands
-
Clean the project:
flutter clean -
Upgrade dependencies:
flutter pub upgrade -
Upgrade dependencies versions:
flutter pub outdated flutter pub upgrade --major-versions -
Run tests:
flutter test -
Run lint checks:
flutter analyze
Platform-Specific Build Instructions
-
iOS: Ensure you have Xcode installed. Run:
flutter build ios -
Web: Ensure you have Chrome installed. Run:
flutter build web -
Desktop: Ensure you have the necessary dependencies installed. Run:
flutter build windows flutter build macos flutter build linux
Technologies
- Flutter
- It is an open source framework for building beautiful, natively compiled, multi-platform applications from a single codebase.
- Dart
- It is a client-optimized programming language for fast apps on any platform.
- Dio
- It is a powerful HTTP client for Dart, which supports Interceptors, FormData, Request Cancellation, File Downloading, Timeout, and more.