Exporting Code
Export turns your design into a real project for the platform the app is built for: Flutter, Expo (React Native) or the web (React). Each is a project a team would keep, with a clear line between the files Koolbase regenerates and the files that are yours.
Choosing the platform
An app is built for one platform at a time. Pick it under Build for, in the App section of the Designer's left panel. The design stays the same; Export, the checks and the components on offer follow the platform you pick.
What you own, what Koolbase owns
Every export has the same rule. A few folders are Koolbase's and are replaced whole on every export. Everything else — the entry point, the package file, the README, any screen or file you write yourself — is yours: Koolbase writes it once, with the first export, and never touches it again.
| Platform | Koolbase's (replaced on export) | Built with |
|---|---|---|
| Flutter | lib/generated/, test/generated/, lib/l10n/app_en.arb | Riverpod, go_router, ARB strings, koolbase_flutter |
| Expo | src/generated/, app/(koolbase)/ | Expo Router, React Native Paper, @koolbase/react-native |
| Web | src/generated/ | React, Vite, React Router, @koolbase/js |
In the Expo and web exports, each file also starts with a comment saying whose it is.
Re-exporting without losing your work
Use the CLI. It replaces Koolbase's folders transactionally, leaves yours untouched, and refuses if you edited a generated file by hand — so a change never disappears silently. It reads which folders are Koolbase's from the export itself, so the same command works for all three platforms.
koolbase export apply ~/Downloads/koolbase_export.zip --into ./my_appIf you need to change a generated screen, copy it out of Koolbase's folder, edit the copy, and route to it — the next export will not touch your copy.
Flutter
lib/
main.dart yours — three lines calling koolbaseMain()
generated/ Koolbase's — replaced on export
core/ runtime helpers, l10n, mutations, app_state
theme/ tokens from the Designer's theme
app/ app.dart, routes.dart
screens/ one file per screen (+ _state.dart when it has state)
l10n/ generated AppLocalizations
l10n/
app_en.arb Koolbase's — every string, keyed by node id
app_fr.arb yours — add locales beside it
test/generated/ one smoke test per screen
.koolbase/export.json what was generated, sha256 of each fileOne shape, so a developer inheriting an export learns it once. No codegen: the providers and routes are written out, and the project builds anywhere Flutter does.
- State — one Riverpod
Notifierper screen with state, oneAppStatefor values shared across screens; persisted values write through toshared_preferences; non-retained values reset on sign-out. - Mutations — every write, upload and function call runs through an
AsyncValuenotifier; pending isisLoading, failed ishasError, the error message maps throughuserMessageFor. - Routing — go_router with a typed class per screen:
ProductRoute(productId: id).push(context). - Forms — validated fields are
TextFormFields inside aForm: silent until first blur, live after, all revealed on submit. - Lists —
KoolbaseCollectionListowns fetching, cache and refresh; search filters what it has loaded.
Keys follow ids, not names
app_fr.arb still matches. Equal English at two sites stays two entries — "Save" on an invoice and "Save" on a draft may translate differently.flutter pub get
flutter gen-l10n
flutter analyze
flutter test
flutter run --dart-define=KOOLBASE_PUBLIC_KEY=pk_live_...To run a Flutter export in a browser, once: flutter create . --platforms web (Koolbase never writes platform folders), then flutter run -d chrome --web-port 8080 and add http://localhost:8080 to your project's Trusted Origins in the dashboard. Code push and offline sync are not available in a browser; everything else is.
Or just press Run
Expo
An Expo project on Expo Router: each screen is a route under app/(koolbase)/, and the components, theme, app state and Koolbase setup live in src/generated/. Your project's public key goes in .env; the export includes a .env.example to copy.
EXPO_PUBLIC_KOOLBASE_PUBLIC_KEY=pk_live_...npm install
npx expo startWhen you need a development build
npx expo run:ios or npx expo run:android.Web
A React app built with Vite, with a route per screen. Koolbase's files live in src/generated/; src/main.tsx, index.html and vite.config.ts are yours. Your project's public key goes in .env.
VITE_KOOLBASE_PUBLIC_KEY=pk_live_...npm install
npm run dev # develop
npm run build # a static site in dist/Add the address you develop on (Vite's is http://localhost:5173) and the address you host on to your project's Trusted Origins in the dashboard. dist/ is plain files you can host anywhere: answer every path that is not a file with index.html, so a link straight to a screen opens it.
Or let Koolbase host it
What the manifest says
Every export carries .koolbase/export.json: the platform, every generated file with its hash, which folders are Koolbase's, and the platform configuration you must add yourself — for example iOS usage strings when the app uses the camera or photo library, which Koolbase never writes.