← All writing

Blog 02 · Getting started

Your first AI app, built on a phone.

AI development is no longer reserved for engineers with expensive machines. This is the walkthrough I wish existed for doctors with zero coding background — build a working voice-transcription app on an Android phone using Termux, Node.js, an AI coding assistant and OpenAI Whisper. Every command and every bit of jargon is explained as we go.

Every doctor I talk to about AI eventually asks the same thing: "but where do I actually start?" The honest answer is smaller than people expect. You do not need a laptop, a course, or a computer science degree. You need the Android phone already in your pocket and about an hour of patience.

By the end you will have a real application: a webpage where you upload a recorded consultation and get back a text transcript, powered by OpenAI's Whisper model. That is genuinely useful on its own — but the real prize is the workflow underneath it. You will have learned how to describe what you want in plain English, let an AI coding assistant generate the software, and stay in control of the design. This isn't using AI. It's building with it.

A promise before we start: nothing below assumes you already know what a "server", an "API" or an "environment variable" is. Each one is explained the first time it appears. If a term looks intimidating, keep reading — it almost always turns out to be simpler than its name.

01 · Why doctors

Why learn to build, not just to use?

Healthcare and AI are becoming inseparable. Most doctors will end up using AI tools someone else built. A smaller number will learn to build them — and that second group gets to shape tools around how medicine actually works, rather than waiting for a software company to guess. With a bit of AI assistance, a single clinician can now prototype ideas that used to need a development team.

Concretely, doctors are already using this skill to:

  • Speed up documentation

    Turn dictated consultations into written notes, letters and summaries automatically.

  • Automate the admin

    Take the repetitive, low-value paperwork off the day so more time goes to patients.

  • Build patient-facing tools

    Custom calculators, patient-education leaflets, and simple decision aids tailored to a clinic.

  • Prototype research & teaching aids

    Research assistants, quiz generators and teaching apps, built and tested in an afternoon.

The transcription app in this post is the smallest possible first step, but it is a real one — everything else is a variation on the same foundation.

02 · The setup

Turning your phone into a workstation.

First, some vocabulary. A terminal is a text-only way of giving a computer instructions — you type a command, press enter, and it runs. Termux is an app that gives your Android phone a full Linux terminal. Instead of needing a Windows, Mac or Linux computer, it turns the phone itself into a miniature development workstation. Install Termux from its official source, open it, and you'll see a prompt waiting for commands.

We'll run five commands, in order. Type each one, press enter, and wait for it to finish before moving to the next. Here is what each does and why:

  • 1 · Update the system

    pkg update && pkg upgrade -y

    This is really two commands joined by && (which means "then do the next one"). pkg update refreshes Termux's list of available software — like refreshing an app store so it knows what's newest. pkg upgrade then installs those newer versions of everything already on the phone. The -y flag automatically answers "yes" to every prompt, so it runs without stopping to ask. Doing this first prevents most install problems later.

  • 2 · Install Node.js

    pkg install nodejs-lts -y

    Node.js is the engine that runs our app. Normally the JavaScript programming language only runs inside a web browser; Node.js lets it run directly on your phone, so it can create servers, read and write files, talk to other services over the internet, and process data. Nearly every modern AI project has a Node.js version. We install the LTS build — "Long Term Support" — because it's the stable, well-tested, long-supported version that's least likely to break your projects.

  • 3 · Install the AI coding assistant

    npm install -g @mmmbuto/codex-cli-termux@latest

    Breaking this down word by word: npm is the "Node Package Manager", the tool that downloads reusable pieces of software from the internet. install tells it to install something. -g means "global" — install it everywhere in Termux, not just inside one folder. @mmmbuto/codex-cli-termux is the name of the package: an AI-powered coding assistant adapted to run in Termux. @latest asks for the newest version. In short: this installs an AI software engineer that lives inside your terminal.

  • 4 · Verify it installed

    codex --version

    This checks the assistant installed correctly by asking it to print its version number. If you see something like 0.20.3, everything is working. If you get an error instead, the previous step didn't finish — run it again.

  • 5 · Log in

    codex login

    This connects the assistant to your account so it's allowed to generate code. Think of it as logging in to the AI software engineer that lives in your terminal. Follow the on-screen authentication steps once, and you won't need to repeat it each time.

That's the whole environment. Everything from here on happens by talking to the assistant.

