Flutter, Next.js, Elysia, and Postgres: how we split the product cover image
Back to Blog
TutorialPublished 13 April 2026· Updated 14 August 2026· 2 min read

Flutter, Next.js, Elysia, and Postgres: how we split the product

When the website, the API, and the mobile app should share a backend, and when Supabase is enough versus a custom Elysia API. From Agentic Academy Labs delivery.

Flutter, Next.js, Elysia, and Postgres: how we split the product

Client products at Agentic Academy Labs often need a marketing or admin site, an API, and a Flutter app. The mistake is building three backends. The other mistake is forcing Flutter to scrape a Next.js HTML page.

The split that works

  • Next.js: public pages, admin UI, SEO, and logged-in dashboards that are fine in a browser.
  • Elysia on Bun: the API both the website and Flutter call. Auth, validation, uploads, webhooks.
  • Flutter: iOS and Android. Talks to the same API. No business rules copied into Dart that the API does not already enforce.
  • PostgreSQL: source of truth. We have used Supabase as the Postgres host and storage. We still put app logic in Elysia when we need JWT, custom webhooks, or jobs that are not a good fit for client-only calls.

Week one for a two-surface product

  1. One OpenAPI-ish contract: login, me, list, create.
  2. Next.js admin that uses it.
  3. Flutter that uses it for the same list and create.
  4. A single Postgres schema. No "mobile tables" versus "web tables".

If the mobile team invents a second user table, stop.

Supabase versus a custom API

Supabase is useful for storage buckets, a hosted Postgres, and realtime on a narrow feature. We still write Elysia when:

  • The website and the app need the same authorization rules that are painful to express only as RLS.
  • We need background jobs, signed webhooks, or a cron that must not live in the browser.
  • Students and clients need an API they can read as TypeScript, not only generated Dart.

RLS is not optional if you expose the database to the client. If you are not willing to write policies, do not give the Flutter app the anon key and hope.

Scaling later

Scale the database and the API first. CDN the Next.js site. Do not "micro-service" a 3,000-line Elysia app because a blog post said so.

When search or RAG shows up, add it behind the API, not inside Flutter. See Next.js AI app architecture.

Internship and clients

The mobile month of the program ends with an app that installs and talks to a real API. Mentors fail projects that hardcode tokens in Dart. Client work uses the same checklist.

Need this built? Web and mobile development or schedule a call.

Enjoyed this article?

Back to Blog