Nov 27, 2024

Advanced Network Architecture for a Scalable ERP System

Unlock scalable ERP efficiency with advanced network architecture: dynamic URLs, secure token management, smart caching, and seamless, high-performance user experiences.
Shaikh Afroz
Shaikh AfrozSoftware Engineer - II
lines

An ERP (Enterprise Resource Planning) system is an integrated platform that streamlines business processes across departments like finance, HR, and supply chain. It centralizes data, enhancing efficiency and decision-making by providing a unified, real-time view of operations.

Building a highly scalable and adaptable ERP system isn’t just about writing code; it’s about solving complex puzzles that make everything run smoothly, even under the most demanding conditions. When we embarked on this project, we knew our solutions needed to be clever, forward-thinking, and rock-solid to meet both the client’s needs and the challenges of modern software engineering. Here’s how we tackled some of the biggest hurdles.

The Problem: Network Complexity at Scale

Imagine trying to build an ERP platform that can cater to multiple organizations, each with their unique setups, URL handlers, design themes, and backend requirements. Now, add the twist: the whole system needs to handle dynamic URLs, minimize API calls, ensure secure user sessions, and process location-specific data—all without breaking a sweat. Easy, right? Well, not quite.

Our client wanted everything to work seamlessly without frequent app updates, so we had to develop an architecture that was as flexible as it was efficient.

Dynamic URLs:

In most traditional architectures, static URLs are the go-to for API calls. Think of them as locked doors: reliable, but inflexible. We needed something far more adaptable, a system that could handle multiple organizations with different configurations on the fly.

So, we made our URLs dynamic.

This wasn’t just a neat trick; it was a necessity. Our solution? An intelligent system that fetched and adapted base URLs based on the organization accessing the platform. We centralized these URL mappings and pulled configurations from easily modifiable sources, like Google Sheets.
Here's how it worked: based on the company name provided, the system would fetch the correct base URL, hitting it with the organization’s name to fetch a login page tailored to that organization. From there, a new URL, specific to that organization, would be generated and used for subsequent calls, ensuring that each organization was always routed to the correct endpoints without needing code changes or redeployment.

This intelligent, adaptable approach reduced manual updates and made the system easily scalable.

Screenshot 2024-11-26 at 1.38.39 PM.png

This adaptability reduced maintenance headaches and sped up onboarding for new organizations. In essence, our ERP system became a living, breathing entity—always ready to adapt. No more hardcoded paths, no more manual updates. Just a streamlined, smart setup that future-proofed our platform.

Would love to know if this refined version works for you!

Token Management:

In traditional systems, JWT tokens are simply extracted and used directly. However, for added security and to prevent misuse, we implemented a more advanced solution. Instead of using the JWT as-is, we built a custom algorithm to decode and extract the token securely. This extra layer of security ensures that even if someone intercepts the token, it cannot be used without going through our decoding process, keeping the authentication flow both smooth and safe for users.

Screenshot 2024-11-26 at 1.41.31 PM.png

Data Injection:

For our ERP system, we needed to collect essential data like location, device model, and screen size, as different devices and platforms required tailored responses. Instead of requesting this data piecemeal, we designed a smarter approach. At login, we gathered all the necessary device-specific info along with location data. To ensure we stayed up-to-date, we implemented a timer to refresh the location at regular intervals. If location permissions were off, our app handled the situation quietly, only nudging users when needed, ensuring a seamless and uninterrupted user experience.

Screenshot 2024-11-26 at 1.43.23 PM.png

Error Handling: Making Debugging a Breeze

Let’s face it: Error messages like “Network Error” aren’t helpful. When you have a backend-driven development (BDD) environment, you need feedback that’s clear and actionable.

Every aspect of the app—from UI text to data—comes from the backend. So, when issues arise, they’re often tied to problems in the backend responses. To tackle this, we built an error handling system that transforms cryptic backend error codes into clear, user-friendly messages, making debugging easier for the development team. Each response includes custom feedback, highlighting what went wrong or what data was missing. This level of clarity reduced user frustration and significantly lowered support tickets.

Screenshot 2024-11-26 at 1.45.00 PM.png

To make debugging even more efficient, the error dialog that popped up also displayed detailed backend logs. This allowed our development team to see exactly what went wrong behind the scenes, providing them with the context they needed to fix issues quickly. This seamless feedback loop not only helped resolve problems faster but also made it easier for the backend team to pinpoint and address any issues, leading to smoother development and fewer user-facing errors.

Tackling Flutter Web’s Limitations

Developing for web on Flutter came with its own quirks. We had to rethink the way we managed state and optimized requests. A sophisticated caching mechanism came to the rescue, storing crucial data (like subscription IDs and configurations) to reduce redundant network calls. We made sure the app stayed snappy, even under pressure, with fewer delays and faster response times.

The API Endpoint Puzzle:

In response to the client’s request for streamlined API interactions, we devised a strategy that revolved around a single, flexible core endpoint. After login, this endpoint (e.g., projectname/api/controller) remained consistent, simplifying how we handled requests. By designing payloads with all necessary data for each interaction, we eliminated the need for multiple, specialized endpoints. This approach allowed the system to respond dynamically based on the input provided, improving security, simplifying maintenance, and keeping the architecture clean and efficient. Also given the fact that this is a Backend driven Project this approach makes it even more suitable and works as required.

Screenshot 2024-11-26 at 1.48.43 PM.png

Caching: The Secret Sauce

Imagine a world where every piece of data you need is ready before you ask for it. Our caching solution did just that. By intelligently storing previous responses, we minimized repeat calls and maximized speed. This was a game-changer, especially in scenarios where performance mattered most, like dynamic URL updates or handling frequent token checks.

Key Outcomes: Why This Approach Rocks

  • Future-Proof Flexibility: Adapts to new organizations effortlessly, no code rewrites required.
  • Enhanced User Experience: Fewer disruptions, smarter data handling, and intuitive error feedback.
  • Performance Boosts: Faster load times, reduced network traffic, and a snappy user interface.
  • Simplified Development: Developers work faster and more efficiently, thanks to reusable components.

Our advanced network architecture didn't just solve the problem—it set a new standard for what’s possible with scalable ERP systems. By balancing complexity with usability, we created a platform that’s ready for today and built for tomorrow.

Book a Discovery Call.

blog logo