Learning & R&D labsOwnerMar 2025 – Jun 2025

Flutter Instagram clone: an offline-first architecture study

TL;DR

I re-implemented a large open-source Flutter Instagram clone step by step to study enterprise-scale modularisation and offline-first sync; the author is credited.

Period
Mar 2025 – Jun 2025
My role
Guided architecture study
Technologies
5
Diagrams
1
Reading time
1 min

FlutterDartBLoCSupabase / PostgresFirebase

1 chapter(s) collapsed in quick read

What was built (from commits)

Todos demo with an api_repository package → PowerSync + Supabase package → Firebase setup and Google auth env → app flavors + DI → login page → app_ui design-system package → email field → authentication module → user_repository package → login view → password recovery → snackbars + router → user profile → Part 1 complete → Part 2: sponsored blocks, animations, posts and comments, stories, chat, notifications.

Architecture

A very modular monorepo: app features in lib/ (app [bloc, di, routes], auth [login, sign-up, forgot / change password with cubits], feed [post, video], timeline, reels, stories, comments, chats, search, user_profile, navigation, network_error, selector [locale, theme], l10n [arb + slang]) plus 20 local packages: api_repository, app_ui, authentication_client (supabase client + token storage), user_repository, posts_repository, chats_repository, stories_repository, search_repository, notifications_repository / notifications_client (Firebase), firebase_remote_config_repository, database_client, powersync_repository (offline-first sync), storage/persistent_storage, insta_blocks / instagram_blocks_ui (server-driven UI blocks), stories_editor, gallery_media_picker, image_picker_plus, form_fields, shared, env.

Architecture
Diagram as text
flowchart LR
 UI[Feature BLoCs/Cubits] --> REPO[Repositories packages]
 REPO --> PS[PowerSync local SQLite ⇄ Supabase Postgres]
 REPO --> AUTH[Supabase auth client + token storage + Google sign-in]
 REPO --> FB[Firebase: messaging, remote config]
 UI --> BLOCKS[insta_blocks: server-driven feed blocks, sponsored blocks]

Stack

flutter_bloc / bloc / hydrated_bloc, get_it, go_router 13, PowerSync (offline-first) + Supabase, Firebase (core, messaging, remote config), google_sign_in, slang i18n + flutter_localizations, flex_color_scheme, flutter_animate, lottie, shimmer, cached_network_image / cached_memory_image, carousel_slider, flutter_staggered_grid_view, sliver_tools, scrollable_positioned_list, story_view, visibility_detector, inview_notifier_list (git), palette_generator, ogp_data_extract, flutter_markdown, flutter_portal, timeago, fast_immutable_collections, sprung, vector_math.

Related projects

Want to discuss this project?

Happy to walk through the architecture, trade-offs or the code.

Email me about it

© 2026 Thuyavan Sivarasa. Script code is MIT licensed.