hyttahub 0.1.49
hyttahub: ^0.1.49 copied to clipboard
Package for base flutter app functionality.
A serverless Flutter framework designed to be a solid starting point for new casual applications, demonstrated with an example app.
-- Note: Under construction, breaking changes may occur.
Features #
- GDPR and App Store Compliance
- Terms of Service & Privacy Policy: A complete flow for presenting and requiring user acceptance of legal terms, including versioning for updates.
- Account Deletion: A clear, user-accessible path for account deletion.
- Data Access: Users can copy and export their complete event streams.
- Service
- Service Status & Forced Upgrades: The ability to set a minimum required application version or disable the service for maintenance, and communicate this to users.
- Service Users: Manage the users than can maintain policies and service status.
- Beta/Authorized Users: Limit access to a set of regular users.
- App Appearance & Personalization
- Localization: Support for multiple languages.
- Theming: Dynamic light and dark mode support.
- Collaboration & Core Features
- Shared Site (Resource) Management: The common application use case of members sharing a common resource, or "site", such as a set of photo albums, a calendar, etc., is supported. The framework includes adding and removing members from a site, and self-removal. Site members can be assigned administrative roles as well. Firebase rules ensure site privacy.
- Clean Architecture
- Event Source Framework Replayed in the Client: The common practice of having separate models for forms in the UI, network marshalling, database and business logic is eliminated, thus reducing boilerplate code and eliminating app logic on the server side. Some cloud functions are included to assist in cleanup upon account deletion. Events are persisted on the client thus reducing significantly service queries.
- Event and Replay Views: Service, account and site events and replays can be viewed in the UI, assisting in debugging.
- Persistence-agnostic: The framework is designed to support the providers you want (e.g., Firebase and Supabase for cloud storage) and switch between them at runtime. Also built-in memory and local storage are supported.
Usage #
The repo includes examples for using the library. Follow the instructions below.
Prerequisites #
- Install flutter with Chrome support
- Run "flutter version" to check the version, and make sure it is minimum 3.32.1
- Run "flutter devices" to check that Chrome is enabled
Installation & Setup #
git clone git@github.com:bjorge/hyttahub.git
cd hyttahub
flutter pub get
flutter test
Running the Application #
cd example/template
flutter run -d chrome
Persistence Registration #
HyttaHub is persistence-agnostic and uses a dynamic registration system.
Please see PERSISTENCE.md for details on how to register and use multiple storage providers.
FAQ #
I want to make some changes to the language files, how do I compile them?
After updating the .arb files, run:
flutter gen-l10n
I want to run the example app using the firebase emulator, how do I do that?
- Install either docker or podman
- Follow the instructions in the
READMEin thetool/firebase_emulatordirectory to setup and start the emulator (it will also start the cloud functions in the emulator) - In a separate terminal, cd to the example/template folder and run:
flutter run -d chrome - In the app, select "Firebase" as the storage implementation
How do I tag a new release?
git tag v0.1.9
git push origin --tags
How do I compile the protocol buffer files?
Protocol buffer files can be compiled for both Dart (flutter) and TypeScript (cloud functions) using Podman or Docker. See README in the tool/protobuf-compiler directory for instructions.
Is any server-side code required for this project?
The project requires not long running server-side code. As far as cloud functions go, the intent is to use them sparingly—only when necessary to provide access to parts of the system that are inaccessible to the client due to Firebase rules. For example, when a site admin removes a member, a cloud function will also add a "remove" event to that member's account stream (which the admin cannot access directly). Cloud functions are also used for cleanup tasks, such as removing abandoned site data when the last member leaves a site.
How is shared member data kept private?
Firebase rules, defined in firestore.rules and storage.rules, are designed to ensure member data privacy. Only site members are permitted to access site data, and only administrators can add new members. Likewise, only the owner of an account can modify their account settings, and only a service administrator can update the service status.
Can I add social authentication, such as Google or Apple logins?
The current implementation uses email as a key in Firebase rules and site member management. Firebase auth options that retain the user's email will work. For Apple, since users can anonymize their email, changes would have to be made to accomodate for this case.