Let’s Talk sales@avioxtechnologies.com
EnergyDjangoMySQLRole-based access

Electric Trees needed a way for users to set up energy companies, configure virtual grids, track usage and buy top-ups in one web application. This project built that platform on Django and MySQL, with three user roles and careful handling of transactions. The engineering detail below comes from the project; no usage or transaction figures are published yet.

3
User roles with their own permissions: admin, company and end user
5
Objectives set for the platform, from grid management to data consistency
3
Engineering challenges named on this page, each with how it was solved
illustrative example · energy top-up

Two top-ups arrive for the same account at the same moment.

Both recorded correctly. Each one runs inside an atomic database transaction with locking, so neither overwrites the other. The usage dashboard shows the updated balance.

View usageManage gridBuy top-up

The problem with traditional energy systems

Traditional energy systems often lack flexibility, transparency and accessibility for small-scale producers and consumers. People who could take part in producing or sharing energy have few simple tools for doing it, or for seeing where energy goes.

Electric Trees works in this area. Its public site describes solar for apartment renters and flat-rate EV charging. The platform in this case study is the management system: a web application for setting up companies, configuring virtual energy grids, tracking usage and handling top-ups.

That combination is harder than it first appears. Every company and grid can be set up differently, several types of user need different permissions, and any record of energy or money has to stay accurate even when many things happen at once.

What we knew before we built

No before-and-after baseline is published for this project, so this page does not offer an improvement figure. What can be stated is what the system had to support.

3
User roles to separate: admin, company and end user
2
Services on the company's public site: apartment solar and flat-rate EV charging
1
Normalized MySQL schema to hold companies, grids, panels and transactions

That set three requirements for the work. The data model had to cope with many different company and grid setups. Each role had to see and do only what belonged to it. And energy top-ups had to stay accurate when they happened at the same time.

The approach we chose

We built a full-stack web application on Python and Django, with a modular architecture organized around its three roles:

  • Admin. Oversight of the platform and the people using it.
  • Company. Creating a company, adding energy grids and managing how energy is distributed.
  • End user. Tracking energy usage and buying top-ups.

A company's path through the platform runs in four steps:

  1. Create. A user sets up their own company on the platform.
  2. Configure. They add virtual grids and panels, and define how these connect.
  3. Track. Energy usage is calculated and reported on dashboards.
  4. Top up. Users buy and manage energy top-ups through protected database transactions.
illustrative · company setup
1Create — company added to the platformcompany
2Configure — grids, panels and connectionscompany
3Track — usage calculated and reporteddashboard
4Top up — balance updated in a transactionend user
Four steps from a new company to a working grid, each handled within the same platform.

What we built

Our contribution was the full-stack application: the architecture, backend, database and HTML and CSS interface.

Energy grid models

We built models to represent grids, panels and their interconnections, which allows energy resources to be allocated dynamically rather than fixed in advance.

Company creation and management

Users can create their own companies, add energy grids and manage how energy is distributed across them.

Usage tracking

Real-time energy usage calculation feeds reporting dashboards, so that users can see how energy is being consumed.

Protected top-up transactions

Energy top-ups run through Django ORM and database transactions, so that a purchase either completes in full or does not happen at all.

A normalized database

The MySQL schema was normalized to protect data integrity, support growth and keep queries performing well. REST APIs and Django's role-based authentication sit on top of it.

Any record of energy or money has to stay correct, even when two things happen at the same moment.

Aviox project teamDesign principle for the build

The guardrails around energy data

Usage and top-up records affect what people pay and what they can draw on. Protecting those records was built into the platform rather than added afterwards.

  • Atomic transactions. Top-ups use Django's atomic transactions, so that a partly completed purchase cannot be left behind.
  • Database locking. Locking prevents race conditions when simultaneous top-ups affect the same data.
  • Fine-grained access. Django's authentication system and custom middleware control what each role can do.
  • Separated roles. Admin, company and end-user permissions are kept distinct.
  • Data integrity. A normalized schema reduces duplicated data that could otherwise fall out of step.

What was reported

The project delivered a platform for creating companies, configuring grids, tracking usage and handling top-ups. The effects below are what the project team reported; none of them is a measured result:

  • Transparency. Decentralized energy networks can be created and managed in a visible, accountable way.
  • Operations. Energy usage monitoring and transaction processes were reported to be more streamlined.
  • Scale. The platform was reported to handle multiple company and user profiles reliably. No load figures are published here.
  • Future work. The design lays the groundwork for IoT-based monitoring and analytics, which is a possible next step and not a shipped feature.

What stays hard

Three challenges shaped this work, and any team building a platform like this should plan for them. Each came with a specific solution.

  • Complex grid modelling. Companies and grids come in many configurations, so the model has to adapt. We used modular database entities that allow dynamic relationships between grids, panels and users.
  • Role-based access control. Different types of user need different permissions, down to individual actions. We used Django's authentication system with custom middleware for fine-grained control.
  • Transaction consistency. Simultaneous top-ups can corrupt a balance if nothing prevents it. We used Django's atomic transactions and database locking to prevent race conditions.

Discuss a similar platform

Expert consultation

Building a multi-role platform?

Talk to an expert about what a comparable project would involve.

Expert consultation

What was built, and what is pending.

These figures describe the project's scope. Usage and transaction figures are left out until the definition, period and baseline behind them are stated and the client has approved them.

3

User rolesAdmin, company and end user, each with its own permissions.

4

Platform stepsCreate a company, configure grids, track usage and top up.

5

ObjectivesFrom grid management to scalability and data consistency.

3

Challenges solvedGrid modelling, access control and transaction consistency.

Questions

About this case study.

What was built, how records stay accurate and what is not claimed.

  • It lets users create companies, configure virtual energy grids and panels, track energy usage on dashboards, and buy and manage energy top-ups, with separate permissions for admins, companies and end users.

  • Full-stack development on Python and Django: the modular architecture, grid and company models, usage dashboards, top-up transactions, the normalized MySQL schema and the HTML and CSS interface.

  • Each one runs in a Django atomic transaction, and database locking prevents race conditions when two affect the same data, so that neither overwrites the other.

  • Through Django's authentication system with custom middleware, which gives fine-grained control over what admin, company and end-user accounts can do.

  • This page does not claim that. Grids on the platform are virtual models of grids, panels and their connections, used for managing allocation, usage and top-ups. IoT-based monitoring is a possible next step and not a shipped feature.

  • This page makes no claim about energy costs or savings. It covers the software, and any performance figure would need its definition, period and baseline stated, along with the client's approval.

  • Possibly. It depends on your roles, your data model and how your transactions work. Take an expert consultation to talk it through.

Start a conversation

Map your roles
and transactions.

Tell us who uses your platform and which records have to stay exact. We will propose the data model, the controls and a first production slice.

sales@avioxtechnologies.com Reply within one business day · Mutual NDA available on request