SEO vs. GEO | The Future of Search
Discover why GEO (Generative Engine Optimization) is replacing traditional SEO. Learn how to rank for AI citations with Induji Technologies - Request a Quote today!
Induji Technical Team
Induji Technical Team
Content Strategy
For years, the standard enterprise playbook for digital products has been clear but fractured: build a web application with one team and a mobile application with another. A React team builds the customer portal, while a separate Swift/Kotlin or React Native team builds the iOS and Android apps. While this approach gets the job done, it's a relic of a bygone era, fraught with inefficiencies that are becoming untenable in the fast-paced market of 2026.
The core issues with this siloed model are:
The market now demands a more elegant, efficient, and scalable solution. Enter the Unified Codebase Architecture—a paradigm shift that leverages a modern monorepo strategy to build both web and mobile applications from a single, shared foundation.
This architecture isn't about finding a single framework that magically works everywhere. It's about strategically combining the best-in-class tools for web, mobile, and backend, and using a monorepo to create a symbiotic relationship between them.
Next.js has solidified its position as the de facto standard for serious, performance-critical web applications. For an enterprise portal, its benefits are non-negotiable:
While React Native provides the core for building native apps with React, Expo is the production-grade ecosystem built around it. For enterprise use, choosing Expo over vanilla React Native is a strategic advantage:
A modern architecture requires a modern backend. A monolithic ERP with a tightly coupled frontend is a bottleneck. By decoupling ERPNext and using it as a "headless" system, it becomes a powerful, API-first source of truth for all your business data.
The monorepo is the foundation that makes the unified codebase possible. Tools like Turborepo (from Vercel) provide the high-performance build system needed to manage a complex, multi-package repository without sacrificing speed.
packages/ and imported into the apps/web and apps/mobile applications.Let's move from theory to a practical implementation structure. Here's how you architect the monorepo for maximum code sharing and efficiency.
Your project's root directory will be managed by pnpm (for efficient dependency management) and turborepo. The folder structure looks like this:
/my-enterprise-app
|-- /apps
| |-- /web # Next.js 15 application
| `-- /mobile # Expo application
|-- /packages
| |-- /ui # Shared UI components (Tamagui)
| |-- /api-client # Shared ERPNext API client
| |-- /shared-logic# Shared business logic (e.g., validation)
| `-- /config # Shared configs (ESLint, TypeScript)
|-- package.json
|-- pnpm-workspace.yaml
`-- turbo.json
Tamagui is a key enabler. It's a universal UI kit and style system that compiles your components to highly optimized code for both web (DOM) and native (React Native). You write a component once, and it renders appropriately on every platform.
In your packages/ui/src/Button.tsx:
import { Button as TamaguiButton, styled } from 'tamagui';
// Create a styled button that can be used everywhere
export const StyledButton = styled(TamaguiButton, {
name: 'StyledButton',
backgroundColor: '$blue10',
color: '$gray1',
fontWeight: '600',
pressStyle: {
backgroundColor: '$blue9',
},
// Add variants for different sizes
variants: {
size: {
'...size': (val, { tokens }) => ({
height: val,
borderRadius: tokens.radius.sm,
fontSize: val === 40 ? 16 : 14,
}),
},
} as const,
defaultVariants: {
size: 40,
},
});
Now, you can use <StyledButton> in both your Next.js app and your Expo app, and it will render as a div on the web and a View on mobile, with styles applied correctly.
Routing is historically a major point of divergence between web and mobile. Solito is a library that solves this by creating a lightweight abstraction layer over Next.js Router and Expo Router.
You define your screens and links in a shared package. In packages/ui/src/screens/UserDetailScreen.tsx:
import { Text, View } from 'tamagui';
import { createParam } from 'solito';
import { useLink } from 'solito/link';
const { useParam } = createParam<{ id: string }>();
export function UserDetailScreen() {
const [id] = useParam('id');
const homeLink = useLink({ href: '/' });
return (
<View f={1} jc="center" ai="center">
<Text>User ID: {id}</Text>
<Button {...homeLink}>Go Home</Button>
</View>
);
}
This single screen component can now be mapped to a route in both Next.js (/users/[id]) and Expo (/users/:id), and the useLink hook will correctly render an <a> tag on web and handle a navigation press on mobile.
To prevent duplicated data-fetching logic, you create a single API client package. This package is responsible for handling authentication (API keys/tokens for ERPNext), making requests, and typing the responses. Using a library like TanStack Query makes this even more powerful.
In packages/api-client/src/index.ts:
import { FrappeApp } from "frappe-js-sdk";
import { QueryClient } from '@tanstack/react-query';
// Initialize the ERPNext connection
const frappe = new FrappeApp("https://your-erpnext-instance.com");
const db = frappe.db();
export const queryClient = new QueryClient();
// Shared function to fetch a sales order
export async function getSalesOrder(orderId: string) {
return await db.getDoc('Sales Order', orderId);
}
// Hook to be used in components
export function useSalesOrder(orderId: string) {
return useQuery({
queryKey: ['salesOrder', orderId],
queryFn: () => getSalesOrder(orderId),
});
}
Now, both your web and mobile components can call useSalesOrder('SO-0001') to fetch data, with caching, revalidation, and type safety handled in one central location.
Imagine a system for a large distributor.
In this scenario, the unified codebase provides immense value:
@my-app/ui.@my-app/api-client) for fetching inventory and submitting orders is shared.@my-app/shared-logic and used by both the complex web form and the simplified mobile form.Adopting this architecture is a strategic technical decision with profound business implications:
Q1: Is this unified codebase approach suitable for a small startup? Absolutely. While it shines at enterprise scale, startups benefit immensely by starting with this architecture. It prevents the accumulation of tech debt, allows a small team to have a huge impact, and establishes best practices from day one, making it easier to scale the team and the product later.
Q2: What are the main challenges with this architecture? The primary challenge is the initial learning curve and setup complexity. Your team needs to be comfortable with the entire stack: Next.js, React Native/Expo, and the monorepo tooling. Onboarding new developers requires a holistic understanding of the full system. Managing dependencies within the monorepo also requires discipline to avoid version conflicts.
Q3: How does this compare to using Flutter or Kotlin Multiplatform (KMP)? This architecture is ideal for teams already invested in or proficient with the React/TypeScript ecosystem. Its key advantage is the near-100% sharing of UI code via tools like Tamagui, which is more difficult with KMP (where UI is typically native). Flutter is a fantastic alternative, but it requires learning a completely different ecosystem (Dart, different state management, etc.). If your team knows React, this unified JS/TS stack offers a more direct path to cross-platform success.
Q4: Can we integrate this architecture with an existing legacy ERP, not just ERPNext?
Yes. The core principle is the "headless" ERP. As long as your existing ERP (e.g., SAP, Oracle) can expose a robust, modern REST or GraphQL API, you can build a shared api-client package to interact with it. The challenge often lies in creating that API layer for the legacy system, a project Induji Technologies frequently assists clients with.
The transition to a unified codebase is a powerful strategic move that will define the most successful enterprise applications of 2026. It requires expert architectural planning and a deep understanding of the entire technology stack, from backend ERP integration to frontend performance optimization.
The team at Induji Technologies specializes in architecting and implementing these complex, high-performance systems. We can help you audit your existing infrastructure, design a custom unified codebase strategy, and build the web and mobile applications that will power your business for the next decade.
Discover why GEO (Generative Engine Optimization) is replacing traditional SEO. Learn how to rank for AI citations with Induji Technologies - Request a Quote today!
Induji Technical Team
Learn how to get your brand cited in ChatGPT Search. Follow our 7-step guide to AI Engine Optimization (AIEO) for 31% higher conversion rates.
Induji Technical Team
Discover why AEO is the new SEO. Learn how to optimize for AI answer engines like ChatGPT and Google SGE with Induji - Request a Quote!
Induji Technical Team
Partner with Induji Technologies to leverage cutting-edge solutions tailored to your unique challenges. Let's build something extraordinary together.
We respond within 24 hours