Appsudo Framework LLM Reference Source: https://docs.appsudo.com/ Self-contained aggregate reference based on `https://docs.appsudo.com/`. Verified against the Appsudo documentation in this repository on 2026-10-07. How To Use This File - Use the section index below to jump to the part you want. - Each major docs section is included inline below so this file can be used on its own. - The final verification section summarizes what was checked against the documentation in this repository. Section Index - `introduction` - `setup` - `developer-account` - `app-structure` - `app-conventions` - `app-lifecycle` - `components` - `custom-components` - `using-llms-for-development` - `pygame-to-mini-game` - `canvas3d` - `engine3d` - `html-mini-app` - `examples` - `css-framework` - `core-features` - `verification` ===== SECTION: introduction ===== Introduction Source section: `https://docs.appsudo.com/#introduction` What Appsudo is - Appsudo is a lightweight cross-platform framework for building mini apps. - Logic is written in Python. - UI is described in ASXML, an XML-like view language. - Styling is applied inline or through ASCSS files. Core mental model - An app is a Python class that subclasses `App`. - The docs use `ViewInflater` to inflate views from files in `view/`. - The docs recommend a `self.data` object for UI state in Appsudo UI apps. - ASXML binds to that state with expressions like `{data.title}`. - Components are a mix of containers, form inputs, media surfaces, and control primitives. What the docs emphasize - Write-once, cross-platform UI composition. - Declarative layout plus imperative Python callbacks. - A relatively rich built-in component catalog. - Special support for three app shapes: normal ASXML apps, reusable custom components, and game/HTML mini apps. Practical references surfaced elsewhere in the docs - `App` is the base class for apps. - `ViewInflater` is used in the examples and structure walkthrough to inflate ASXML views. - `self.data` plus `{data.field}` bindings are the recommended pattern for UI apps. Detailed Coverage Map - The entries below were derived from the section structure in `appsudo.com/doc`. ===== SECTION: setup ===== Development Environment Setup Source section: `https://docs.appsudo.com/#setup` Docs-recommended environment - Use Visual Studio Code. - Install Android Studio or equivalent Android SDK/emulator tooling. - Ensure `adb` and emulator tools are available on `PATH`. - Install the VS Code extension `Appsudo App Runner`. How apps are run during development - Open the Appsudo project in VS Code. - Open the command palette. - Run `Appsudo App Runner`. - Select the target device or emulator. Code Snippets From Docs - The blocks below were extracted from the corresponding section of `appsudo.com/doc`. Snippet 1 ``` ANDROID_SDK_ROOT=C:\Users\YourUsername\AppData\Local\Android\Sdk PATH=%PATH%;%ANDROID_SDK_ROOT%\platform-tools;%ANDROID_SDK_ROOT%\emulator ``` Snippet 2 ``` adb --version emulator -help ``` Snippet 3 ``` export ANDROID_SDK_ROOT=$HOME/Library/Android/sdk export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator ``` Snippet 4 ``` source ~/.zshrc # or source ~/.bash_profile ``` Snippet 5 ``` adb --version emulator -help ``` Snippet 6 ``` sudo apt update && sudo apt install adb android-emulator ``` Snippet 7 ``` export ANDROID_SDK_ROOT=$HOME/Android/Sdk export PATH=$PATH:$ANDROID_SDK_ROOT/platform-tools:$ANDROID_SDK_ROOT/emulator ``` Snippet 8 ``` source ~/.bashrc ``` Snippet 9 ``` adb --version emulator -help ``` Detailed Coverage Map - The entries below were derived from the section structure in `appsudo.com/doc`. Related Workflow - Developer Account and Publishing: `/doc/llm-doc/developer-account/llms.txt` ===== SECTION: developer-account ===== Developer Account and Publishing Source section: `https://docs.appsudo.com/#developer-account` Overview - A developer account and Publish API Key are required to publish an app or component. - Finish development and testing before starting the publishing workflow. Publish from VS Code 1. Open the completed project in VS Code. 2. Open the Command Palette with `Ctrl+Shift+P`, or `Cmd+Shift+P`. 3. Type `Appsudo`. 4. Choose `Appsudo App Publish` for an app. 5. Choose `Appsudo Component Publish` for a component. 6. When prompted, enter the Publish API Key. Component publishing - Published components do not go through an approval process. - Components are reusable building blocks for apps. - Published components appear in the Components area of `https://store.appsudo.com`. - Apps that use published components still require approval before becoming available in the store. Screenshot: `/doc/assets/developer-account-command-palette.png` Screenshot: `/doc/assets/developer-account-key-prompt.png` Register and Generate a Publish API Key 1. Register or sign in at `https://developer.appsudo.com`. 2. Open Organization Settings, then API Key: `https://developer.appsudo.com/#org/organization-settings/api-key`. 3. Generate a Publish API Key. If an existing key must be replaced, use Regenerate Key. 4. Return to VS Code, enter the key, and wait for the successful publication confirmation. Security - Treat the Publish API Key as a credential. - Do not place it in project files, screenshots, or source control. Screenshot: `/doc/assets/developer-account-api-key.png` Find and Manage the Published App 1. After VS Code confirms that publication succeeded, open the organization dashboard: `https://developer.appsudo.com/#org/dashboard`. 2. Find the app in Your Applications. 3. Select Manage. Screenshot: `/doc/assets/developer-account-dashboard.png` Complete Store Presence - Open Store presence from the managed app. - Complete every required listing detail, including screenshots, the description, and any other information that was not supplied or was incomplete in `metadata.json`. - A release cannot be submitted until the required store presence details are complete. Create a Release and Send It for Review 1. Open Releases for the managed app. 2. Create a new release. 3. Select the correct published binary. 4. Choose Send to Review. 5. The release receives a light review. 6. After approval, the release becomes visible at `https://store.appsudo.com`. App-specific communication and review information appears in the app's Inbox and Policy status areas. Screenshot: `/doc/assets/developer-account-releases.png` ===== SECTION: app-structure ===== Appsudo App Structure Source section: `https://docs.appsudo.com/#app-structure` Canonical project layout ```text myapp/ ├── myapp.py ├── data/ │ └── config.json ├── view/ │ └── main_view.asxml ├── style/ │ └── styles.ascss ├── res/ │ ├── images/ │ └── icons/ ├── metadata.json └── secrets.json ``` Meaning of each part - `myapp.py`: main application entry point. - `data/`: JSON files for app data/configuration. - `view/`: ASXML layouts inflated into live view trees. - `style/`: ASCSS style definitions referenced from ASXML. - `res/`: static assets like images and icons. - `metadata.json`: app metadata such as icon, type, tags, keywords, featured media, scope, display name, version, and author. - `secrets.json`: secret values for runtime use. Store presentation and discovery fields - `featuredMedia`: an image or video path used to present the app in the Store. Use representative media with a 16:9 aspect ratio and a recommended resolution of 1920x1080 so the app looks its best to Store users. - `keywords`: a single comma-delimited string of relevant search terms that help users find the app in the Store and across Appsudo. Do not use a JSON array. Example `metadata.json` ```json { "icon": "res/icons/app_icon.png", "type": "App", "tags": "Utility, Example", "keywords": "utility, example, demo, mini app", "scope": "user", "displayName": "My Awesome App", "version": "1.0.0", "description": "A brief description of what my awesome app does.", "author": "Your Name/Company", "featuredMedia": "res/images/featured.png" } ``` Common file behaviors from the docs - `ViewInflater(self).inflate("view_name", data)` loads `view/view_name.asxml`. - The examples use relative resource paths such as `res/images/...` and `res/icons/...`. Detailed Coverage Map - The entries below were derived from the section structure in `appsudo.com/doc`. ===== SECTION: app-conventions ===== General Guidance And Naming Conventions Source section: `https://docs.appsudo.com/#app-conventions` Hard rules - App folder names must be lowercase. - Folder names must not contain spaces, hyphens, or special characters. - The main class must subclass `App`. - The main class name should follow `App`, for example `SportGameApp`. - The `App` constructor identifier should be a single runtime name string with no extra wording. Constructor pattern ```python def __init__(self, application_path): super().__init__("SportGame", application_path) ``` Render rule - `self.render(...)` may be called only once per app. - That single call must happen in `run()` or in a helper that `run()` invokes. - Extra render calls are documented as runtime errors that crash the app. Recommended state pattern - For non-pygame UI apps, create `self.data` in `__init__`. - Bind ASXML against that object with `{data.field}`. - Keep UI declarative and state centralized on the data object. Code Snippets From Docs - The blocks below were extracted from the corresponding section of `appsudo.com/doc`. Snippet 1 ``` class SportGameApp(App): ... ``` Snippet 2 ``` def __init__(self, application_path): super().__init__("SportGame", application_path) ``` Snippet 3 ``` def run(self): self._show_main_view() def _show_main_view(self): # Allowed: render() lives in a helper, but it is only reached via run(). self.render(self.ui_view) ``` Snippet 4 ``` def __init__(self, application_path): super().__init__("SportGame", application_path) self.data = SportGameData(application_path) ``` Detailed Coverage Map - The entries below were derived from the section structure in `appsudo.com/doc`. Categories - Folder name - App class name - Constructor identifier - One render per app - Data binding (recommended) ===== SECTION: app-lifecycle ===== App Lifecycle Source section: `https://docs.appsudo.com/#app-lifecycle` Lifecycle hooks (`#app-lifecycle-hooks`) Hook order 1. `on_launch` 2. `set_data(metadata)` 3. `run` 4. `on_ready` 5. `on_app_mode_change(app_mode)` on each later mode change Hook meanings - `on_launch`: pre-render setup and preloading. - `set_data(metadata)`: receives runtime metadata before render, including URL input on web. - `run`: the place where the app renders itself. - `on_ready`: called after the app is fully ready. - `on_app_mode_change(app_mode)`: mode transition handler. Metadata described by the docs - `config` - decrypted secrets - `profileId` - `profileUserName` - `profileAvatar` - `appId` - `appName` - `appVersion` URL input in `set_data` (`#app-lifecycle-url-input`) - Purpose: let a web link carry string values into the app. - On web, values from the page query string and the query inside the hash are included in the metadata passed to `set_data(metadata)`. - On every other platform, URL input adds no metadata values. - `https://appsudo.com/#apps/myapp?code=12354&extra=hello` produces `{"code": "12354", "extra": "hello"}`. - At startup, each URL value is added to the metadata passed to `set_data(metadata)` only when that key does not already exist. - URL input never overwrites an existing metadata value. - The merged metadata is passed to `set_data(metadata)`, so the app can read `metadata.get("code")` during launch. - All values are URL-decoded strings. - Repeated keys keep the last value. - Treat URL values as untrusted input. Validate or filter keys before using them. - URL input uses the current location, including hash changes made without a page reload. Share-to-join flow 1. The host builds a link containing a code and passes it to `ShareableDialog.share_link(...)`. 2. The guest opens the shared web link. 3. The app starts and URL parameters are merged into its metadata. 4. `set_data(metadata)` reads the code and uses it to join. ```python from component.basic.ShareableDialog import ShareableDialog ShareableDialog.share_link( "https://appsudo.com/#apps/myapp?code=12354", title="Join my game", ) def set_data(self, metadata): self.join_code = metadata.get("code") ``` App modes (`#app-lifecycle-modes`) - `FULLSCREEN`: default. - `WIDGET`: small centered window. - `POPUP`: bottom dialog style view using most of the screen. - `MINIMIZE`: docked into a feed post. Mode-related rules - In `on_app_mode_change(app_mode)`, `app_mode` is the new mode. - `self.get_app_mode()` returns the previous mode. - `self.set_app_mode(mode)` can be used to change modes, except `MINIMIZE`. - Override `get_allowed_mode()` to limit supported modes. Two-way Binding (`#app-lifecycle-two-way-binding`) - Manual component updates can require assigning the same value in several places and calling methods such as `refresh()`. - Import `State` from `runtime` when one value or array needs to drive multiple components. - Create the initial `State` values in the app's data class or other class exposed through the existing inflater. - Bind a state in ASXML with expressions such as `{data.value}` and `{data.array}`. - A `State` can also be passed directly to the matching component method in Python. - Call `state.set(new_value)` to update every bound component and perform the required component refresh. - State binding keeps conditional update logic, repeated assignments, and manual refresh calls out of unrelated app code. Game Controller (`#app-lifecycle-game-controller`) - Gamepad selection applies when `metadata.json` sets `"type": "Game"`. - Override `get_gamepad()` on the `App` subclass to hide the controller or load a different controller component. - Without an override, or when `get_gamepad()` returns `"default"`, Appsudo loads the existing `sudogamepad` component. - Return `None` to completely hide the gamepad. - Return an existing component name to dynamically load that component for the game. - A custom return value must exactly match an existing component name. - Browse available component names in the Appsudo Store: `https://store.appsudo.com`. Screen Size (`#app-lifecycle-screen-size`) - Read the current display size with `AppContext.current().displaySize()`. - Use the result only for broad checks, such as determining whether the width is larger than the height for a rotated device or tablet-style layout. - Do not build complex application logic around exact dimensions. - The documentation does not prescribe width or height accessor syntax. Light/Dark Mode (`#app-lifecycle-display-mode`) - Read the current display mode from `AppRuntime.IS_DARK_MODE`. - Use it to choose theme-appropriate colors, assets, and presentation. Running Platform (`#app-lifecycle-platform`) - Detect web, Android, or iOS with the `AppRuntime` methods shown below. - Keep rendering and UI behavior platform agnostic. - Limit platform values to non-UI uses such as API request context or app-specific statistics. - Platform information is already available in the Appsudo developer portal, so most apps do not need to collect it themselves. Sharing & Data (`#app-lifecycle-sharing`) - Override `get_shareable()` to allow or block sharing to feed/DM. - Override `get_data()` to return serializable state for sharing/continuation. - Shared state is later delivered back through `set_data(metadata)`. Code Snippets From Docs - The blocks below were extracted from the corresponding section of `appsudo.com/doc`. Snippet 1 ``` def on_launch(self): # App not rendered yet. Initialize or preload data here. self.pending_user_id = None def set_data(self, metadata): # Pre-render. metadata includes config, decrypted secrets, # profileId, profileUserName, profileAvatar, appId, appName, appVersion. # Store at runtime to register users in an external DB, build a profile, etc. self.profile_id = metadata.get("profileId") self.profile_user_name = metadata.get("profileUserName") self.app_id = metadata.get("appId") self.join_code = metadata.get("code") def run(self): # Renders the app to the device (mobile and web). self.render() goes here. self.render(self.ui_view) def on_ready(self): # App is fully ready to perform actions. self._load_initial_state() def on_app_mode_change(self, app_mode): # app_mode = the NEW mode the app is transitioning to. # self.get_app_mode() = the PREVIOUS mode, prior to this change. # Use both to decide how to transition the visualization. self._transition(from_mode=self.get_app_mode(), to_mode=app_mode) ``` Snippet 2 ``` def on_app_mode_change(self, app_mode): # app_mode = NEW mode transitioning to # self.get_app_mode() = PREVIOUS mode, prior to this change if app_mode == "WIDGET": self._render_compact(from_mode=self.get_app_mode()) elif app_mode == "POPUP": self._render_sheet(from_mode=self.get_app_mode()) elif app_mode == "MINIMIZE": self._render_docked(from_mode=self.get_app_mode()) ``` Snippet 3 ``` def get_allowed_mode(self): return ["FULLSCREEN", "WIDGET", "POPUP"] ``` Snippet 4 ``` # Single value value = "newvalue" self.text = f"{value} - something" self.text2 = value # Array self.repeat_view.set_items(newarray) self.repeat_view.refresh() ``` Snippet 5 ``` from runtime import State # Initial state self.value = State("initial value") self.array = State([1, 2, 3]) ``` Snippet 6 ```