Skip to content
fernando.catalan
All projects

WorkMobile · Backend · Cloud

Mobile attendance app for dual-training students

A Flutter app for dual-training students to clock in and out at their host company. I built it end to end twice: first as a multi-role system with an Express API and MySQL deployed on AWS, then redesigned as a minimal TypeScript service ready for Lambda.

Role
Sole developer. Mobile, backend, database and cloud
Period
May 2025 — Present
Status
In development
Team
Just me. Version 2 integrates with the program's web platform, which a teammate develops

Professional project: the name and client details are anonymized. The technical description is real.

Context

Dual-training students alternate between school and a company. The program needed a reliable record of who showed up, when, where and for how many hours, without relying on spreadsheets or on the phone's clock.

I developed it on my own across 19 months, with a seven-month pause in 2026, and it went through two architectures.

The problem

The first version handled everything inside the app: users, companies, reports and clocking, across three roles. It worked, but it duplicated data that already lived in the program's web platform, which meant keeping two sources of truth.

The second version starts from a different question: what is the minimum the app has to do well? The answer was clocking in and out, even when the student forgot to clock out or has no GPS.

What I built

  • Version 1. A Flutter app with three roles (administrator, teacher and student) and 27 screens, on top of a 40-endpoint REST API built with Express and MySQL.

  • Bulk student import from Excel with validation and error details, and attendance reports in Excel sent by email through Amazon SES.

  • Authentication that evolved with the project: bcrypt passwords, then JWT with refresh tokens, then Amazon Cognito.

  • The first version's AWS deployment (Elastic Beanstalk, RDS MySQL and HTTPS through CloudFront) and a way to update the APK outside the store using Firebase Remote Config.

  • Version 2. A single-screen app with Google sign-in and one button that depends on the state of the workday. If there is no location permission or GPS, the entry is still recorded.

  • A new TypeScript backend using ports and adapters: 6 routes, zod validation, typed queries with Kysely against the web platform's PostgreSQL database and an error contract with 17 documented codes.

  • The workday rules, implemented and tested: one clock-in per day, manual clock-out for a day left open, rounding to half hours, and already validated days that are never overwritten.

  • The same service prepared for AWS Lambda behind API Gateway, with its infrastructure defined in Terraform.

Architecture

architecture.svgSwipe →

Version 2 architecture. It is implemented, tested end to end locally and defined in Terraform; it has not been switched on in the cloud yet.

  • Client
  • External system
  • Edge and network
  • Compute
  • Data
  • Client:
    • Flutter app: Android · Google Sign-In
    • Google: ID token
  • Edge:
    • API Gateway: HTTP API · JWT authorizer
  • Compute:
    • Lambda: Node.js 24 · arm64 · VPC
  • Data:
    • RDS PostgreSQL: private · verified TLS
    • Web platform: Next.js · Prisma

Connections:

  • Flutter app → Google
  • Flutter app → API Gateway (Bearer)
  • API Gateway → Lambda
  • Lambda → RDS PostgreSQL (IAM token)
  • Web platform → RDS PostgreSQL

Technical decisions

  1. A single source of truth

    The app stopped managing users and companies. The service has no schema of its own: it reads from the web platform's database and only writes to two tables. The backend went from 40 endpoints to 6 routes.

  2. Identity with no passwords to manage

    The web platform already used Google, so the app does too. On Lambda, identity comes from the claims of API Gateway's JWT authorizer, and the function fails closed if a request did not go through it.

  3. No static secrets for the database connection

    Every new connection uses an IAM token signed with the Lambda's role and verifies the RDS CA. A pool of one connection per instance, combined with reserved concurrency, protects the database.

  4. The server sets the time

    Instants are stored in UTC and converted to Chilean time without depending on the process time zone, with tests covering both daylight saving and standard time. I learned it after a time zone bug in the first version.

  5. A reproducible artifact

    The Lambda zip is built with fixed timestamps and ordering, so Terraform does not redeploy when the code has not changed.

Stack

Mobile
  • Flutter 3
  • Dart
  • Google Sign-In
  • geolocator
  • flutter_test
Backend v2
  • Node.js 24
  • TypeScript
  • Express 5
  • Kysely
  • zod
  • serverless-http
Backend v1
  • Node.js
  • Express
  • MySQL 8
  • JWT
  • Amazon Cognito
  • Amazon SES
Cloud
  • AWS Elastic Beanstalk
  • Amazon RDS
  • CloudFront
  • AWS Lambda
  • API Gateway
  • Terraform
Quality
  • node:test
  • Dependabot
  • Docker Compose

Outcome

  • The first version was deployed on AWS from January to October 2026.

  • The second version works end to end locally and is packaged for Lambda. Its infrastructure is defined but not switched on yet.

  • 59 backend test cases that run with no network or database, plus 9 in the app.

  • 294 commits over 19 months as the sole author.

What I learned

  • Moving from credentials in environment variables to secretless identities: an instance role on Elastic Beanstalk and IAM tokens for RDS.

  • Designing for Lambda: no state or disk, one connection per instance and reserved concurrency to protect the database.

  • A stable error contract (message and code) lets the app decide without parsing text, and avoids leaking internal details.

  • Refactoring a monolith of over 1,700 lines into modules with ports and adapters makes testing cheap: tests run on in-memory doubles.

  • On Android, location permissions have to degrade gracefully: a user denying them must not block clocking in.