How codeabelity/neuma-base-flutter works
Project type and purpose
• This is a Flutter mobile-app starter (“Neuma Base Flutter”) with a feature-first, DDD-inspired layered architecture.
• Goal: Rapid prototyping and scalable, production-ready code across multiple features.
File structure
• core/
• services/ (navigation, logging, etc.)
• theme/ (app theme data)
• utils/ (helper functions)
• data/
• api/ (HTTP clients, endpoints)
• database/ (local DB interfaces)
• models/ (DTOs, data representations)
• repositories/ (concrete data-source implementations)
• features/
• home/ and profile/ modules, each with:
– domain/ (entities, use-cases, abstract repos)
– presentation/ (screens, widgets)
– state/ (Bloc/Cubit or Provider state classes)
• routing/ (app routing configuration)
• shared/
• dialogs/, extensions/, widgets/ (reusable UI & logic)
• main.dart (entry point)
• test/ mirrors the same structure for unit/widget tests
README for additional insights
• Confirms DDD-inspired, feature-first separation
• Highlights use of Dart/Flutter, no separate backend—app calls remote APIs and local DB
• Core and shared modules supply cross-cutting concerns
a. Main components:
• Presentation layer (features/…/presentation)
• State management (features/…/state)
• Domain layer (features/…/domain)
• Data layer (data/repos, models, api, database)
• Core services (core/services)
• Shared UI & logic (shared/)
• Routing engine (routing/)
• External services: Remote API, Local DB
• Entry: main.dart → routing
b. Relationships & interactions:
1. User interacts with Presentation widgets
2. Widgets dispatch events to State managers
3. State managers invoke Domain use cases
4. Use cases call Repository interfaces
5. Repositories delegate to API clients or DB interfaces
6. Core services (navigation, logging) are injected into Presentation and Data layers
7. Shared widgets/dialogs are imported by Presentation
c. Architectural patterns & principles:
• Layered architecture (Presentation → Domain → Data → External)
• Feature isolation (each feature encapsulates its own layers)
• Dependency Inversion: Domain depends on abstract repos, concrete repos live in Data
• Separation of concerns: Core vs. Shared vs. Feature vs. Data
d. Key technologies:
• Dart & Flutter SDK
• State management (Bloc/Cubit or Provider)
• HTTP client (lib/data/api)
• Local DB (SQLite via lib/data/database)
• Theming (core/theme) and constants (core/constants)
• Navigation (routing/my_routing.dart and core/services)
Detail without clutter
• Folder as a sub-component in its layer.
• Main.dart at the top, feeding into Routing.