A comprehensive Customer Relationship Management (CRM) dashboard application built with Flutter. This application provides a complete solution for managing contacts, deals, tasks, and generating reports for sales teams.
- Dashboard Overview: Real-time statistics and metrics for quick business insights
- Contact Management: Store and manage customer information with ease
- Deal Pipeline: Track sales opportunities through different stages
- Task Management: Organize and prioritize daily activities
- Reporting: Generate insights on sales performance and team productivity
- Real-time Updates: Firebase integration for live data synchronization
- Responsive Design: Works seamlessly across mobile and tablet devices
- Framework: Flutter - Cross-platform UI toolkit
- State Management: Provider - Reactive state management
- Backend: Firebase - Real-time database and authentication
- Dependency Injection: GetIt - Service locator pattern
- Data Modeling: Equatable - Simplified value comparisons
- Logging: Logger - Advanced logging capabilities
The application follows the MVVM (Model-View-ViewModel) architectural pattern with a clean separation of concerns. This design promotes maintainability, testability, and scalability.
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Presentation Layer β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Views (UI) β ViewModels (Business Logic) β Components β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Service Layer β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Repository Layer (Abstractions) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β Data Access Layer (Implementations) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
-
Presentation Layer:
- Views: UI components that display data and handle user interactions
- ViewModels: Business logic and state management
- Components: Reusable UI widgets
-
Service Layer:
- Abstract services defining contracts for data operations
- Business logic coordination
-
Repository Layer:
- Repository interfaces defining data access contracts
- Abstraction between business logic and data sources
-
Data Access Layer:
- Concrete implementations of repositories
- Direct interaction with Firebase Firestore
lib/
βββ app/ # Application setup and main widget
βββ core/ # Core utilities, components, and services
β βββ components/ # Reusable UI components
β βββ constants/ # Application constants
β βββ di/ # Dependency injection setup
β βββ errors/ # Custom exception handling
β βββ mixins/ # Reusable mixins
β βββ repositories/ # Data repository interfaces
β βββ utils/ # Utility functions and helpers
βββ models/ # Data models (Contact, Deal, Task, etc.)
βββ services/ # Service implementations
βββ viewmodels/ # Business logic and state management
βββ views/ # UI screens and widgets
graph TD
A[User Interaction] --> B[View]
B --> C[ViewModel]
C --> D[Service]
D --> E[Repository]
E --> F[Firebase]
F --> E
E --> D
D --> C
C --> B
B --> A
Data structures representing business entities:
- Contact: Customer information
- Deal: Sales opportunities with pipeline stages
- Task: Activities with priorities and due dates
- Stat: Dashboard metrics
- Pipeline: Sales funnel visualization
Business logic containers that manage state and handle user interactions:
- DashboardViewModel: Analytics and overview data
- ContactsViewModel: Contact management operations
- DealsViewModel: Deal pipeline management
- TasksViewModel: Task tracking and organization
- ReportsViewModel: Performance metrics and insights
Business logic implementations that coordinate between ViewModels and Repositories:
- ContactService: Contact CRUD operations
- DealService: Deal management and pipeline tracking
- TaskService: Task scheduling and completion tracking
Data access abstractions that define contracts for data operations:
- ContactRepository: Contact data interface
- DealRepository: Deal data interface
- TaskRepository: Task data interface
Reusable UI elements:
- Cards: Stat cards, contact cards, deal cards
- Navigation: Bottom navigation, app bar
- Forms: Input components for data entry
- Lists: Display collections of data
The application uses the Provider package for state management, following the MVVM pattern:
- Views subscribe to ViewModels for state changes
- User interactions trigger ViewModel methods
- ViewModels update state and notify listeners
- Views rebuild with new data
This approach ensures:
- Separation of UI and business logic
- Testable business logic
- Efficient UI updates
- Predictable state management
The application uses GetIt for dependency injection:
- Services and repositories are registered as singletons
- ViewModels are registered as factories
- Dependencies are injected at application startup
- Loose coupling between components
Benefits:
- Easier testing with mock dependencies
- Centralized dependency management
- Reduced coupling between components
- Improved code maintainability
Firebase Firestore is used for data persistence:
- Real-time synchronization across devices
- Offline support with local caching
- Scalable NoSQL database
- Automatic conflict resolution
Data structure:
- Contacts collection
- Deals collection
- Tasks collection
- Each document contains relevant fields and timestamps
The application implements a comprehensive error handling strategy:
- Custom exceptions for different error types
- Centralized error logging
- User-friendly error messages
- Graceful degradation when services are unavailable
- Name, email, phone, company
- Creation and update timestamps
- Title, value, description
- Status tracking (prospect, qualified, proposal, negotiation, closed, lost)
- Automatic close date calculation
- Creation and update timestamps
- Title, description
- Due dates and completion status
- Priority levels (low, medium, high, urgent)
- Task types (follow-up, presentation, general)
- Association with contacts and deals
- Creation and update timestamps
-
Clone the repository:
git clone https://github.com/your-username/crm-app.git cd crm-app -
Install dependencies:
flutter pub get
-
Set up Firebase:
- Create a new Firebase project
- Add Android and iOS apps to your Firebase project
- Download google-services.json for Android and GoogleService-Info.plist for iOS
- Place these files in their respective directories
-
Configure Firebase in the app:
- Update the package name in android/app/build.gradle
- Update the bundle identifier in Xcode
flutter runThe application is organized into five main sections accessible through the bottom navigation:
- Dashboard: Overview of key metrics, recent activities, and pipeline progress
- Contacts: Manage customer information and view contact statistics
- Deals: Track sales opportunities through different pipeline stages
- Tasks: Organize and prioritize daily activities with due dates
- Reports: Generate insights on sales performance and team productivity
- Real-time statistics cards showing tasks, deals, and revenue
- Sales pipeline visualization
- Recent notifications and high-priority tasks
- Contact activity tracking
- Add, edit, and delete contacts
- Store comprehensive contact information
- Link contacts to deals and tasks
- Search and filter capabilities
- Track deals through six stages: Prospect, Qualified, Proposal, Negotiation, Closed, Lost
- Automatic close date calculation based on deal status
- Deal value tracking and statistics
- Progress visualization
- Create tasks with due dates and priorities
- Associate tasks with specific contacts or deals
- Mark tasks as completed
- Filter by task type and priority
- Sales performance metrics
- Revenue tracking
- Deal closure rates
- Team productivity insights
This project is licensed under the MIT License.