EEC ID
A digital identity and work-permit platform for foreign workers in Thailand’s Eastern Economic Corridor — where a phone reads the passport chip and matches the face holding it.
- Role
- Full-stack · wrote nearly all of the Flutter app and mobile service
- Stack
- Flutter · .NET 8 · Next.js · ZITADEL
- Problem
- Workers had to prove identity in person, and other government systems couldn’t trust a photo of a passport.
- What I did
- Built the Flutter app and its service: chip reading, OCR, face match, and sign-in for partner apps.
Results
Jun 2025 → May 2026 (continued into the Senior role) · wrote 486 of the mobile app’s 502 commits- Foreign workers can prove their identity from a phone instead of queuing at an office — signed off in client testing (SIT and UAT), ahead of launch
- One-tap sign-in from partner apps works on iPhone, after 7 approaches were compared
- 28 screens across 11 modules delivered to UAT, from identity checks to app-to-app sign-in
How it fits together
Redrawn diagramHow it works
- 01
Reading the ePassport chip over NFC
The MRZ, scanned with on-device OCR (ML Kit), gives the access key; the app then reads the chip with dmrtd and checks the data instead of trusting an image.
- 02
Matching the face to the chip
On-device face detection, then a dedicated face-match service compares the live capture with the chip photo.
- 03
Becoming an identity provider
A custom OIDC provider on ZITADEL, with app-to-app sign-in (PKCE) so partner apps can log users in with their EEC ID.
- 04
Cards generated, not drawn
eID and work-permit cards are rendered from SVG templates on the server — identical in the app, the portal and print.
What went wrong — and how I fixed it
Real problems from the commit history, not a highlight reel.
- 01Problem
On Android, other NFC apps grabbed the passport chip the moment a read finished.
How I fixed itKeep holding NFC for ~2 s after success and tell the user to move the phone away.
- 02Problem
Camera and NFC fought each other, sessions overlapped, and the app broke after the background.
How I fixed itA single camera-session manager, a finish-once guard, lifecycle-aware cleanup, plus countdowns and attempt counters.
- 03Problem
Images for MRZ and face match had wrong colours, wrong orientation, unknown formats and were too large.
How I fixed itFull still photos instead of preview frames, rotation, chip image-format detection and compression before upload.
- 04Problem
Backend verification was slow because steps ran one after another.
How I fixed itRan uploads and face-match calls in parallel, added per-step timing, and split a slow query in the officer portal.
- 05Problem
Silent app-to-app login failed on iOS because cookies are per browser context — 7 approaches tried.
How I fixed itThe logged-in app’s backend issues the authorization code and hands a standard PKCE redirect to the calling app.
Decisions & trade-offs
Verify the chip, not the picture
More steps for the user (scan the MRZ, then tap the passport) — but the data is signed by the issuing country.
Build on ZITADEL instead of writing auth
Standard OIDC for partners; custom screens and claims only where the government flow differs.
- The Flutter app, end to end (Riverpod, Freezed, Dio)
- The .NET mobile service
- Features in the officer web portal
- Flutter
- .NET 8
- Next.js
- ZITADEL
- SignalR
- PostgreSQL
- FastAPI
Client system with private data — the visuals on this page are redrawn diagrams, not screenshots.