Skip to main content
Mocha is “full‑stack”, which means you can build useful software, not just pretty mockups. Beyond the visual pages, Mocha can run logic for you in the background—things like saving form submissions, talking to other services (APIs), and powering features your business needs.
Backend code runs in a scalable serverless runtime. It can handle a lot of traffic and scale up and down as needed.

Quick start

1

Describe what you want

Say what you need in plain English. For example: “I want users to be able to subscribe to my app by giving their email address.” The AI will create the necessary backend logic.
Don’t give Mocha technical details like “use postgresql”. This won’t work well, Mocha is highly opinionated on how to build things technically, and you should describe your desired outcomes for the product, instead of the technical details.
2

Try it out

Use the in‑app preview to test the feature. You can see results and logs right away, then deploy when you’re ready.
3

That's it!

That’s it! Congratulations on building a full-stack feature that uses your own backend code.

Managing secrets

Some features require private keys to talk to other services (often called “APIs”). These private keys are called secrets.
Managing your secrets in the project settings

Manage your secrets in the project settings

A secret is a private value your app uses to connect to another service. It might be an API key, access token, or signing key.
  • Weather API key (for example, an OpenWeather key) to show today’s forecast in your app
  • OpenAI API key to generate images or summaries for your content
If your feature needs a secret, the AI will prompt you to add one and will wire it up correctly. You just provide the key once.
Usually, Mocha will ask you to add a secret to your project as part of the conversation, and will even show you how to get the secret from the provider, just follow the prompts.
Avoid pasting the secrets directly into the chat input. Instead, paste them into the secure forms that appear in the chat inyour pages or commit history. Store them as secrets instead.
Adding a secret through the chat interface

Adding a secret through the chat interface

Common patterns

Want weather data, maps, email, or payments? Save your API key as a secret and ask the AI to connect the service. Example: “Show today’s weather in San Francisco using my OpenWeather key.”
Add forms to your pages to collect emails, feedback, or orders. The AI saves submissions and can store them in your database.
Some services can notify your app when something happens (often called webhooks). Ask the AI to set this up and it will handle the details.
I