Create Your First Project
This content is for v1.1.1. Switch to the latest version for up-to-date documentation.
Generate a new mobile project by running zkite new followed by your desired project name.
# Create a new directory and scaffold projectzkite new myappcd myapp
# Or scaffold inside an existing empty directoryzkite new myapp .Project names may contain letters, digits, underscores, and hyphens, but cannot start with a digit. zkite new refuses to overwrite existing scaffold files.
Project Structure (1.1.1 & 1.1.0)
Section titled “Project Structure (1.1.1 & 1.1.0)”myapp/├── main.py # Application entry point containing top-level view()├── app.json # App identity, version, backend, and Android settings├── assets/ # Recursively packaged app resources (images, fonts, JSON)├── zkite.tailwind.json # Styling and editor class configuration└── .gitignore # Excludes build output, caches, and development keysProject Files Overview
Section titled “Project Files Overview”| File / Directory | Purpose | Handling |
|---|---|---|
main.py |
Application entry module containing the top-level view. |
Edit and commit. |
app.json |
App identity, version, backend, and Android configuration. | Edit and commit. |
requirements.txt |
Dependency declarations for pip (or pyproject.toml for uv). Live-reloaded in 1.1.1. |
Edit and commit as needed. |
assets/ |
Recursively packaged app resources; created by scaffold. | Commit intended app assets. |
zkite.tailwind.json |
Styling/editor utility class configuration. | Keep with project. |
.gitignore |
Excludes generated outputs, local virtual environments, and keys. | Commit. |
.zkite/ |
Local development state, dependency cache (.zkite/dev-dependencies), and debug signing key (debug.pem). |
Keep locally; do not commit. |
dist/ |
Built release artifacts (.apk and .aab). |
Build output. |
Top-level .py files |
Helper application modules beside main.py. |
Edit and commit. |
| Top-level images | Top-level PNG/JPG/JPEG files packaged beside main.py. |
Commit. |
1. main.py (Application Code)
Section titled “1. main.py (Application Code)”The entry module provides a top-level function named view. It returns the widget tree describing the current interface:
from zkite import store, Column, Text, Button, SystemBars
# 1. Observable application state@storeclass CounterStore: count: int = 0
state = CounterStore()
def increment(): state.update(count=state.count + 1)
# 2. Top-level view entry discovered by the frameworkdef view(): return SystemBars( Column( "flex-1 justify-center items-center p-6 bg-slate-950 gap-4", Text("text-3xl font-extrabold text-white", "Hello, ZKite!"), Text("text-lg text-emerald-400 font-medium", f"Taps: {state.count}"), Button( "px-6 py-3 bg-emerald-500 rounded-xl font-bold text-white", Text("text-white text-base", "Tap Me"), on_tap=increment, ), ), status_color="#020617", navigation_color="#020617", status_icons="light", navigation_icons="light", )2. app.json (Configuration)
Section titled “2. app.json (Configuration)”All application settings in ZKite 1.1.1 come from app.json:
{ "name": "myapp", "version": "0.1.0", "backend": "native", "android": { "package": "com.yourcompany.myapp", "label": "My App", "version_code": 1, "permissions": ["INTERNET"], "icon": "assets/icon.png" }}3. Packaging Boundary & Assets
Section titled “3. Packaging Boundary & Assets”assets/Directory: The entireassets/directory is packaged recursively. You can place icons, illustrations, and images in nested folders likeassets/images/logo.pngand reference them directly inImagewidgets.- Symbolic Links: Symbolic links inside
assets/are rejected. - Top-level files: Helper
.pyfiles and root image assets besidemain.pyare also staged. - Never commit keys: Never place private signing keys, API secrets, or server credentials in
assets/.
