Skip to main content

Platforms

A platform is one selectable target in mars create. This page describes what each one contains and how the generated project keeps track of them.

The platform matrix​

PlatformDirectoryTech stackSelected by defaultToolchain it requiresMaturity
APIapps/apiJeecgBoot / Spring BootyesDocker, JDK, MavenReady
Web Adminapps/web-adminVue 3 + Viteyes—Ready
Desktopapps/desktopTauri + React + RustnoRustReady
Webapps/webTBDno—Scaffold only
Androidapps/androidKotlin + Jetpack ComposenoJDK, Android CLI + SDKReady
iOSapps/iosSwift + SwiftUIno—Scaffold only
Windowsapps/windowsTBDno—Scaffold only
Linuxapps/linuxTBDno—Scaffold only
macOSapps/macosTBDno—Scaffold only

"Ready" means the platform builds and runs out of the box. "Scaffold only" means the directory and conventions exist but the application code is still a placeholder — useful if you want the structure reserved, not much use yet if you want something running today.

The toolchain column is what turns a tick into work on your machine: mars init takes the union of these cells across your enabled platforms and installs whatever is missing. A — means the platform adds nothing beyond the Node and pnpm you already have — either because it builds with those base tools (web, web-admin), or because it builds with an OS toolchain no version manager can install (ios needs Xcode, windows MSVC, linux gcc), which is left to you.

This documentation site is deliberately absent from the table. It lives in docs/, describes the project rather than being one of its shippable targets, and is therefore not a platform — see Conventions.

platforms.json​

platforms.json at the project root is the registry every tool reads. mars dev, mars build, mars clean and scripts/init.js all derive their platform list from it, so no path is hard-coded anywhere. mars init goes one step further and derives the toolchain it installs from the same file, which is why it stays correct after you edit the file by hand.

{
"platforms": {
"mobile": { "android": { "enabled": false, "dir": "apps/android", ... } },
"desktop": { "desktop": { "enabled": true, "default": false, "dir": "apps/desktop", ... } },
"web": { "web-admin": { "enabled": true, "dir": "apps/web-admin", ... } },
"api": { "api": { "enabled": true, "dir": "apps/api", ... } }
},
// Documentation is not a platform, so it sits outside "platforms"
"docs": {
"site_dir": "docs",
"site_content_dir": "docs/content",
"internal_dir": ".docs"
}
}

mars create writes this file for you — the platforms you ticked get "enabled": true, the rest false.

Only entries inside platforms are platforms. Everything the tooling iterates over reads that object and nothing else, which is why the documentation site is never started, built or scaffolded by those commands.

Each platform entry carries:

FieldMeaning
enabledwhether mars dev / mars build touch the platform, whether mars init installs its toolchain, and whether mars create lets you select it
defaultoptional; whether mars create starts with the platform ticked. Falls back to enabled when absent. desktop sets it to false so it is available but not part of the default project
dirplatform directory, relative to the project root
tech_stackhuman-readable stack description
descriptionshort summary shown by the tooling
statusoptional; developing marks a placeholder platform

enabled is therefore a statement about your machine as well as about the build. Turning it on adds a platform to the set mars init probes, so the next mars init will try to install that platform's toolchain; turning it off removes it from the set, and an already-installed tool is simply left alone rather than uninstalled.

Enabling a platform after creation​

If you skipped a platform during mars create and want it later, the directory was never copied — so flipping enabled alone is not enough. Two options:

  1. Generate a throwaway project that includes the platform and copy the apps/<platform> directory across, then set enabled to true.
  2. Create the platform yourself following the steps below.

Either way, run mars init afterwards. Flipping enabled widens the set it derives, so this is the run that installs the toolchain the new platform needs — enabling desktop, for instance, is what makes Rust appear.

Adding a new platform​

  1. Add the entry to platforms.json under the right category.
  2. Create the directory under apps/.
  3. Add an AGENTS.md inside it with the platform-specific rules.
  4. Update the platform table in the root AGENTS.md.
  5. Add the new target to the matrix on this page and to the platform strip on the landing page (docs/src/pages/index.tsx). Start it as "Scaffold only" with ready: false; the day the app builds and runs out of the box, change both to Ready / ready: true in the same change.

Per-platform rules​

Every platform directory carries its own AGENTS.md describing its build commands, coding standards and gotchas. Read it before touching that platform — these files are also what AI coding agents load as context.