Preface
- Who this book is for
- What we will build
- What “by hand” means
- Why a book, when you can ask an AI?
- How to read this book
- What you need
Chapter 1: Elixir on the Phone
- Native, web and everything in between
- The price we used to pay
- What Mob does differently
- What runs on the phone
- Why this is good news for us
- An honest word about maturity
- What we will build
Chapter 2: Your Android Workbench
- What we are installing, and why
- Step 1: Prepare the phone
- Step 2: Elixir, Hex and the Mob generator
- Step 3: Create the app
- Step 4: Install Java
- Step 5: Install the Android SDK
- Step 6: Install Zig
- Step 7: First-run Mob install, then check the toolchain
- Step 8: Connect the phone and deploy
- The daily loop
- When it doesn’t start
- What we have so far
Chapter 3: Your First Screen
- A screen is a process
- Writing the screen
- The
~MOBsigil - The starting screen
- Run it
- A test, without a phone
- What we have so far
Chapter 4: Moving Between Screens
- The navigation stack
- From a tap to your code
- Adding the buttons
- Push and pop
- Adding the form and settings screens
- Run it
- The back gesture is free
- Testing navigation
- Other ways to move
- What we have so far
Chapter 5: Passing Parameters Between Screens
- Putting the ID in the tap
- Three receipts to tap
- Sending the params
- Receiving the params
- Run it
- Testing it
- Don’t pass the whole receipt
- What we have so far
Chapter 6: Columns, Rows and Boxes
- What we’re building
- The containers
- A word about sizes
- The new receipts screen
- Run it
- When a layout looks wrong
- Updating the test
- What we have so far
Chapter 7: Colours, Type and Themes
- Tokens, not colours
- Risiti’s theme
- Making it the app’s theme
- The dark green spend card
- Typography
- Letting the user choose
- Run it
- Testing it
- What we have so far
Chapter 8: Lists That Scroll
- Why lists are special
- The expense book
- The list screen
- Filtering with pills
- Run it
- Testing lists
- A tip:
mix formatknows~MOB - What we have so far
Chapter 9: Components of Your Own
- Way one: a function that returns UI
- Way two: a composite
- The header
- The receipt card
- The action button
- Registering the composites
- Using them
- Run it
- Testing components
- What about stateful components?
- What we have so far
Chapter 10: Testing Without a Phone
- Three tiers
- The ScreenCase toolbox
- What to test on a screen
- One test for every screen
async: trueorasync: false?- The tier on the phone
- What we have so far
Chapter 11: Remembering Things
- Three kinds of state
- Meet
Mob.State - An Appearance module
- Using it in Settings
- Applying it at startup
- Run it
- Testing it
- A note on screen state
- What we have so far
Chapter 12: A Database on the Phone
- Why SQLite
- What the generator gave us
- Migrations on a phone
- The transactions table
- The schema
- The context
- Pointing the screens at the database
- Run it
- Testing against SQLite
- What we have so far
Chapter 13: The Receipt Form
- How a text field talks to you
- A field component
- The right keyboard
- The form screen
- Choosing a category with a sheet
- Saving
- Deleting
- Wiring it up
- Run it
- Testing it
- What we have so far
Chapter 14: Taking the Photo
- Plugins
- Permissions
- One module for every device call
- Asking for the camera
- Where photos live
- A column for the photo
- The form, with a photo
- The photo in the list
- Run it
- Testing hardware without hardware
- What we have so far
Chapter 15: The Photo and the Lock
- A full-screen photo, without a new screen
- Saving to the gallery
- A fingerprint lock
- Run it
- Testing it
- What we have so far
- The end of Part I
Chapter 16: The Whole Picture
- Three types, one transaction
- The rule: the phone owns the figures, the server owns the decisions
- The stack
- The map of the code
- Where we go from here
- What we have so far
Chapter 17: The Whole Transaction
- One more migration
- The schema
client_id- The context
- Run it
- Testing it
- What we have so far
Chapter 18: The Home Screen, Finished
- Asking the phone, through
Native - The month picker
- Search
- Date periods
- Refunds and payments
- Status on the card
- The details sheet
- Wiring it up
- Run it
- Testing it
- What we have so far
Chapter 19: Reading a Receipt
- Why on the phone
- The
mob_ocrplugin - What OCR gives back
- Finding the total
- Finding the date and vendor
- Testing a parser
- Filling only what the person hasn’t touched
- Retake, remove, add later
- Run it
- Testing it
- What we have so far
Chapter 20: KRA Receipts
- What’s in a KRA QR code
- Scanning
- Fetching KRA’s record
- Verifying in the background
- KRA wins
- Run it
- Testing it
- What we have so far
Chapter 21: Refunds, Payment Requests and Attachments
- Turning an expense into a refund
- Payment requests
- Attachments
- Editing after sending
- Personal books
- Run it
- Testing it
- What we have so far
Chapter 22: Writing a Native Plugin
- Anatomy of a Mob plugin
- The Elixir side
- The Zig NIF
- The Kotlin bridge
- Back to Elixir
- Wiring it into the build
- Run it
- Testing it
- What we have so far
Chapter 23: A PDF on the Phone
- What the report holds
- Writing a PDF in Elixir
- The report
- Doing it off the screen
- Opening it
- Run it
- Testing it
- What we have so far
- The end of Part II
Chapter 24: Starting the Server
- Why Ash
- A new project
- Teams as tenants
- The domains
- Migrations, twice
- Run it
- Testing tenants
- What we have so far
Chapter 25: Accounts
- Who signs in, and how
- Signing in with a phone
- Signing in with Google
- Signing up
- Personal books and business teams
- User roles
- The API for signing in
- Run it
- Tests
- What we have so far
Chapter 26: Transactions and Approvals
- The resource
- Actions
- Changes
- Validations
- Policies
- An audit trail
- Moving old data
- Run it
- Tests
- What we have so far
Chapter 27: The Mobile API
- The shape of the API
- Errors the phone can act on
- Transactions
- Approvals and
/api/me - Run it
- Tests
- What we have so far
Chapter 28: Work in the Background
- Why a job queue
- Installing Oban
- The SMS worker
- Push notifications
- Every night
- Run it
- Tests
- What we have so far
Chapter 29: The Web Side
- Signing in on the web
- Approvals
- Transactions
- Reading uploads on the server
- Exports for accountants
- Run it
- Tests
- What we have so far
Chapter 30: Signing In from the Phone
- The profile
- Talking to the server
- Running network calls off the screen
- The sign-in screen
- Tests
- Run it
- What we have so far
Chapter 31: Two-Way Sync
- One run, four steps
- What the phone remembers
- The API calls
RisitiApp.Sync- Idempotency
- Photos and attachments
- One run at a time
- When to sync
- Tests
- Run it
- What we have so far