Case study · Nugen Energy ← Christian Onyisi · all work · Tools
Nugen Energy logoCase study · Home energy · Nigeria

Solar, grid, generator.One screen.Always signed in.

Nugen Energy's app shows a household what is powering their home right now and lets them decide what stays on. I built everything behind its screens.

Nugen home screen: battery charging, solar and grid share, consumption Nugen load priorities: fridge, main room, air conditioning
3
Power sources in one view
18
API endpoints in the data layer
2
Flutter engineers on the build
Web
First release, from a Flutter codebase

The brief

Power in a Nigerian home comes from three places at once.

A Nugen system pairs solar panels, a battery and an inverter with the grid and the household's generator. The app answers the questions people ask every day: is the battery charging, how long will it last, is the grid on, and should the generator still be running? It also lets them rank their loads, so the air conditioning switches off long before the fridge does when the battery runs low.

I came in as the second Flutter engineer after the first screens were built, and took on everything behind them: the integration with Nugen's API, sign‑in, sessions, routing, live updates, alerts, statistics and schedule control.

Nugen chose the web for its first release, so the app had to work as well in a browser as on a phone, from one codebase.

The hard part

Sessions that hold, in a browser and on a phone.

People sign in with their phone number and a one‑time code, and the session lives in a cookie. A browser handles that cookie by itself; a phone app has to carry it on every request. The same Flutter code had to do both, without ever showing someone a login screen in the middle of checking their battery.

I built the session layer so every request checks its access first. When a session is about to expire, one refresh runs and every request waiting on it shares the result, instead of each firing its own refresh and racing. If the refresh fails, the app signs out cleanly, stops its live updates and returns to login.

On top of that sit the live parts: power, battery and grid status that keep themselves fresh and hold the last good reading if a refresh fails, and alerts like "turn off the generator" that disappear the moment you acknowledge them and come back if the server doesn't confirm.

Where it stands

Web first, from one codebase.

Nugen's app was built web‑first for its initial release, set up for Firebase Hosting, with Android and iOS targets in the same Flutter project.