Skip to content

SandroMaglione/flutter-supabase-template

Repository files navigation

Flutter + Supabase app template

GitHub: SandroMaglione Twitter: SandroMaglione

This app is a complete setup for a production ready Flutter application using Supabase for authentication, database, storage, and more.

🚀 How to run the app

Make sure you installed Flutter and Dart in your machine

  1. Clone or fork the repository
git clone https://github.com/SandroMaglione/flutter-supabase-template.git
  1. Install the packages required
flutter pub get
  1. Run the build command (build_runner)
flutter packages pub run build_runner build  
  1. Update .vscode/launch.json args with your Supabase project URL (SUPABASE_URL) and Key (SUPABASE_ANNON_KEY):
{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Production",
      "request": "launch",
      "type": "dart",
      "program": "lib/main_prod.dart",
      "args": [
        "--dart-define=SUPABASE_URL=Url",
        "--dart-define=SUPABASE_ANNON_KEY=Key"
      ]
    }
  ]
}
  1. Run the app 🚀

🧱 Structure of the project

The project is organized in releases, each containing a specific set of changes for one feature:

  1. Environment variables
  2. Routing (auto_route)
  3. Dependency injection (injectable)
  4. Supabase authentication
  5. Supabase database
  6. Functional programming (fpdart)

You can review each set of changes individually by looking at each release.

Note: Each feature is build on top of the previous one.

📃 Packages used (pubspec.yaml)

Note: This setup is opinionated. There are many other possible solutions and packages to achieve the same (or better) result. It would be interesting to start a discussion about each solution (by opening new PRs implementing other options)

👨🏼‍🏫 Guides and tutorials

Each feature in the app has a blog post associated with it that explains more in the details the changes made:

  1. Environment variables
  2. Routing (auto_route)
  3. Dependency injection (injectable)
  4. Supabase authentication
  5. Supabase database
  6. Functional programming (fpdart)

🛣 Roadmap

🙏🏼 Contribution

Every feedback, feature request, and contribution is gladly accepted: