Log snapshot management solution (iOS/Android/Web/Server) built with Flutter/Dart using Bloc pattern and Firebase Firestore backend.

Overview

LogKeeper (Flutter & Firebase)

This is a log snapshot management solution used to save and share log snapshots within the development team. Supports iOS/Android/Web and utilizes Dart backend API (with client-server shared code). Logs stored in Firestore and Firebase Auth used to access some parts of the data.

By default, mock repositories are used. So just run the project to try it with mock data.

Usage scenario

  • QA engineer or someone from the team finds an error in the app
  • Whether it is an error popup or just a suspicious behaviour there should always be a button to upload logs to the LogKeeper
  • This button reads log file and makes POST request which saves the log on the server, analyzes it and returns a link to it
  • Now a person has the link to the uploaded log which they can share to the Bug report or just post it to the chat.
    The link looks something like: https://[your_hosting_url]/#/details?id=[log_id]
    Link redirects to this log like this:\
Log Contents Log Contents in Web view
image image

All logs later can be found on the home screen which is accessible only for authorized users\

Auth Screen Home Screen Log Deletion Popup
image image image
Settings Screen Upload Log Screen Home Screen Drawer
image image image

Structure

This tool uses:

Consists of the following parts:

  • log_keep_back (an API to upload logs and to retrieve links to share them)
  • log_keep (client part to view logs or upload them manually)
  • log_keep_shared (code shared between other two projects)
  • code to send logs to an API from your apps (an example for Unity C# is given below)

Folders structure is based on https://hub.docker.com/r/google/dart-runtime-base in order to use shared code in log_keep_shared both on the client and server sides.

How to set it up

Firebase Account

  • Create one at https://firebase.google.com/
  • Add apps that you need (iOS/Android/Web)
  • Enable Firestore and create empty collections ("projects" and "logs")

Attach Firebase to your local copy

in log_keep:

  • add google-services.json for Android
  • add GoogleService-Info.plist for iOS
  • add firebaseConfig.js near index.html which should contain code like this:
var firebaseConfig = {
    apiKey: "..",
    authDomain: "..",
    projectId: "..",
    storageBucket: ".",
    messagingSenderId: "..",
    appId: "..",
    measurementId: ".."
};

firebase.initializeApp(firebaseConfig);

Moving from mock to Firebase data

Mock repositories used by default. When your Firebase account is ready please go to app.dart and uncomment Firebase repositories

firebaseApp = await Firebase.initializeApp();

getIt.registerSingleton<AuthRepository>(
    FirebaseAuthRepository(),
    signalsReady: true);

getIt.registerSingleton<LogsRepository>(
    FirestoreLogsRepository(FirebaseFirestore.instance),
    signalsReady: true);

To build and host Web client use

  • cd log_keep
  • flutter build web
  • init and login using Firebase CLI
  • firebase deploy --only hosting

Google Service Account

For a backend to run you need a Google Service Account https://cloud.google.com/iam/docs/service-accounts.

Service account credentials could be passed to log_keep_back via .env file:

  • private_key_id
  • client_email
  • client_id
  • private_key
  • databaseParentPath="projects/[PROJECT_ID]/databases/(default)/documents"
  • serverLogUrlFormat="https://[PROJECT_ID].web.app/#/details?id={0}"

Instructions on how to build & deploy server can also be found here https://hub.docker.com/r/google/dart-runtime-base

Notes

TODO

Known issues and limitations

  • The Web browser forces all widgets above it to ignore all clicks on them. As a temporary solution in such cases, the browser becomes hidden.
  • Firestore limits its entities to 2mb so this is the limitation for log files uploaded. The plan is to use Firebase Storage to keep logs there.
  • Flutter Web text rendering performance seems to have some issues. This is a target for some R&D. For now Web browser has been added as a fallback log viewer.

Example code of sending request to the LogKeeper

Unity, C#:

var form = new WWWForm();

// Prepare log data
form.AddField("title", title);
form.AddField("author", author);
form.AddField("project", project);
form.AddField("contents", contents); // the log contents

// Send
var uwr = UnityWebRequest.Post("your_url" + "/save", form);
yield return uwr.SendWebRequest();
if (uwr.isNetworkError || uwr.isHttpError)
{
    // error
    return;
}

// Read result
var raw = Encoding.UTF8.GetString(uwr.downloadHandler.data);
var id = JSON.Parse(raw)["body"]["id"].Value;
var urlFormat = JSON.Parse(raw)["body"]["url_format"].Value;

// Get the link to the log
var link = string.Format(urlFormat, id);
_clipboardService.SetText(link);
ShowNotifications("Report link copied to clipboard");

Contributions

Feel free to report bugs, request new features or to contribute to this project!

You might also like...

A Dart package to web scraping data from websites easily and faster using less code lines.

Chaleno A flutter package to webscraping data from websites This package contains a set of high-level functions that make it easy to webscrap websites

Dec 29, 2022

Working proof of the Go server running inside Flutter

Working proof of the Go server running inside Flutter

flap Working proof of the Go server running inside Flutter Video in action Prerequisites Flutter 2.0 Go 1.16 Build Go server cd go macOS: make maco

Dec 17, 2022

CLI utility to manage MC Server installations

CLI utility to manage MC server installations. Features Install required JDKs Download server files Generate start scripts (with optimized JVM flags)

Nov 18, 2022

🏂 A self-hostable rest api server for Tenka

🏂 A self-hostable rest api server for Tenka

Fuyu 🏂 A self-hostable rest api server for Tenka. By using this project, you agree to the usage policy. Installation Pre-built binaries are released

Mar 14, 2022

The Puzzle Cell Server Handling System

The Puzzle Cell Server Handling System This is the repository for the official server runtime How to setup? You can install the Dart SDK, download the

Nov 18, 2022

A to do list app for android, apple, and the web.

noted A new Flutter project. Getting Started FlutterFlow projects are built to run on the Flutter stable release. IMPORTANT: For projects with Firesto

Nov 4, 2022

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android. Maintainer: @rodydavis

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android. Maintainer: @rodydavis

Get Version - Get the Version Name, Version Code, Platform and OS Version, and App ID on iOS and Android.

Jan 4, 2023

A Dart build script that downloads the Protobuf compiler and Dart plugin to streamline .proto to .dart compilation.

A Dart build script that downloads the Protobuf compiler and Dart plugin to streamline .proto to .dart compilation.

Oct 26, 2022

Easy to use session wrapper that adds support to session storage and management in flutter.

flutter_session_manager Adds an easy to use wrapper to session management in flutter. Allows for easy session storage and management. The session pers

Feb 15, 2022
Owner
Alexey Perov
Software developer with 10 years of experience. .NET, Unity, Gamedev
Alexey Perov
The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

The Dart Time Machine is a date and time library for Flutter, Web, and Server with support for timezones, calendars, cultures, formatting and parsing.

null 2 Oct 8, 2021
Notes app using flutter, firebase and cloud firestore

notes A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this is

Sidheshwar S 8 Aug 10, 2022
Flutter's sync log component implementation by DartNative.

Flutter's sync log component implementation by DartNative

DartNative 3 Apr 30, 2022
An android application built using Flutter that computes the Body Mass Index of person and suggestion to carry ,by taking Inputs (Weight, Height, and Age), Built using Flutter

BMI Calculator ?? Our Goal The objective of this tutorial is to look at how we can customise Flutter Widgets to achieve our own beautiful user interfa

dev_allauddin 7 Nov 2, 2022
Provides Dart Build System builder for creating Injection pattern using annotations.

Provides Dart Build System builder for creating Injection pattern using annotations. Gate generator The core package providing generators using annoat

Apparence.io 17 Dec 20, 2022
Okan YILDIRIM 37 Jul 10, 2022
A configurable pattern finder for static analysis written in Dart

mistdumper A configurable pattern finder for static analysis written in Dart. It is meant to retrieve offsets from file on disk without running them.

null 3 Sep 12, 2022
BMI Calculator is a Mobile Application for Android and iOS built by Flutter

BMI Calculator ?? Our Goal The objective of this tutorial is to look at how we can customise Flutter Widgets to achieve our own beautiful user interfa

Fady Fawzy 2 Jan 10, 2022
Dependency Injection is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the application more flexible

GetX lib DI pattern Dependency Injection is a great design pattern that allows us to eliminate rigid dependencies between elements and it makes the ap

Trương Việt Hoàng 4 Feb 1, 2022
How to use the Robot Testing pattern in Flutter

Robot Testing Pattern in Flutter Developed with ?? by Very Good Ventures ?? This project showcases how to apply the Robot Testing pattern to a Flutter

Very Good Ventures 38 Dec 16, 2022