Supabase Aurora Example

Supabase Aurora Example

Этот пример приложения демонстрирует интеграцию технологии Supabase с Flutter-приложением для ОС Аврора и показывает, как выполнять распространённые операции с базой данных и аутентификацией.

[EN] | RU

Example of using Supabase with Flutter

This example application demonstrates the integration of supabase.com with a Flutter app for the Aurora OS and shows how to perform common database and authentication operations.

Table of Contents

Installation and Setup

Supabase Setup

Creating a Supabase Project

To begin, create a project at supabase.com.

Configuring Supabase Credentials

In lib/main.dart, initialize the Supabase SDK using your project’s URL and anonymous key:

await Supabase.initialize(
  url: 'YOUR_SUPABASE_URL',         // Replace with your project's URL
  anonKey: 'YOUR_SUPABASE_ANON_KEY' // Replace with your project's public anonymous key
);

Explanation:

  • SUPABASE_URL: The unique URL of your project, available in the Supabase dashboard.
  • SUPABASE_ANON_KEY: Public "anonymous" API key for client-side access.

Security tip: In production, avoid storing keys directly in code. Use environment variables instead (e.g., via flutter_dotenv).

Creating a Table in Supabase

In the Supabase dashboard, create a table named profiles with the following columns:

  • id: uuid
  • username: text
  • website: text

Aurora OS Setup

Declaring Permissions in the .desktop File

Supabase requires internet access. The .desktop file at aurora/desktop/ru.aurora.supabase_aurora_example.desktop must include:

[X-Application]
Permissions=Internet

Screenshots

Login screen Profile screen

Compatibility

  • Flutter: Version 3.27.3 and above
  • Supabase: Compatible with current Supabase features
  • Aurora OS: Tested with Aurora OS 5.0.0 and newer

Use Cases

User Authentication

  • Sign up: Enter email and password and press "Signup"
  • Login: Enter existing credentials and press "Login"
  • Sign out: Press "Sign Out" on the profile screen

Profile Management

  • View profile: Displays the current user’s username and website (if available)
  • Update profile: Modify username and/or website and press "Save" to update in Supabase

Project Structure

The project follows a standard Flutter layout with Aurora OS support:

  • lib/main.dart: Main logic, UI widgets for login/signup/profile, Supabase integration
  • aurora/: Contains Aurora OS–specific files
  • pubspec.yaml: Project dependencies including supabase_flutter and Aurora-specific overrides (e.g., shared_preferences_aurora)

Known Issues

During build, a MissingPluginException may occur, related to the listen method on com.llfbandit.app_links/events. This happens due to the lack of app_links plugin support on Aurora OS.

Note: This issue does not affect Supabase functionality. It can be safely ignored if the app works as expected.

License and Contributing

The project is licensed under the BSD-3-Clause License, which allows use in third-party apps.

To contribute: