Skip to content

XPEHO/xpeapp_admin

Repository files navigation

XpeApp - Flutter admin panel

Description

This is the web administration panel for the XpeApp project made with Flutter.

Getting Started

Prerequisites

  • Flutter SDK
  • VS Code

Flutter

This is a Flutter project. You can open it with VS Code and run it on your favorite browser.

For more information about flutter development, please refer to the official documentation.

Dart

Dart is the programming language used for this project. For more information about Dart, please refer to the official documentation.

Configuration

firebase_options.dart

This file is required in lib/ directory to use Firebase services.

To generate the firebase_options.dart file automatically using the FlutterFire CLI, follow these steps:

  1. Install FlutterFire CLI: Ensure you have the FlutterFire CLI installed. You can install it globally using the following command:

    dart pub global activate flutterfire_cli
  2. Configure Firebase: Run the following command to configure Firebase for your Flutter project:

    flutterfire configure

    This command will guide you through the process of selecting your Firebase project and platforms. It will automatically generate the firebase_options.dart file in the lib directory.

config.json

This file is required in assets/ directory to define the backend url. Here is an example of its content :

{
  "baseUrl": "https://example.com/"
}

admin.json

This file is required in assets/ directory. The way to define this file is documented in the bookstack of XpeApp. In case of problem, refer to an administrator.

SonarQube

The XPEHO SonarQube perform analysis each time changes are made to this directory and pushed.

XPEHO SonarQube

The configuration of the sonar analysis for this directory is defined in a dedicated file.

Deployment

In order to deploy the app, you need to be logged in to the Firebase CLI with an account that have sufficient rights to write on the hosting of this project.

Login to the Firebase CLI

To install the Firebase CLI you can type :

npm install -g firebase-tools

And then login with :

firebase login

Deploy to the Firebase Hosting

Firstly, you need to init the project for hosting with Firebase CLI :

firebase init

Warning

Make sure to select build/web as public directory.

The firebase.json generated by this command should look like this :

{
  "hosting": {
    "public": "build/web",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ],
    "rewrites": [
      {
        "source": "**",
        "destination": "/index.html"
      }
    ]
  }
}

After that you can type the following command to build your Flutter web app :

flutter build web

And finally type the following command to deploy the app to firebase hosting :

firebase deploy

Used libraries