shareIT is a Flutter app for anonymous, code-based file sharing across phones and tablets. There is no account sign-up: each device gets a short share code, and you send files to someone else by entering their code. Files live in Supabase Storage; metadata and live updates use Postgres and Supabase Realtime. Optional Firebase Cloud Messaging hooks help wake the app when new transfers arrive.
Repository: github.com/XIVASSS/shareIT
- Anonymous identity on first launch, with a persistent short code.
- Send one or many files to a recipient using their code.
- Incoming transfers with realtime updates, manual refresh, and FCM-oriented fallback.
- Downloads via signed URLs with SHA-256 verification after save.
- Sensible limits: e.g. 500MB max file size, 24h transfer visibility window.
| Layer | Choice |
|---|---|
| UI & state | Flutter, Riverpod |
| Navigation | go_router |
| Backend | Supabase (Auth anon, Storage, Postgres, Realtime) |
| Networking / files | Dio, file_picker, path_provider |
| Push (client) | Firebase Cloud Messaging (see setup) |
lib/
├── core/
│ ├── constants/
│ ├── errors/
│ ├── services/
│ ├── utils/
│
├── features/
│ ├── auth/
│ │ ├── data/
│ │ ├── domain/
│ │ ├── presentation/
│ │
│ ├── transfer/
│ │ ├── data/
│ │ │ ├── datasources/
│ │ │ ├── models/
│ │ │ ├── repositories/
│ │ │
│ │ ├── domain/
│ │ │ ├── entities/
│ │ │ ├── usecases/
│ │ │
│ │ ├── presentation/
│ │ │ ├── providers/
│ │ │ ├── screens/
│ │ │ ├── widgets/
│
├── main.dart
supabase/
├── setup.sql
test/
├── core/
The app uses a compact clean-style layout:
- core: Supabase bootstrap, local storage, file I/O, logging, constants.
- features/auth: anonymous identity and recipient lookup.
- features/transfer/data & domain: repositories, entities, and use cases suited for tests.
- features/transfer/presentation: Riverpod, screens, widgets.
- Flutter (stable)
- Xcode (iOS) and/or Android Studio / SDK (Android)
- A Supabase project
- A Firebase project with Cloud Messaging (for full push flow)
flutter pub get- Create a Supabase project.
- Create a public storage bucket named
shared-files(seeAppConstants.storageBucket). - Run
supabase/setup.sqlin the Supabase SQL editor. - Enable Realtime for the
transferstable. - Add storage policies so anon clients can use the bucket, for example:
create policy "anon upload shared files"
on storage.objects
for insert
to anon
with check (bucket_id = 'shared-files');
create policy "anon read shared files"
on storage.objects
for select
to anon
using (bucket_id = 'shared-files');Do not commit keys. Run with --dart-define:
flutter run \
--dart-define=SUPABASE_URL=https://YOUR_PROJECT.supabase.co \
--dart-define=SUPABASE_ANON_KEY=YOUR_SUPABASE_ANON_KEYIf these are missing, the app shows a shareIT setup required screen with the same instructions.
Android
- Register the app in Firebase.
- Add
google-services.jsonunderandroid/app/(not committed in this template). - Ensure notification permission on Android 13+.
iOS
- Register the app in Firebase.
- Add
GoogleService-Info.plistunderios/Runner/. - Enable Push Notifications and Background Modes (
Remote notifications). - Configure APNs in the Firebase console.
flutter run \
--dart-define=SUPABASE_URL=https://YOUR_PROJECT.supabase.co \
--dart-define=SUPABASE_ANON_KEY=YOUR_ANON_KEYusers(id, code, fcm_token, created_at)— anonymous device identity and optional FCM token.transfers(id, sender_code, receiver_code, file_url, file_name, file_size, file_sha256, status, error_message, created_at)— transfer pipeline and integrity fields.
See supabase/setup.sql for RLS policies and indexes.
The client registers tokens into users.fcm_token. For notifications while the app is closed, add a small backend (e.g. Supabase Edge Function + database trigger) that sends an FCM data message when a new transfers row is created. Example payload shape:
{
"transfer_id": "uuid",
"receiver_code": "ABC234",
"event": "new_transfer"
}- Invalid recipient code validated before upload.
- Large files capped at 500MB; low storage checked before download.
- Multi-file send, deduplication by
transfer.id, failed rows markedfailed. - Download integrity via SHA-256; network errors surfaced in the UI.
- RLS is anon-friendly; production hardening often moves sensitive writes behind Edge Functions.
- Fine-grained upload progress is limited by what the Storage client exposes today.
- Full background resumable transfers would need additional native or plugin work.
- FCM “server sender” is documented but not bundled in this repo.
flutter test— includestest/core/utils/code_generator_test.dart.
Prefer mocking repositories in unit tests; wire Firebase/Supabase fakes for CI as needed.
