Ir al contenido principal

When “Pre-Installed OpenWrt” Isn’t Plug-and-Play

  Lessons Learned After Finally Configuring a Raspberry Pi CM4 Mini Router (Bought in 2022) Product Mini Router built with Raspberry Pi Compute Module 4 Dual Gigabit Ethernet NICs 4GB RAM / 32GB eMMC Pre-installed OpenWrt Compact form factor, fanless, low power Background: A Device That Waited Its Turn I bought this device back in 2022 . At the time, it looked like the perfect small router: Raspberry Pi Compute Module 4 Dual Ethernet ports OpenWrt already installed No SD card required thanks to eMMC But like many homelab projects, it ended up sitting on a shelf . Fast forward to today — with more networking experience, a clearer home network plan, and a real need for a flexible router — I finally decided to configure it properly. That’s when the real journey started. What I Expected (Even in 2025) Even knowing this wasn’t a consumer router, I still expected: Plug WAN into my upstream router Plug LAN into my laptop Access 192.168.1.1 Hav...

Modern Architecture for Native Apps with AWS Backend: A Practical Guide

Introduction

Designing a mobile app today goes far beyond building a beautiful interface. Native apps — whether for iOS or Android — need secure authentication, user role management, real-time communication with the backend, and scalable infrastructure to support growth.

In this post, I’ll walk you through a clean and modern architecture to connect native mobile apps to a robust backend on AWS. The architecture is modular, scalable, and aligned with best practices for security and performance — without relying on overly complex tools.

Why it matters: apps today are more than just UI

A production-grade mobile app often includes:

  • User login (email, Google, or others),

  • Differentiated access for multiple roles (e.g., user vs admin),

  • Secure token-based communication,

  • A backend capable of handling business logic and data,

  • Data storage, asset management, and scalable APIs,

  • Compliance with Google Play and App Store requirements.

All of these require a backend architecture that’s cloud-native and well-structured.


Core requirements this architecture addresses

  • Two native apps: one built in Swift (iOS) and the other in Kotlin (Android).

  • Login via email and Google using AWS Cognito.

  • Token-based authorization using JWT.

  • Role-based dashboards: e.g., Admin, Client, Operator.

  • REST API backend built in Node.js (NestJS recommended).

  • Secure and modular deployment using AWS services.

  • Scalable and maintainable infrastructure with CI/CD pipelines.

  • Full Spanish UI support and compliance with privacy policies.


Architecture Overview

🧩 Mobile Frontend:

  • Swift and Kotlin apps communicate via HTTPS.

  • JWT tokens stored securely on-device.

  • API requests authenticated and role-restricted.

🛠️ Backend:

  • Node.js / NestJS for API logic and routes.

  • Authentication and role-checking middleware.

  • Connection to a PostgreSQL database via ORM.

🔐 Security & Identity:

  • AWS Cognito for user pool, federated login (Google), and password recovery.

  • JWT tokens with custom claims for roles.

  • Role-based access control enforced at API level.

☁️ AWS Infrastructure:

  • ECS (Fargate) for serverless container deployment.

  • API Gateway as secure entry point.

  • RDS PostgreSQL for persistent data storage.

  • Parameter Store for secrets and config variables.

  • S3 for user assets (e.g., images or documents).

  • CloudWatch for logs and monitoring.

⚙️ DevOps & Deployment:

  • Git-based CI/CD using GitLab pipelines.

  • Separate environments (dev, staging, prod).

  • Dockerized backend and easy rollbacks.

  • Environment variables and secrets injected from AWS.


Key Lessons Learned

  • Start modular: separating concerns early (auth, API, DB, frontend) simplifies scaling.

  • JWT + roles offers a clean way to manage access across user types.

  • AWS Cognito saves time and ensures secure, standards-compliant login.

  • Parameter Store avoids hardcoding secrets and supports good ops hygiene.

  • Fargate + API Gateway gives you scalability without managing servers.


Want to see a real diagram or get code examples?

If you're interested in seeing how this architecture looks visually, or want a working template to build your own, I’m happy to share diagrams or GitHub samples.

Leave a comment below or reach out — let’s connect and accelerate your app’s development journey.

Comentarios