Ninoo Builder
Python backends and data
When you need one
- Several people should see the same data, like bookings or a shared list.
- The app calls a paid API with a secret key that must not be in the web page.
- It fetches data from another site on a schedule or on request.
- It does calculations that are too heavy for a phone.
Just ask: “save the bookings on a server so everyone sees them”. Ninoo adds the backend only when the app needs one, so you never have to set it up yourself.
How it's set up
The backend is a FastAPI app in the api/ folder, written in Python 3.11. Every route lives under /api, and the web page calls it with a relative address like fetch("/api/bookings").
api/
main.py # app = FastAPI(); routes under /api, plus GET /api/health
requirements.txt # extra Python packages, one per line
data.db # SQLite file, if the app keeps data
.env # secrets, read with python-dotenvCommon packages are already installed: fastapi, uvicorn, pydantic, httpx, requests, python-dotenv, python-multipart, pandas, numpy, scipy, yfinance and sqlmodel. Ninoo adds anything else to requirements.txt.
Keeping data
Data that should survive a restart goes in a SQLite database file, api/data.db. In the workspace it's kept with the rest of your project.
On the published site, files can reset
The live backend runs on demand, and files it writes, SQLite included, are temporary for now. They can be wiped at any time. Don't rely on the published app to keep data you can't lose.Secret keys
Put API keys in the .env file at the top of the project, for example WEATHER_API_KEY=…. Ninoo reads them in Python. Never give a secret a VITE_ name: those are built into the web page, where anyone can read them.
- Viewers on a shared project can't open
.env. - When you publish, the
.envvalues become the live backend's settings. Names starting withVITE_orAWS_are left out, and the total is limited to 4 KB. - Push to GitHub never includes
.env. Download .zip does, so keep that file to yourself. See Export.
When you publish
Publish puts the backend online too, at your-app-1a2b.ninoo.app/api/…. Before the new version goes live, Ninoo checks /api/health. If it doesn't answer within 90 seconds, the previous version keeps running.
It runs on demand, so the first request after a quiet spell can take a few seconds.
| Limit | Value |
|---|---|
| Memory | 1 GB |
| Time per request | 30 seconds |
| Requests handled at once | 5 |
| Extra packages | Up to 250 MB |
| .env settings | Up to 4 KB in total |
What it costs
The published backend is paid by the project owner, from their credits.
| Each month | Price |
|---|---|
| Free | The first 100,000 requests and 20,000 GB-seconds of run time |
| Requests after that | $3 per million |
| Run time after that | $0.00002 per GB-second (one second at 1 GB of memory) |
A monthly cap protects you from surprises. It starts at $5, and the owner can raise it up to $500 under More → Backend.
| Status | What it means |
|---|---|
| Running | Your live site's /api calls are answered. |
| Paused: monthly cap reached | Raise the cap and it starts again within a few minutes. |
| Paused: owner out of credits | It starts again by itself a few minutes after a top-up. |
Building and testing the backend in the workspace costs nothing extra beyond normal workspace time.