03 · The one prompt

One paragraph, a whole application.

Here's the part that still feels like magic. Instead of writing hundreds of lines of code by hand, you describe the app you want in plain English, and the assistant builds it. Paste this into Codex exactly as written:

Create a nodejs script that transcript audio files. Ensure it works with OpenAI whisper transcription to convert voice to text. Make sure it breaks audio files into chunks that will be easier to upload and transcribe. Create a frontend that will work with this script. When you finish, explain how I can run the script and the URL I can access the backend from the frontend. Create an instruction markdown explaining all the details of this project in this directory.

It reads like a casual note, but it's actually seven separate software-engineering instructions stacked together. Understanding what each one asks for is most of the learning — so let's unpack them one at a time.

  • 1 · "Create a Node.js script"

    This asks for the backend — the part of the app that runs behind the scenes on the phone. Its job is to receive uploaded files, process requests, talk to OpenAI, and send results back. Users never see it directly.

  • 2 · "Transcribe audio files"

    The app should accept common recording formats — MP3, WAV, M4A, AAC — and turn the spoken words in them into written text.

  • 3 · "Use OpenAI Whisper"

    Rather than trying to recognise speech itself, the app hands the audio to OpenAI's Whisper model. Whisper was trained on thousands of hours of speech in many languages, so it produces very accurate transcripts — far better than anything we could build alone.

  • 4 · "Break audio into chunks"

    Long recordings often exceed the size a service will accept in one go. So the app should automatically split a recording into smaller sections, send each one, transcribe them all, and then join the pieces back into a single transcript. This is what lets it handle a long consultation, not just a 30-second clip.

  • 5 · "Build a frontend"

    The frontend is the webpage the user actually sees and clicks. Nobody should need to touch the terminal to use the app, so the assistant builds a simple page where you choose an audio file, upload it, watch the progress, and read the finished transcript.

  • 6 · "Explain how to run it"

    We ask the assistant to tell us, in plain terms, how to install the app, what it needs, how to start it, and which web address to open. This turns a pile of files into something you can actually run.

  • 7 · "Create documentation"

    Professional software always ships with a written guide. We ask for a Markdown (.md) file — a simple formatted text document — covering the project overview, installation, configuration and troubleshooting, so the project is easy to come back to and share.

04 · What you built

Two halves: a backend and a frontend.

When the assistant finishes, it will have created a folder of files. Yours may differ slightly, but it usually looks something like this:

transcription-project/
├── server.js        ← the backend
├── package.json   ← the project's list of dependencies
├── .env            ← your secret API key lives here
├── README.md      ← the instructions
├── uploads/       ← temporary audio files
└── public/        ← the frontend
    ├── index.html
    ├── style.css
    └── script.js

Conceptually, every app like this has two halves that talk to each other:

  • The backend

    Runs behind the scenes. It receives your uploaded recording, splits the audio into chunks, sends each chunk to OpenAI, collects the transcribed pieces, joins them into one transcript, and returns the final text. This is server.js.

  • The frontend

    The webpage you interact with. It lets you pick an audio file, uploads it to the backend, shows a progress indicator while it works, and displays the transcript when it's ready. This is everything in the public/ folder.

The two communicate over the internet using ordinary web requests — the same mechanism your browser uses every time you load a page. You've just built both ends of that conversation.

05 · Running it

From generated code to a live web page.

The code exists, but it won't run until we do four things: install its building blocks, give it your API key, start it, and open it. We'll go slowly.

  1. 1 · Install the dependencies

    A modern app is built on top of many small pre-written libraries. The package.json file lists which ones this project needs. Inside the project folder, run npm install. It downloads every listed library into a folder called node_modules. The first time can take a few minutes depending on your connection; you only repeat it if new dependencies are added later.

  2. 2 · Set up the environment file

    Apps keep sensitive information — like passwords and API keys — out of the code itself, in a special file called .env (short for "environment"). If the assistant didn't create one, make it with nano .env, which opens a simple text editor. Add exactly this line:

    OPENAI_API_KEY=your_openai_api_key_here

    Replace your_openai_api_key_here with your real key (next step). In Nano, save with CTRL + O then Enter, and exit with CTRL + X.

  3. 3 · Get your OpenAI API key

    An API key is a long secret password that lets your app prove who it is to OpenAI. Sign in to your OpenAI account, go to the API dashboard, and create a new secret key. Copy it immediately — you often can't view it again after leaving the page — and paste it into your .env file so the line looks like OPENAI_API_KEY=sk-proj-xxxxxxxx…. Keep this key private: anyone who has it can make requests that cost money on your account, so never share it or upload it to GitHub.

  4. 4 · Start the server

    Run npm start (or node server.js — if unsure, open package.json and look under "scripts" for the right one). You should see a message like Listening on port 3000 or Server running at http://localhost:3000. That means your backend is now awake and waiting for requests. Leave Termux open — the server lives only as long as that window stays open.

