Skip to content
← All work

Personal · TypeScript practice · 2025Learning project

ATM API

A small bank-host simulator in TypeScript. An ATM posts a card number, PIN and transaction type; the server checks the PIN with bcrypt and approves a balance inquiry or a withdrawal.

Who wrote whatI used an AI tutor to explain concepts while learning; I wrote the code.

One request
  1. ATM posts card, PIN, type
  2. Validate the message (400 if bad)
  3. Find the card, compare PIN with bcrypt
  4. Balance inquiry, or withdrawal with a balance check
  5. Approved or declined

The part I like

Transaction types are a union, and the switch ends in a never check. Add a new type and the compiler refuses to build until it's handled.

What's not real yet

Accounts live in memory, the PIN “encryption” is a placeholder, and declines come back as 401 when they should have their own status. Next: SQLite for accounts, idempotent withdrawals and proper response codes.

NextCropScan→

07 · Contact

Write to me.

I'm open to software engineering and data roles, and to freelance work. If you have a process that still runs on copy and paste, I'd like to hear about it.