Skip to content

Tsunari/Faunty

Repository files navigation

Faunty Logo

Latest Release Flutter Firebase Riverpod Slang License Last Commit Top Language Pull Requests

Faunty — Flutter App for Teams

Faunty is a modern Flutter application for team and organization management. It focuses on real-time collaboration, clear modular architecture, and a consistent, beautiful UI.

Highlights

  • Firebase-first: Auth, Firestore, Cloud Messaging, and Cloud Functions
  • Reactive by design: Riverpod providers stream live data into the UI
  • Internationalized: Slang-based i18n with automated key extraction
  • Modular domains: Separate features for kantin, cleaning, catering, program, etc.
  • Reusable UI: Centralized components for consistency and speed

Tech Stack

  • Flutter/Dart: App UI and logic (Dart SDK constraint: ^3.8.1)
  • Firebase: firebase_core, firebase_auth, cloud_firestore, firebase_messaging, cloud_functions
  • State: flutter_riverpod
  • i18n: slang, slang_flutter
  • Utilities: url_launcher, webview_flutter, shared_preferences, package_info_plus, intl, http, rxdart, uuid

Architecture

  • State Management: Riverpod providers live in lib/state_management/ (e.g., user_provider.dart, kantin_provider.dart) to expose Firestore streams and app state.
  • Firestore Services: Per-domain services in lib/firestore/ handle reads/writes against the structure below.
  • UI Components: Shared widgets in lib/components/ (app bar, chips, dialogs, inputs, navigation, role gates, etc.).
  • Pages: Feature screens grouped by domain in lib/pages/.
  • Localization: Use the translation() helper from lib/tools/translation_helper.dart for all user-facing strings.

Firestore Layout

  • places/{placeId}/{domain} — Domains include kantin, cleaning, catering, program, etc.
  • user_list/{userUID} — User-specific data as document fields.

Project Structure (selected)

lib/
  components/         # Reusable UI widgets
  firestore/          # Domain Firestore services
  functions/          # Cloud Functions (Node 22)
  helper/             # Logging and helpers
  i18n/               # Slang-generated localization
  models/             # App models
  notifications/      # Push notifications logic
  pages/              # Feature pages by domain
  state_management/   # Riverpod providers
  tools/              # i18n extraction, update service, 
  main.dart           # App entry

Getting Started

Prerequisites

  • Flutter SDK and tooling
  • Firebase CLI (firebase)
  • Node.js 22+ for Cloud Functions (see lib/functions/package.json)
  • For Android: Android SDK / Java; For iOS/macOS: Xcode/CocoaPods

Setup

  1. Install dependencies
flutter pub get
  1. Configure Firebase (if needed) using FlutterFire
flutter pub global activate flutterfire_cli
flutterfire configure

This generates/updates lib/firebase_options.dart and platform configs. The repo already contains firebase_options.dart for the current project.

  1. Run the app
flutter run

Web Build & Hosting

flutter build web
firebase deploy --only hosting

Alternatively, use the release script below for a guided flow.

Development Workflow

Common Commands

  • Run app: flutter run
  • Analyze: flutter analyze
  • Test: flutter test
  • Build web: flutter build web

VS Code Tasks

Tasks are preconfigured (Terminal > Run Task):

  • Flutter: Runflutter run
  • Flutter: Build Webflutter build web
  • Flutter: Analyzeflutter analyze
  • Flutter: Testflutter test
  • i18n: Extract Keys (AST)dart lib/tools/extract_t_strings_ast.dart
  • i18n: Generate (slang)dart run slang
  • Firebase: Deploy Web (release.ps1)pwsh release.ps1

Release Script

Use release.ps1 for version bumping, changelog generation, and CI triggers.

Examples:

# Full flow (prompts for version bump, updates CHANGELOG, pushes, triggers workflows)
pwsh release.ps1

# Hosting-only quick deploy (cleans build/, builds web, deploys hosting)
pwsh release.ps1 -HostingOnly

# Bypass clean working tree check (use sparingly)
pwsh release.ps1 -force

Internationalization (Slang)

  • Use translation() from lib/tools/translation_helper.dart for all strings.
  • Discover new keys by scanning the codebase:
dart lib/tools/extract_t_strings_ast.dart
  • Generate localization files:
dart run slang
  • Add translations under lib/i18n/ for each supported language.

Cloud Functions

  • Location: lib/functions/ (Node 22).
  • Install and deploy:
cd lib/functions
npm i
npm run deploy   # or: firebase deploy --only functions
  • Emulate locally:
npm run serve

Notifications (Web)

  • Web assets include web/firebase-messaging-sw.js and runtime config in build/web/ after builds.
  • Ensure Firebase Messaging is properly configured for web push if used.

Troubleshooting

  • If a web deploy serves stale assets, clear the build/ folder and rebuild:
Remove-Item -Recurse -Force build
flutter pub get
flutter build web
  • Validate Firebase setup by confirming lib/firebase_options.dart is present and matches your project.

  • .env file is not included in the repository. Currently OneSignal API key is used.

Contributing

Contributions are welcome. Please follow existing patterns:

  • Prefer components in lib/components/ and providers in lib/state_management/.
  • Keep Firestore access in lib/firestore/ services.
  • Add/adjust i18n keys and run Slang codegen.
  • Include tests for user-facing features where applicable.

License

This repository is licensed for private use.

For questions or feedback, please open an issue or contact the maintainer.