Opening the app. In your phone's web browser, go to http://localhost:3000. The word localhost simply means "this same device", so the browser connects to the server running in Termux beside it. If the server reported a different port (say 8080), use that number instead: http://localhost:8080. To reach the app from another device on your home network, you'd use the phone's local IP address (for example http://192.168.1.50:3000) and make sure the server listens on all interfaces — but for now, on the same phone, localhost is all you need.

Using it. On the page, tap Choose File, pick a recording, and tap Upload. The app splits the audio if needed, uploads each chunk to OpenAI, receives the text back, joins it together, and shows the finished transcript. How long it takes depends on the recording length and your connection.

Stopping and restarting. To stop the server, return to Termux and press CTRL + C — it shuts down immediately and frees the port. Whenever you change the code, stop it with CTRL + C and start it again with npm start so the new changes take effect.

06 · When it breaks

The four errors everyone hits first.

Something will go wrong on the first try. That's normal — it happens to everyone, including me. Here are the four most common messages and what they actually mean:

"Cannot find module"The libraries aren't installed. Run npm install inside the project folder and try again.
"OPENAI_API_KEY is missing"The app can't find your key. Check the .env file exists, the name is spelled exactly OPENAI_API_KEY, and there are no stray spaces or quotation marks.
"Port already in use"Another app is using that port. Stop it, or change the port number in the server's configuration.
"Invalid API Key"The key is wrong or disabled. Recheck you copied it fully, it hasn't been revoked, and your OpenAI account has API access.

None of these are as alarming as they look — each one points at a single, fixable thing. When in doubt, you can also paste the error straight into Codex and ask it to explain and fix the problem. Your daily rhythm quickly becomes: open Termux, go to the project folder, npm start, open the browser, test, and CTRL + C when you're done.

07 · Key vs subscription

"I already pay for ChatGPT — why do I need a key?"

This is the single most common question from new builders, so it's worth answering properly. The short version: a ChatGPT subscription and an OpenAI API key are two different products that happen to come from the same company.

  • ChatGPT is for people

    It's the chat website or app you type into. It's built for a human to ask questions, write, draft, analyse documents and brainstorm — all inside the ChatGPT interface. You cannot point your own app at your ChatGPT account and have it do work for your users.

  • The API is for software

    The API (Application Programming Interface) is built for programs. Your app sends requests directly to OpenAI's servers, with no person sitting at a keyboard, and gets answers back automatically. That's what lets your transcription app work on its own. Your app proves its identity with the API key — a secure password for software.

An analogy. Think of electricity. Your home has a domestic supply that powers the lights and the kettle — that's your ChatGPT subscription, a flat monthly fee for personal use. A factory doesn't run off the kitchen socket; it has a separate commercial connection, metered by how much it draws. That's the API. Which is exactly why they're billed differently: ChatGPT is a fixed monthly price for interactive use, while the API charges per request, based on the model, the size of the input and output, and — for Whisper — the length of the audio.

ChatGPTYou chat with the AI directly. Great for writing, learning, drafting, analysing — for you.
API keyYour software talks to the AI automatically, for your users. Required for any app that transcribes, summarises or generates on its own.
Use bothThe common workflow: ChatGPT to design and debug your ideas, then an API key to power the finished app.

A tidy way to remember it: if you're chatting with the AI, that's ChatGPT; if your app is chatting with the AI on behalf of someone else, that's the API. Most developers use both — ChatGPT to accelerate building, the API to bring the finished thing to life.

And that's the whole point of this little project: it's the foundation. The same shape — receive input, send it to OpenAI, return a useful result — scales up to summarising clinic letters, drafting referrals, generating patient information and more. That's exactly where the next ten projects take you, one small step at a time.