Luga Energy sells solar energy subscriptions. It sounds simple until you look inside: four kinds of users (sales consultants, energy generators, customers and admins), different commercial rules, financial operations and a lot of external integrations.
When I joined, much of it ran by hand.
Problem first, code second
Before opening the editor, I went to understand where operations were really losing time. The clearest bottleneck: three employees spent the month logging into the ENEL utility portal, downloading electricity bills and copying consumption data into spreadsheets.
It wasn't a "missing software" problem. It was a whole process held up by repetitive work, prone to errors and unable to scale with the number of customers.
The solution
I built the platform connecting the four roles across sales, contracts and billing, with Next.js, Node.js, Prisma and PostgreSQL. The parts that mattered most:
- Automatic ENEL bill retrieval. Web scraping on BullMQ queues and Redis, handling authentication and CAPTCHA. It replaced the three employees' manual work and saved an estimated 300 staff-hours per month.
- Solar inverters in one place. I centralized inverter integrations, generation data and automated notifications, so nobody had to check several external systems to know what each plant produced.
- Finance on autopilot. Invoices, Brazilian tax invoices, collections and contracts are generated automatically, with two payment providers (Asaas and Stripe).
- AI-assisted sales. AI-powered sales automation via WhatsApp to support the consultants.
The result
About 90% of subscription operations now run automatically. Less typing, fewer errors and an operation that grows without hiring at the same pace.
What I took away
- The biggest win is rarely the flashiest feature. It was in a boring process three people did every month.
- Queues are your friend. Scraping, billing and integrations fail. With queues and retries, a failure becomes a delay instead of lost data.
- Being close to the operation changes what you build. That's what I mean by working forward deployed: code is the means, the number that moves is the goal.