Decentralized utility management made simple. Manage customers, revenues and assets with this all-in one open source platform.
MicroPowerManager (MPM) is a decentralized utility and customer management tool designed for energy access providers.
This repository contains the source code for the MicroPowerManager Agent App. This Android application enables agents to manage customers, track payments, monitor appliances, and handle support tickets efficiently.
- π Dashboard: Real-time business analytics with summary and graph views
- π₯ Customer Management: Comprehensive customer database with detailed profiles
- π° Payment Tracking: Payment collection, history, and revenue analytics
- π Appliance Management: Track sold appliances and their status
- π« Support Tickets: Create and manage customer support requests
- π Secure Authentication: Protected login system with session management
- π± Push Notifications: Real-time updates via Firebase Cloud Messaging
- Language: Kotlin 1.6.21
- Minimum SDK: API 21 (Android 5.0)
- Target SDK: API 31 (Android 12)
- Architecture: MVVM with Repository pattern
- Dependency Injection: Koin
- Networking: Retrofit + RxJava
- Navigation: Android Navigation Component
- UI: Material Design + ViewBinding
- Build System: Gradle with Kotlin DSL
- Push Notifications: Firebase Cloud Messaging
- Crash Reporting: Firebase Crashlytics
Before you begin, ensure you have the following installed:
- Android Studio (latest version recommended)
- Git for version control
- Java Development Kit (JDK) 11 - Eclipse Temurin recommended
- (Optional) direnv for environment management
-
Clone the Repository
git clone https://github.com/EnAccess/micropowermanager-agent-app.git cd micropowermanager-agent-app
-
Configure Android Studio
-
Open the project in Android Studio
-
Configure Gradle JDK:
- Go to Android Studio > Settings > Build, Execution, Deployment > Build Tools > Gradle
- Set Gradle JDK to
temurin-11
- If not installed, select Download JDK... and choose:
- Version:
11
- Vendor:
Eclipse Temurin AdoptOpenJDK HotSpot
- Location:
<default>
- Version:
Note: For optimal performance on Mac with M-chips, select
aarch64
architecture.
-
-
Environment Setup (Optional but recommended):
cp .envrc.sample .envrc # Edit .envrc and set JAVA_HOME to match your Gradle JDK path
-
Sync Project: Click Sync Project with Gradle files
On Device/Emulator:
- Minimum requirement: Android 5.0 (API 21)
- Ensure Google Play Services is installed (required for location features)
- Configure location services for full functionality
Build Variants:
- Debug: Development build with debugging enabled
- Release: Production build with code optimization and signing
./gradlew assembleDebug
./gradlew assembleRelease
The output APK will be located at app/build/outputs/apk/release/
The app uses the following build configuration:
- Code Optimization: Enabled for release builds
- Resource Shrinking: Enabled for release builds
- ProGuard: Configured for code obfuscation
- Signing: Release builds are signed with a keystore
This application follows a multi-module architecture with clear separation of concerns:
core
: Base utilities, constants, and shared componentscore_ui
: Common UI components and base classescore_network
: Network layer with Retrofit and RxJavacore_network_auth
: Authenticated API endpointscore_network_no_auth
: Public API endpointscore_localization
: String resources and localization
feature_login
: Authentication and user session managementfeature_main
: Main navigation and drawer functionalityfeature_dashboard
: Business analytics and reportingfeature_customers
: Customer management systemfeature_payment
: Payment processing and trackingfeature_appliance
: Appliance inventory managementfeature_ticket
: Support ticket system
shared_navigation
: Navigation coordination between featuresshared_agent
: Agent-specific functionalityshared_customer
: Customer data models and utilitiesshared_messaging
: Push notification handlingshared_success
: Success state management
- SplashActivity: Initial loading screen and navigation logic
- LoginActivity: User authentication
- MainActivity: Main application interface with navigation drawer
The project uses several key dependencies:
- Koin: Dependency injection
- Retrofit: Network requests
- RxJava: Reactive programming
- Navigation Component: Screen navigation
- Material Design: UI components
- Firebase: Push notifications and crash reporting
- Create a new feature module following the existing pattern
- Implement MVVM architecture with Repository pattern
- Add proper dependency injection with Koin
- Include unit tests for business logic
- Update navigation if needed