Skip to content

Firebase API

DanPeled edited this page Aug 26, 2024 · 1 revision

Configuring your database & Firebase project

In order to link your scouting site to your own database:

  1. Create a new Firebase project by navigating to the firebase website, and pressing the Get Started button and then pressing Create a project.
  2. In the Project overview page, press the Web option in order to configure your project's web connection.
  3. Navigate to your project settings and keep the firebaseConfig details. e.g
firebaseConfig = {
  apiKey: "myAPIKey",
  authDomain: "myAuthDomain",
  projectId: "myProjectId",
  storageBucket: "myStorageBucket",
  messagingSenderId: "myMessagingSenderId",
  appId: "myAppId",
  measurementId: "myMeasurmentId"
};
  1. Press the Build menu presented in the left side of the page, and choose Firestore Database.
  2. Press the Create database button and configure your database.
  3. Go to the lib/services/firebase/firebase_api.dart file and modify the following lines to use your firebase project details:
Future<void> initialize() async {
    // ...
	app = await Firebase.initializeApp(
      options: FirebaseOptions(
        apiKey: "<your apiKey>",
        appId: "<your appId>",
        messagingSenderId: "<your messaginSenderId>",
        projectId: "<your projectId>",
        storageBucket: "<your storage Bucket>",
      ),
    );
	// ...
  }

Firebase documentation can be found here

Clone this wiki locally