How to Build Apps

Building an app with AI? Write the design doc first.

In INARY, you can have AI build an app and run it right there. But if all you say is “Build me an app for X,” the AI decides everything you left open on its own, and you end up with an app that isn’t what you had in mind. Decide why you’re building it in a plan, write down what to build and how in a design doc, then hand it to the AI to build. That’s the basics of AI coding.

From idea to app

  1. Write a planDecide what the app is for.
  2. Write a design docDecide what to build and how.
  3. Hand it overAttach the design doc to a conversation and send “@INARY Build this to the design doc.”
  4. Check itRun it the way your design doc says to check it.

Something to change? Fix the design doc, then rebuild.

What goes in the plan

The plan decides why the app should exist. You can write it in a thread with your team, asking AI to look things up as you go. Everyone can read the research and the decisions right there.

  • Who will use it
  • How the work is done today, and what’s painful about it
  • What changes once the app exists
  • What you won’t build

What goes in the design doc

The design doc is the set of instructions you hand to the AI. The AI builds exactly what’s written, and decides anything that isn’t written on its own. Write down everything you want decided.

  • ScreensWhat screens there are, what people enter, and what they see.
  • DataWhat to keep. If something needs to be kept, say it goes in a database. PostgreSQL is available.
  • Who can do whatWho can only view, who can make changes, and what only admins can do.
  • How it opensInside INARY or in the browser (next section).
  • Language and framework(the section after that).
  • Connections to other servicesWhat it connects to. Keep API keys and similar values out of both the design doc and the conversation. Put them in “Environment variables” in the app’s folder in Storage. Any member of your organization can get the values stored there.
  • What the AI should do with itIf you want AI to read or operate what’s in the app, write what it should read and what it should do. Later, you can just ask in a conversation, and the AI answers using the app.
  • Out of scopeFeatures you won’t build, and things that must not change.
  • How to check itWhat “done” looks like. Write it as pairs: “Enter this, and you see that.”

Choosing how it opens

  • Inside INARYOnly members of your organization can open it. You don’t need to build sign-in: the app gets who’s opening it from INARY. A good fit for apps your team uses together.
  • In the browserPeople use it directly in a browser, without opening INARY. Because it can be reached from anywhere, the app itself needs sign-in that lets in only your organization’s members, and a way to turn away bots (write both into the design doc).

If your design doc doesn’t say, the AI asks before it builds.

Choosing a framework

  • If you don’t name one, the AI chooses.
  • If someone will read and fix the code later, name a language and framework that person can read.
  • Every app gets the same memory and processing power, and it can’t be increased. Lightweight choices fit best.
  • If the app keeps data, the database is PostgreSQL.

Keep each document focused

There’s a limit to how much AI can read at once. With a document that’s too long, it may read only the beginning and start working. Give each plan and design doc one topic, and when one grows long, split it where the topic changes.

Build it, then check it

Once the design doc is ready, attach it to a conversation and send “@INARY Build this to the design doc.” When the app is ready, the AI actually runs it, then reports back in the same conversation, separating what it could verify from what it couldn’t. Then run it yourself the way your design doc says to check it. If the app couldn’t be built, the AI tells you why and what to ask for next.

Making changes

When you find something to change, don’t keep piling ideas into the conversation. Fix the design doc first. Once the design doc and the app drift apart, the next time you change it, no one can tell which one is right.

Your app’s files are in the “Apps” folder in Storage. Keep the design doc in the app’s folder too, and you can ask “@INARY Read the design doc and update what changed.”

After it’s built

Any member of your organization can view and replace the app’s files. Change a file, and the app is rebuilt and the update goes live as is. If a rebuild fails, the previous version keeps running.

If you’d rather build and test on your own machine before it goes live, you can use GitHub.