{"id":51017809,"url":"https://github.com/enaccess/micropowermanager-field-app","last_synced_at":"2026-06-21T13:01:25.652Z","repository":{"id":360569259,"uuid":"1228737003","full_name":"EnAccess/micropowermanager-field-app","owner":"EnAccess","description":"Open Source Management Tool for Decentralized Utilities.","archived":false,"fork":false,"pushed_at":"2026-06-17T16:39:27.000Z","size":1029,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-17T18:12:10.543Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://micropowermanager.io/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EnAccess.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"EnAccess","custom":["https://www.paypal.me/EnAccess"]}},"created_at":"2026-05-04T10:20:58.000Z","updated_at":"2026-06-17T16:39:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/EnAccess/micropowermanager-field-app","commit_stats":null,"previous_names":["enaccess/micropowermanager-field-app"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/EnAccess/micropowermanager-field-app","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnAccess%2Fmicropowermanager-field-app","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnAccess%2Fmicropowermanager-field-app/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnAccess%2Fmicropowermanager-field-app/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnAccess%2Fmicropowermanager-field-app/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EnAccess","download_url":"https://codeload.github.com/EnAccess/micropowermanager-field-app/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EnAccess%2Fmicropowermanager-field-app/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34610829,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-21T02:00:05.568Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-21T13:01:24.784Z","updated_at":"2026-06-21T13:01:25.647Z","avatar_url":"https://github.com/EnAccess.png","language":"TypeScript","funding_links":["https://github.com/sponsors/EnAccess","https://www.paypal.me/EnAccess"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/EnAccess/micropowermanager-field-app\"\u003e\n    \u003cimg\n      src=\"https://micropowermanager.io/mpmlogo_raw.png\"\n      alt=\"MicroPowerManager Field App\"\n      width=\"320\"\n    \u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eDecentralized utility management made simple. Manage customers, revenues and assets with this all-in one open source platform.\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg\n    alt=\"Project Status\"\n    src=\"https://img.shields.io/badge/Project%20Status-beta-orange\"\n  \u003e\n  \u003cimg\n    alt=\"GitHub Workflow Status\"\n    src=\"https://img.shields.io/github/actions/workflow/status/EnAccess/micropowermanager-field-app/check-generic.yaml\"\n  \u003e\n  \u003ca href=\"https://github.com/EnAccess/micropowermanager-field-app/blob/main/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg\n      alt=\"License\"\n      src=\"https://img.shields.io/github/license/EnAccess/micropowermanager-field-app\"\n    \u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n---\n\n# MicroPowerManager - Field App\n\nMicroPowerManager (MPM) is a decentralized utility and customer management tool.\nManage customers, revenues and assets with this all-in one Open Source platform.\n\n## Get Started\n\nThis repository contains the source code for the [MicroPowerManager Field App](https://micropowermanager.io/usage-guide/android-apps.html) — a cross-platform Expo / React Native app that lets field agents register customers, record appliance sales, and collect payments, online or offline.\n\n### Prerequisites\n\n- [Node.js](https://nodejs.org/) 20 LTS and npm\n- [Xcode](https://developer.apple.com/xcode/) (iOS) and/or [Android Studio](https://developer.android.com/studio) (Android)\n- Git clone the repository\n\n### Build and run the app locally\n\n```sh\nnpm install\nnpm start          # Metro dev server\nnpm run android    # build \u0026 install on Android emulator/device\nnpm run ios        # build \u0026 install on iOS simulator/device\n```\n\nThe app uses location permissions, so ensure the emulator or device has location services enabled.\n\n### Connecting to a backend\n\nOn first launch the app shows an environment picker:\n\n| Option   | Use when                                                |\n| -------- | ------------------------------------------------------- |\n| `Demo`   | Explore against the public demo tenant                  |\n| `Cloud`  | Sign in with a `\u003ccompany\u003e.micropowermanager.cloud` slug |\n| `Custom` | Self-hosted, local, or staging                          |\n\n### Create a release build locally\n\nFor Android\n\n```sh\nnpx expo prebuild --platform android\ncd android \u0026\u0026 ./gradlew assembleRelease\n# output: android/app/build/outputs/apk/release\n```\n\nFor iOS, open the generated `ios/` workspace in Xcode and archive (or use [EAS Build](https://docs.expo.dev/eas/)).\n\n## Architecture\n\nFile-based routing on **Expo Router** with an offline-first data layer.\n\n- **Expo Router** for navigation (typed, file-based routes)\n- **TanStack React Query** for server cache and request orchestration\n- **Axios** client with auth + `device-id` interceptors and a 401 → re-login handler\n- **AsyncStorage** outbox; **expo-secure-store** for tokens\n- **React Hook Form** + **Zod** for forms and validation\n- Custom design system in `src/components` + `src/theme`\n\n### Routing (`app/`)\n\n- `(auth)` — `environment`, `login`\n- `(app)/(tabs)` — `index`, `customers`, `sales`, `payments`\n- `(app)/{customers,sales,payments}/` — `[id]` and `new` screens\n\n### Offline Outbox\n\nMutations that fail offline are queued in `src/storage/outbox.ts` (AsyncStorage, capped at 200 entries) and replayed by `outboxDrainer.ts` once `useNetworkStatus` reports connectivity. `SyncBanner` surfaces pending and failed counts.\n\n### Session\n\n`SessionContext` (`src/auth/SessionContext.tsx`) holds the active environment, token, and agent. Tokens live in `expo-secure-store`; a stable `device-id` is generated on first launch.\n\n## Feature Modules\n\n### Customers\n\nBrowse, search, register, and inspect customers.\nScreens: `(tabs)/customers.tsx`, `customers/new.tsx`, `customers/[id]/index.tsx`.\nRegistration captures a geolocation fix and is enqueued in the outbox if offline.\n\n### Sales\n\nSell appliances on credit or PAYG.\nScreens: `(tabs)/sales.tsx`, `sales/new.tsx`, `sales/[id].tsx`.\n\n### Payments\n\nRecord payments and view receipts.\nScreens: `(tabs)/payments.tsx`, `payments/new.tsx`, `payments/[id].tsx`.\n\n## Development Notes\n\n- TypeScript strict mode; `@/*` aliases `src/*`.\n- Prefer `react-hook-form` + `zodResolver` for new forms — see `customers/new.tsx`.\n- Use theme tokens from `@/theme` (`semantic`, `spacing`, `radii`, `shadows`) rather than hard-coded values.\n- SVGs load via `react-native-svg-transformer` (types in `svg.d.ts`).\n- Location permission is requested on demand from the registration flow, not at boot.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenaccess%2Fmicropowermanager-field-app","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenaccess%2Fmicropowermanager-field-app","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenaccess%2Fmicropowermanager-field-app/lists"}