Software architecture
How I design for web and mobile
I size the web architecture around the client’s needs and choose among three mobile workflows. That choice guides the app structure, identifiers and environment configuration.
- 01BrowserCollect input and show state.
- 02APIIdentify, validate and authorise.
- 03DomainApply the rules of the operation.
- 04DataStore the outcome consistently.
Web · size the architecture around the need
- Needs and constraints
- Web rendering choice
- Business rules and storage
I start with the complexity of the client’s needs. An editorial site can be generated ahead of time. A platform with accounts, roles and business operations needs a backend that controls access and writes. I can start with a modular application shipped as one unit, then split a service when load, maintenance or release cadence warrants it. In the repository, I group routes, use cases and tests by domain so rules are easy to find.
I start with a real action. On a booking screen, availability may change before the user confirms. The interface needs to explain a rejection. The server needs to check permissions and guarantee that a slot cannot be booked twice. Under concurrency, two requests can read the same available state. A transaction and uniqueness constraint suited to the data model can enforce the rule all the way into storage.
This distinction lets web, mobile and background jobs share the same rule. Each interface can adapt its wording and input checks. The business decision and validation stay on the server. The API contract describes the states clients must understand, including conflicts, denied permissions and already processed requests.
Mobile · choose among three delivery workflows
- React Native native projects
- Expo and EAS
- Flutter and Dart
I choose based on required SDKs, team skills, control over Android and iOS, and release cadence. Expo builds on React Native. The first two workflows differ in how native projects are configured and builds are produced. Flutter uses a separate codebase in Dart.
In all three workflows I separate screens, session management and the HTTP client. To load account information, the app starts or resumes a session, calls the API and handles its response states. The server decides whether the caller can access the data.
- Workflow 1
React Native
Direct ownership of native projects
I choose this route when the team wants direct control over Gradle and Xcode or needs an SDK with specific native setup. Screens and API calls stay in TypeScript. Android build variants select the environment and app identifier. On iOS, schemes and configurations do that job. I check capabilities and signing in the native projects and distribute signed builds through the stores’ test channels.
- Workflow 2
Expo
React Native with Expo configuration and builds
With Expo, I centralise the Android package, iOS bundle ID and plugins in app configuration. I map each EAS Build profile to its environment so staging calls its own API and can coexist with production when needed. A development build lets me check the native modules in use. If I also ship JavaScript updates, I separate channels and check the runtime version. An incompatible native change requires a new build.
- Workflow 3
Flutter
Dart UI and native variants
I choose Flutter when the team wants to build the UI in Dart with a shared set of widgets. Screens call application services, which use an HTTP client and interpret API responses. I map Android flavors and iOS schemes to environments and supply the public API URL at build time, for example with dart-define. Before distribution I check plugins, sign-in redirects and signing on both platforms.
Shared foundation · identity, environments and compatibility
- Build identifier
- Session and permissions
- Target API and data
I distinguish the application identifier, user identity and signing keys. The Android package and iOS bundle ID identify the build to the operating system and stores. The session identifies the user to the server, which checks permissions on each resource. If a mobile client uses tokens, I keep them in secure storage backed by iOS Keychain or Android Keystore. Signing keys stay in build tooling and provider secrets on the server.
For development, staging and production I check the public API URL, app identifiers and redirect links together. If the team needs to install two versions side by side, I give them distinct identifiers. On a signed build, I verify on a device that sign-in reaches the right environment, that data belongs to the account and that sign-out clears local session data.
A web page can change on the next deployment. Installed apps can remain on an older version after the server is updated. I prefer to add fields compatibly, validate the transition across app versions and account for unstable connectivity. A retry also needs a predictable outcome. For an action that creates a payment or booking, an idempotency key lets the server recognise the same request again.