How skyost/openauthenticator works
Project Type & Purpose
• This is a cross-platform OTP (one-time password) application, built with Flutter, that runs on mobile (Android/iOS) and desktops (Linux, macOS, Windows). It provides user authentication and secure TOTP generation.
• The app integrates with external services such as Firebase (Auth, Firestore, Dynamic Links), RevenueCat, and Stripe for sign-in, synchronization, and payments.
• There is also a separate website (built with Nuxt 3) contained in the “docs” directory, which serves as the landing/marketing site and translation portal.
Main Components
• Client Applications:
• Mobile Clients & Desktop Clients: Built with Flutter (directories: android, ios, macos, linux, windows) with the core code in the “lib” directory.
• Website: Located in the “docs” folder, built with Nuxt 3.
• Core Application Logic:
• UI & Widgets: Managed in “lib/pages”, “lib/widgets” and related subdirectories.
• Business Logic & Models: Found in “lib/model” (authentication, totp, settings, storage, etc.).
• Utilities: “lib/utils” and helper scripts in “bin” for tasks like SVG compilation and version generation.
• Internationalization:
• Localization files in “lib/i18n” and “docs/locales” for multi-language support.
• Third-Party Integrations:
• Firebase services (Auth, Firestore, Dynamic Links).
• RevenueCat integration for in-app purchases.
• Stripe for payment links.
Mapping the Relationships & Data Flow
• Client Layer:
• Mobile/Desktop Frontend (Flutter) communicates with UI components, widget events, and calls into business logic.
• The website interacts with users for documentation, translations, and outreach.
• Business Logic & State Management:
• Located in the “lib/model”, “lib/pages”, “lib/widgets”, and “lib/utils”, which together manage OTP generation, user authentication, and settings.
• Back-End / External Services:
• Firebase Authentication: Handles user sign-in and validation.
• Firebase Firestore: Used for OTP synchronization.
• Firebase Dynamic Links: For deep linking support.
• RevenueCat and Stripe: Manage subscription/payment integrations.
• Utility Scripts:
• Scripts in “bin” such as compile_svg.dart and generate.dart are run during build-time to prepare assets and configuration for the app.
Architectural Patterns and Design Principles
• Separation of concerns: UI, business logic, and external service integrations are clearly separated. The “lib” directory reflects an organized modular design (models, pages, widgets, utils).
• Cross-platform design: The project uses Flutter as a unified framework, targeting multiple platforms through platform-specific directories (android, ios, macos, etc.).
• Internationalization and extensibility: Language resources are centralized for easy scalability.
• Using cloud-backend services (Firebase) minimizes the need for a dedicated server at this stage.