···11----
22-description:
33-globs:
44-alwaysApply: false
55----
66-You are a senior Dart programmer with experience in the Flutter framework.
77-88-Generate code, corrections, and refactorings that comply with the basic principles and nomenclature.
99-1010-## Dart General Guidelines
1111-1212-### Basic Principles
1313-1414-- Use English for all code and documentation.
1515-- Always declare the type of each variable and function (parameters and return value).
1616- - Avoid using any.
1717- - Create necessary types.
1818-- Don't leave blank lines within a function.
1919-- One export per file.
2020-2121-### Nomenclature
2222-2323-- Use PascalCase for classes.
2424-- Use camelCase for variables, functions, and methods.
2525-- Use underscores_case for file and directory names.
2626-- Use UPPERCASE for environment variables.
2727- - Avoid magic numbers and define constants.
2828-- Start each function with a verb.
2929-- Use verbs for boolean variables. Example: isLoading, hasError, canDelete, etc.
3030-- Use complete words instead of abbreviations and correct spelling.
3131- - Except for standard abbreviations like API, URL, etc.
3232- - Except for well-known abbreviations:
3333- - i, j for loops
3434- - err for errors
3535- - ctx for contexts
3636- - req, res, next for middleware function parameters
3737-3838-### Functions
3939-4040-- In this context, what is understood as a function will also apply to a method.
4141-- Write short functions with a single purpose. Less than 20 instructions.
4242-- Name functions with a verb and something else.
4343- - If it returns a boolean, use isX or hasX, canX, etc.
4444- - If it doesn't return anything, use executeX or saveX, etc.
4545-- Avoid nesting blocks by:
4646- - Early checks and returns.
4747- - Extraction to utility functions.
4848-- Use higher-order functions (map, filter, reduce, etc.) to avoid function nesting.
4949- - Use arrow functions for simple functions (less than 3 instructions).
5050- - Use named functions for non-simple functions.
5151-- Use default parameter values instead of checking for null or undefined.
5252-- Reduce function parameters using RO-RO
5353- - Use an object to pass multiple parameters.
5454- - Use an object to return results.
5555- - Declare necessary types for input arguments and output.
5656-- Use a single level of abstraction.
5757-5858-### Data
5959-6060-- Don't abuse primitive types and encapsulate data in composite types.
6161-- Avoid data validations in functions and use classes with internal validation.
6262-- Prefer immutability for data.
6363- - Use readonly for data that doesn't change.
6464- - Use as const for literals that don't change.
6565-6666-### Classes
6767-6868-- Follow SOLID principles.
6969-- Prefer composition over inheritance.
7070-- Declare interfaces to define contracts.
7171-- Write small classes with a single purpose.
7272- - Less than 200 instructions.
7373- - Less than 10 public methods.
7474- - Less than 10 properties.
7575-7676-### Exceptions
7777-7878-- Use exceptions to handle errors you don't expect.
7979-- If you catch an exception, it should be to:
8080- - Fix an expected problem.
8181- - Add context.
8282- - Otherwise, use a global handler.
8383-8484-## Specific to Flutter
8585-8686-### Basic Principles
8787-8888-- Use the following architecture structure:
8989- ```
9090- lib/
9191- ├── main.dart # App entry point
9292- └── src/
9393- ├── sprk_app.dart # Main MaterialApp
9494- ├── core/ # Shared code across features
9595- │ ├── config/ # Application-wide configurations
9696- │ ├── di/ # Dependency injection setup
9797- │ ├── network/ # ATProto client, API base
9898- │ ├── routing/ # AutoRoute setup
9999- │ ├── storage/ # Local storage utilities
100100- │ │ ├── cache/ # Cache management
101101- │ │ └── preferences/ # Settings and preferences
102102- │ ├── theme/ # Theme definitions
103103- │ ├── auth/ # Authentication system
104104- │ │ └── data/
105105- │ │ └── repositories/
106106- │ ├── feed_algorithms/ # Feed algorithms
107107- │ ├── l10n/ # Localization (when implemented)
108108- │ ├── widgets/ # Common widgets
109109- │ └── utils/ # Shared utilities
110110- │ └── logging/ # Logging framework
111111- └── features/ # Feature modules
112112- └── feature/ # (auth, feed, profile, etc.)
113113- ├── data/ # Data layer for this feature
114114- │ ├── repositories/
115115- │ └── models/
116116- ├── providers/ # Riverpod providers
117117- └── ui/ # UI components
118118- ├── pages/
119119- └── widgets/
120120- ```
121121-122122- Folder structure explanation:
123123- - `lib/src/core/`: Contains all shared code that's used across multiple features.
124124- - `config/`: Holds application-wide configurations, such as environment settings, API keys, or feature flags.
125125- - `di/`: Manages dependency injection setup using GetIt to register and resolve dependencies.
126126- - `network/`: Handles all network-related functionality, including the ATProto client, API base classes, and repositories. Use only methods included in the ATProto API.
127127- - `routing/`: Contains the AutoRoute setup, including route definitions, guards, and navigation helpers.
128128- - `storage/`: Contains utilities for local storage.
129129- - `cache/`: Cache management with SQL-based implementation, download manager, and cache interfaces.
130130- - `preferences/`: Settings, storage manager, secure storage, and shared preferences.
131131- - `theme/`: Defines the application's themes, including colors, typography, and component styles for different modes (e.g., light/dark).
132132- - `auth/`: Centralized authentication system with repositories for auth operations.
133133- - `feed_algorithms/`: Contains feed algorithms and related logic.
134134- - `l10n/`: Manages localization and internationalization (when implemented).
135135- - `widgets/`: Houses reusable UI components that are used across multiple features.
136136- - `utils/`: Includes utility functions and helpers.
137137- - `logging/`: Complete logging framework with different log levels, outputs, and predefined loggers.
138138-139139- - `lib/src/features/`: Contains feature-specific modules, where each feature is a self-contained unit.
140140- - Current features: `auth`, `feed`, `profile`, `splash`, `settings`, `comments`, `search`, `messages`, `home`
141141- - Each feature follows the same structure:
142142- - `data/`: Handles all data-related concerns for the feature.
143143- - `providers/`: Contains Riverpod providers that manage the state and business logic.
144144- - `ui/`: Contains all UI components with `pages/` and `widgets/` subdirectories.
145145-146146-- The backend is using AT Protocol. Any interfacing between frontend and backend will use the AT Protocol API
147147-- Use repository pattern for data persistence
148148- - Use the cache manager: `CacheManagerInterface` from GetIt
149149- - Use SQL cache: `SQLCacheInterface` from GetIt
150150- - Use download manager: `DownloadManagerInterface` from GetIt
151151-- Use Riverpod to manage state
152152- - see keepAlive if you need to keep the state alive
153153- - use riverpod annotations
154154-- Use freezed to manage UI states
155155-- Use GetIt to manage dependencies
156156- - Use singleton for services and repositories
157157- - Use factory for use cases
158158- - Use lazy singleton for controllers
159159-- Use AutoRoute to manage routes
160160- - Use extras to pass data between pages
161161-- Use extensions to manage reusable code
162162-- Use ThemeData to manage themes
163163-- Use AppLocalizations to manage translations (when implemented)
164164-- Use constants to manage constants values
165165-- Use `StorageManager` from GetIt to manage storage
166166-- When a widget tree becomes too deep, it can lead to longer build times and increased memory usage. Flutter needs to traverse the entire tree to render the UI, so a flatter structure improves efficiency
167167-- A flatter widget structure makes it easier to understand and modify the code. Reusable components also facilitate better code organization
168168-- Avoid Nesting Widgets Deeply in Flutter. Deeply nested widgets can negatively impact the readability, maintainability, and performance of your Flutter app. Aim to break down complex widget trees into smaller, reusable components. This not only makes your code cleaner but also enhances the performance by reducing the build complexity
169169-- Deeply nested widgets can make state management more challenging. By keeping the tree shallow, it becomes easier to manage state and pass data between widgets
170170-- Break down large widgets into smaller, focused widgets
171171-- Utilize const constructors wherever possible to reduce rebuilds
172172-- Use Flutter 3.x features.
173173-- Always use withAlpha instead of withOpacity
174174-- Never use relative paths in imports
175175-- Register pages in `lib/src/core/routing/pages.dart` and routes in `lib/src/core/routing/app_router.dart`
176176-- Avoid functions that return widgets
177177-- Use `lib/src/core/utils/logging/` for logging - get `LogService` from GetIt
178178-- Storage keys are always stored at `lib/src/core/storage/preferences/storage_constants.dart`
179179-- Repositories should always have an interface and an implementation (thing_repository.dart, thing_repository_impl.dart)
180180-- For storage, get a `StorageManager` from GetIt
181181-- For cache, get a `CacheManagerInterface` from GetIt
182182-- For auth, get an `AuthRepository` from GetIt
183183-- For API calls, check if `lib/src/core/network/data/repositories/sprk_repository.dart` already has that method in its contract
184184- - If it does, get `SprkRepository` from GetIt
185185-- Available repositories in service locator:
186186- - `LogService` - Logging service
187187- - `SQLCacheInterface` - SQL-based cache
188188- - `CacheManagerInterface` - Cache manager
189189- - `DownloadManagerInterface` - Download manager
190190- - `StorageManager` - Storage management
191191- - `AuthRepository` - Authentication
192192- - `SprkRepository` - Main API repository
193193- - `IdentityRepository` - User identity
194194- - `ThemeRepository` - Theme management
195195- - `ActorRepository` - Actor operations
196196- - `GraphRepository` - Graph operations
197197- - `SettingsRepository` - Settings management
198198- - `OnboardingRepository` - Onboarding flow
199199-- Don't forget to add new repositories to the service locator at `lib/src/core/di/service_locator.dart`
200200-201201-
-61
.cursor/rules/logging.mdc
···11----
22-description:
33-globs:
44-alwaysApply: false
55----
66-# Spark Logging Framework
77-88-A lightweight, flexible logging system for Spark Social with multiple outputs and log levels.
99-1010-## Features
1111-- 6 log levels: verbose, debug, info, warning, error, fatal
1212-- Console and file outputs
1313-- Automatic stack traces
1414-- Color-coded console logs
1515-- File rotation
1616-1717-## Basic Usage
1818-1919-```dart
2020-2121-import 'package:spark/src/core/utils/logging/logger.dart';
2222-2323-// Get a logger
2424-final logger = GetIt.instance<LogService>().getLogger('MyFeature');
2525-2626-// Log at different levels
2727-logger.v('Verbose message');
2828-logger.d('Debug message');
2929-logger.i('Info message');
3030-logger.w('Warning message');
3131-logger.e('Error message', error: exception, stackTrace: stackTrace);
3232-logger.f('Fatal message');
3333-```
3434-3535-## Predefined Loggers
3636-```dart
3737-final logService = GetIt.instance<LogService>();
3838-3939-// Use predefined loggers
4040-logService.appLogger.i('Application message');
4141-logService.networkLogger.d('Network operation');
4242-logService.uiLogger.w('UI warning');
4343-```
4444-4545-## Configure Log Levels
4646-4747-```dart
4848-// Set minimum log level
4949-LoggerFactory.setGlobalLogLevel(LogLevel.warning); // production
5050-LoggerFactory.setGlobalLogLevel(LogLevel.debug); // development
5151-```
5252-5353-## Log Levels
5454-5555-- **VERBOSE**: Detailed debugging information
5656-- **DEBUG**: Debugging information
5757-- **INFO**: General application flow
5858-- **WARNING**: Potential issues
5959-- **ERROR**: Errors that impact functionality
6060-- **FATAL**: Critical errors
6161-- **NOTHING**: Special level to suppress logs
-107
.cursor/rules/project-overview.mdc
···11----
22-description:
33-globs:
44-alwaysApply: false
55----
66-# Spark Social - Project Overview
77-88-This is a Flutter application for a social media platform inspired by TikTok, integrated with the AT Protocol.
99-1010-## Main Entry Points
1111-- [lib/main.dart](mdc:lib/main.dart) - Main application entry point
1212-- [lib/src/sprk_app.dart](mdc:lib/src/sprk_app.dart) - Main MaterialApp configuration
1313-- [pubspec.yaml](mdc:pubspec.yaml) - Project dependencies and configuration
1414-1515-## Key Architecture Files
1616-- [lib/src/core/di/service_locator.dart](mdc:lib/src/core/di/service_locator.dart) - Dependency injection setup
1717-- [lib/src/core/routing/app_router.dart](mdc:lib/src/core/routing/app_router.dart) - AutoRoute configuration
1818-- [lib/src/core/storage/preferences/storage_manager.dart](mdc:lib/src/core/storage/preferences/storage_manager.dart) - Storage management
1919-- [lib/src/core/utils/logging/](mdc:lib/src/core/utils/logging) - Logging framework
2020-2121-## Current Features
2222-- **Authentication** (`lib/src/features/auth/`) - User login/logout with AT Protocol
2323-- **Feed** (`lib/src/features/feed/`) - Main social media feed with posts and videos
2424-- **Profile** (`lib/src/features/profile/`) - User profiles and profile management
2525-- **Comments** (`lib/src/features/comments/`) - Comment system for posts
2626-- **Search** (`lib/src/features/search/`) - Search functionality
2727-- **Messages** (`lib/src/features/messages/`) - Direct messaging
2828-- **Settings** (`lib/src/features/settings/`) - App settings and preferences
2929-- **Home** (`lib/src/features/home/`) - Home navigation
3030-- **Splash** (`lib/src/features/splash/`) - App initialization screen
3131-3232-## Project Structure
3333-```
3434- lib/
3535- ├── main.dart # App entry point
3636- └── src/
3737- ├── sprk_app.dart # Main MaterialApp
3838- ├── core/ # Shared code across features
3939- │ ├── config/ # Application-wide configurations
4040- │ ├── di/ # Dependency injection setup (GetIt)
4141- │ ├── network/ # ATProto client, API repositories
4242- │ │ └── data/
4343- │ │ ├── models/
4444- │ │ └── repositories/
4545- │ ├── routing/ # AutoRoute setup
4646- │ ├── storage/ # Local storage utilities
4747- │ │ ├── cache/ # SQL-based cache system
4848- │ │ └── preferences/ # Settings and secure storage
4949- │ ├── theme/ # Theme system with repositories
5050- │ │ ├── data/
5151- │ │ │ ├── models/
5252- │ │ │ └── repositories/
5353- │ │ └── domain/
5454- │ ├── auth/ # Centralized authentication
5555- │ │ └── data/
5656- │ │ └── repositories/
5757- │ ├── feed_algorithms/ # Feed algorithms
5858- │ ├── widgets/ # Common reusable widgets
5959- │ └── utils/ # Shared utilities
6060- │ └── logging/ # Complete logging framework
6161- └── features/ # Feature modules
6262- ├── auth/ # Authentication UI and logic
6363- ├── feed/ # Feed display and interactions
6464- ├── profile/ # User profiles
6565- ├── comments/ # Comment system
6666- ├── search/ # Search functionality
6767- ├── messages/ # Direct messaging
6868- ├── settings/ # App settings
6969- ├── home/ # Home navigation
7070- └── splash/ # App initialization
7171-```
7272-7373-## Tech Stack
7474-- **Flutter 3.7+** with Dart
7575-- **AT Protocol** for backend communication
7676-- **Riverpod** for state management
7777-- **AutoRoute** for navigation
7878-- **GetIt** for dependency injection
7979-- **Freezed** for immutable data classes
8080-- **SQLite** for local caching
8181-- **Secure Storage** for sensitive data
8282-- **Shared Preferences** for app settings
8383-8484-## Key Dependencies
8585-- `atproto: ^0.13.3` - AT Protocol client
8686-- `bluesky: ^0.18.10` - Bluesky integration
8787-- `flutter_riverpod: ^2.4.9` - State management
8888-- `auto_route: ^10.1.0+1` - Navigation
8989-- `get_it: ^7.6.7` - Dependency injection
9090-- `sqflite: ^2.4.2` - SQL database
9191-- `flutter_secure_storage: ^9.2.4` - Secure storage
9292-- `cached_network_image: ^3.3.1` - Image caching
9393-- `video_player: ^2.9.3` - Video playback
9494-9595-## Available Services (GetIt)
9696-- `LogService` - Comprehensive logging system
9797-- `StorageManager` - Local storage management
9898-- `SQLCacheInterface` - SQL-based caching
9999-- `CacheManagerInterface` - File cache management
100100-- `DownloadManagerInterface` - Download operations
101101-- `AuthRepository` - Authentication services
102102-- `SprkRepository` - Main API operations
103103-- `ThemeRepository` - Theme management
104104-- `SettingsRepository` - App settings
105105-- `ActorRepository` - User actor operations
106106-- `GraphRepository` - Social graph operations
107107-- `OnboardingRepository` - User onboarding
+58
AGENTS.md
···11+# AGENTS.md
22+33+## Project at a glance
44+- Root Flutter app: `spark`
55+- Workspace members: `widgetbook`, `fonts`, `assets`
66+- Stack: feature-first + Riverpod + GetIt + Freezed + AutoRoute
77+- Generated files in use: `*.g.dart`, `*.freezed.dart`, `*.gr.dart`
88+99+## Setup
1010+1. Use Flutter `3.38.4` (stable, CI-aligned)
1111+2. Ensure `.env` exists: `touch .env`
1212+3. Install deps: `flutter pub get --enforce-lockfile`
1313+1414+## Common commands (repo root)
1515+- Deps: `flutter pub get --enforce-lockfile`
1616+- Codegen: `dart run build_runner build --delete-conflicting-outputs`
1717+- Format: `dart format .`
1818+- Format check: `dart format --set-exit-if-changed .`
1919+- Analyze all: `flutter analyze .`
2020+- Run app: `flutter run`
2121+2222+## Code conventions
2323+- Prefer `package:spark/...` imports; avoid deep cross-feature relative imports
2424+- Import order: Dart SDK, third-party, project; keep `part` after imports
2525+- Use strong explicit types; avoid `dynamic` unless required at boundaries
2626+- Use Freezed for immutable models and `@riverpod` for providers
2727+- Model async state consistently with `AsyncValue`
2828+- Naming: types `PascalCase`, members/providers `lowerCamelCase`, private `_name`
2929+- Keep feature flow: external/API/storage -> repository -> provider -> widget
3030+- Use GetIt (`GetIt.I` / `sl`) for DI-managed services
3131+- Never hand-edit generated files; regenerate instead
3232+3333+## Reliability and logging
3434+- Wrap fallible async work in `try/catch`
3535+- After `await`: check `mounted` in widgets, `ref.mounted` in providers
3636+- Prefer graceful failures over crashes (`AsyncValue.error`, typed/null fallback)
3737+- Use `LogService` / `SparkLogger`, not `print`
3838+- Log context + stack traces; use proper levels (`d`, `i`, `w`, `e`, `f`)
3939+4040+## Agent workflow
4141+1. Read nearby feature files for local patterns
4242+2. Edit source files; run codegen when annotations/models change
4343+3. Format touched code (`dart format .`)
4444+4. Analyze (`flutter analyze lib`, or `flutter analyze .` for wider impact)
4545+5. Run targeted tests first, then broader tests
4646+6. Keep comments minimal and only when needed
4747+4848+## References
4949+- `analysis_options.yaml`
5050+- `lib/src/features/README.md`
5151+- `lib/src/core/utils/logging/README.md`
5252+- `.github/workflows/flutter_lint.yml`
5353+- `.github/workflows/android-internal-release.yml`
5454+5555+## Safety
5656+- Never commit secrets (`.env`, platform credentials)
5757+- Do not revert unrelated local changes
5858+- Keep diffs scoped to the feature/task
+83-105
README.md
···11-# Spark Social
11+# Spark Client
2233-A decentralized social network for video sharing built on the AT Protocol, putting users in control of their digital presence and data.
33+Flutter client for Spark social. This repository contains the production mobile app,
44+plus workspace packages used by the app (assets, fonts, and widgetbook).
4555-
66+## What This Repo Contains
6777-## Spark Your Creativity
88+- `spark` app package at repo root (`pubspec.yaml`)
99+- Flutter workspace members:
1010+ - `widgetbook` (component/dev preview package)
1111+ - `fonts` (shared font package)
1212+ - `assets` (shared assets package)
81399-Share videos freely while maintaining complete control over your data. Break free from corporate control and gain digital autonomy.
1414+The app is organized with a feature-first structure and uses Riverpod + GetIt +
1515+Freezed + AutoRoute.
10161111-## About Spark
1717+## Tech Stack
12181313-We are building a decentralized social network on the AT Protocol, empowering users to share content without compromising privacy or control. With Spark, you own your data and decide how it's used.
1919+- Flutter / Dart
2020+- Riverpod (with code generation)
2121+- GetIt for dependency injection
2222+- Freezed + json_serializable for immutable models
2323+- AutoRoute for navigation
2424+- AT Protocol client libraries (`atproto`, `bluesky`)
14251515-## Core Principles
1616-1717-- **Decentralized Network**: Built on the AT Protocol, giving you full control over your digital presence
1818-- **User-First Approach**: Your data belongs to you, share content freely without compromising privacy
1919-- **Digital Autonomy**: Break free from corporate control and take charge of your online experience
2020-2121-## Features
2626+## Prerequisites
22272323-- **Content Filters**: Customize your feed with advanced content filters
2424-- **Moderation Lists**: Create and subscribe to moderation lists for a healthier online environment
2525-- **Custom Feeds**: Build personalized feeds based on your interests and favorite creators
2626-- **Music & Audio Gallery**: Platform for musicians to reach wider audiences and listeners to discover new talent
2727-- **Built-in Video Editor**: Create and edit professional-quality videos directly in the app
2828-- **Creative Effects**: Share your creativity with Spark effects or design your own
2929-- **Full Content Control**: You decide what to share and with whom
3030-- **Social Media Detox**: Tools to reduce social media addiction and improve focus
3131-- **Community Building**: Connect with like-minded individuals and build genuine communities
3232-- **Human-first Discovery**: Find real creators and build genuine connections
3333-3434-## What Makes Spark Different?
3535-3636-- **Authenticity**: Rediscover genuine connections with real creators
3737-- **Decentralization**: Break free from corporate control and gain digital autonomy
3838-- **Custom Lexicon**: Our own lexicon provides more flexibility for content creators
3939-- **Higher Content Limits**: Increased limits for video length and image quality
4040-- **User Control**: You own your data and decide how it's used
4141-- **Community Focus**: Build meaningful relationships in a supportive environment
2828+- Flutter SDK (CI uses stable `3.38.4`)
2929+- Dart SDK matching Flutter toolchain
3030+- Xcode (for iOS builds) and/or Android SDK
42314343-## Screenshots
3232+## Quick Start
44334545-(Screenshots coming soon)
3434+From repository root:
46354747-## Getting Started
3636+```bash
3737+touch .env
3838+flutter pub get --enforce-lockfile
3939+dart run build_runner build --delete-conflicting-outputs
4040+flutter run
4141+```
48424949-### Prerequisites
4343+## Common Commands
50445151-- Flutter SDK
5252-- Dart SDK
5353-- iOS/Android development environment
4545+### Dependencies and codegen
54465555-### Installation
4747+```bash
4848+flutter pub get --enforce-lockfile
4949+dart run build_runner build --delete-conflicting-outputs
5050+dart run build_runner watch --delete-conflicting-outputs
5151+```
56525757-1. Clone this repository
5353+### Lint and format
58545955```bash
6060-git clone https://github.com/sprksocial/spark-front-end.git
5656+flutter analyze lib
5757+flutter analyze .
5858+dart format .
5959+dart format --set-exit-if-changed .
6160```
62616363-2. Navigate to the project directory
6262+### Tests
6363+6464+No tests are currently committed, but these are the standard commands:
64656566```bash
6666-cd spark-front-end
6767+flutter test
6868+flutter test test/path/to/some_test.dart
6969+flutter test test/path/to/some_test.dart --plain-name "does something specific"
6770```
68716969-3. Install dependencies
7272+For `widgetbook` (run inside `widgetbook/`):
70737174```bash
7272-flutter pub get
7575+flutter test
7376```
74777575-4. Generate code
7878+### Builds
76797780```bash
7878-dart run build_runner build --delete-conflicting-outputs
8181+flutter build appbundle
8282+flutter build apk
8383+flutter build ios --no-codesign
7984```
80858181-5. Run the app
8686+## Project Layout
82878383-```bash
8484-flutter run
8888+```text
8989+lib/
9090+ main.dart
9191+ src/
9292+ core/ # shared infrastructure (network, routing, utils, theme, etc.)
9393+ features/ # feature modules
9494+ <feature>/
9595+ data/
9696+ providers/
9797+ ui/
9898+widgetbook/ # widgetbook workspace package
9999+fonts/ # local font package
100100+assets/ # local assets package
85101```
861028787-## Technologies Used
103103+## Architecture Notes
881048989-- Flutter
9090-- AT Protocol for decentralized social networking
9191-- Cupertino (iOS-style) widgets
9292-- Riverpod for state management
9393-- AutoRoute for routing
9494-- GetIt for dependency injection
9595-- Freezed for data models
9696-- Logger for logging
9797-- Ionicons for beautiful icons
9898-- Video player for media playback
9999-- Camera for video recording
100100-- Animation for smooth transitions
105105+- Prefer package imports (`package:spark/...`) for app code.
106106+- Typical flow is: external/API/storage -> repository -> provider -> widget.
107107+- Providers are generated with `@riverpod`; immutable state is typically Freezed.
108108+- Generated files (`*.g.dart`, `*.freezed.dart`, `*.gr.dart`) should not be edited manually.
101109102102-## Project Structure
110110+## CI Overview
103111104104-```
105105- lib/
106106- ├── main.dart # App entry point
107107- └── src/
108108- ├── sprk_app.dart # Main MaterialApp
109109- ├── core/ # Shared code across features
110110- │ ├── config/ # Application-wide configurations
111111- │ ├── di/ # Dependency injection setup
112112- │ ├── network/ # ATProto client, API base
113113- │ ├── routing/ # AutoRoute setup
114114- │ ├── storage/ # Local storage utilities
115115- │ ├── theme/ # Theme definitions
116116- │ ├── l10n/ # Localization
117117- │ ├── widgets/ # Common widgets
118118- │ └── utils/ # Shared utilities
119119- └── features/ # Feature modules
120120- └── feature/
121121- ├── data/ # Data layer for this feature
122122- │ ├── repositories/
123123- │ └── models/
124124- ├── providers/ # Riverpod providers
125125- └── ui/ # UI components
126126- ├── pages/
127127- └── widgets/
128128-```
112112+- Lint workflow runs codegen, then `flutter analyze`.
113113+- Android internal release workflow runs codegen, config setup, then `flutter build appbundle`.
129114130130-## Future Enhancements
115115+See:
131116132132-- Enhanced data portability
133133-- Custom server hosting options
134134-- Advanced content creation tools
135135-- Cross-platform federation
136136-- Community moderation tools
137137-- Expanded creative effects library
117117+- `.github/workflows/flutter_lint.yml`
118118+- `.github/workflows/android-internal-release.yml`
138119139120## Contributing
140121141141-Contributions are welcome! Feel free to submit a Pull Request.
122122+1. Keep changes scoped to the feature you are editing.
123123+2. Run format, codegen (if needed), and analyze before opening a PR.
124124+3. Do not commit secrets (`.env`, signing keys, service credentials).
142125143126## License
144127145145-This project is licensed under the MIT License - see the LICENSE file for details.
146146-147147-## Connect With Us
148148-149149-- [Subscribe to Newsletter](https://spark-social-link-to-newsletter.com)
150150-- [Learn More](https://spark-social-learn-more.com)
128128+MIT. See `LICENSE`.
+1-13
lib/main.dart
···11-import 'package:flutter/foundation.dart';
21import 'package:flutter/material.dart';
32import 'package:flutter/services.dart';
43import 'package:flutter_dotenv/flutter_dotenv.dart';
···48474948/// Setup logging framework based on environment
5049void _setupLogging() {
5151- final logService = sl<LogService>();
5252-5353- // Set log level based on debug mode
5454- if (kDebugMode) {
5555- logService.setGlobalLogLevel(LogLevel.debug);
5656- logService.appLogger.i('Debug logging enabled');
5757- } else {
5858- logService.setGlobalLogLevel(LogLevel.info);
5959- logService.appLogger.i('Production logging enabled');
6060- }
5050+ sl<LogService>().setGlobalLogLevel(LogLevel.warning);
6151}
62526353/// Initialize auth repository and wait for it to be ready
···6959 final authRepository = sl<AuthRepository>();
70607161 if (authRepository is AuthRepositoryImpl) {
7272- logger.d('Waiting for AuthRepository initialization...');
7362 await authRepository.initializationComplete;
7474- logger.d('AuthRepository initialized successfully');
7563 }
7664 } catch (e) {
7765 logger.e('AuthRepository initialization failed', error: e);
···246246247247 _logger.d('Stopping video recording');
248248249249- // Update state optimistically BEFORE the native call so UI responds immediately
249249+ // Update state optimistically BEFORE native call so UI responds immediately
250250 state = AsyncValue.data(currentState.copyWith(isRecording: false));
251251252252 try {