Organizing Your Code
oikapi apps are directories with a standard structure. You develop locally, test against a live instance, and optionally publish to the marketplace.
App directory structure
Section titled “App directory structure”Every app follows the same layout:
my-app/├── oikapi.json # App metadata (name, version, dependencies)├── tables/ # Table definitions (JSON)│ └── *.json├── roles/ # Role definitions│ └── *.json├── permissions/ # Permission grants│ └── default.json├── rules/ # Business rules (optional)│ └── *.json├── workflows/ # Workflow definitions (optional)│ └── *.json└── demo-data/ # Sample data for demos (optional) └── *.jsonSingle app per repo
Section titled “Single app per repo”The simplest approach – one git repo contains one app:
my-app/ # Root of the git repo├── oikapi.json├── tables/├── roles/├── permissions/└── ...oi init my-appcd my-appgit initBest for: Independent apps, small teams, open-source contributions, apps you want to version and release separately.
Multiple apps in one repo
Section titled “Multiple apps in one repo”For related apps, use a monorepo with each app in its own subdirectory:
my-apps/ # Root of the git repo├── invoicing/│ ├── oikapi.json│ ├── tables/│ └── ...├── reporting/│ ├── oikapi.json│ ├── tables/│ └── ...└── README.mdThe CLI commands work the same – just point at the subdirectory:
oi dev invoicingoi push reportingoi build invoicingBest for: Related apps that share dependencies, larger teams, internal app suites where you want a unified workflow.
Development workflow
Section titled “Development workflow”- Create your app with
oi initor manually - Define tables as JSON files in
tables/ - Test live with
oi dev my-app– watches for changes and auto-syncs to your connected instance - Iterate – edit table definitions, add roles, write business rules
- Build with
oi build my-appto create a distributable.oikapppackage - Publish to the marketplace if you want to distribute it
# Full workflowoi init my-appcd my-app
# ... edit tables, roles, rules ...
oi dev my-app # Live sync while developingoi validate my-app # Check for errorsoi build my-app # Package as my-app-1.0.0.oikappSee App Development for the full CLI reference and Package Format for details on the .oikapp archive structure.
Installing your app
Section titled “Installing your app”Once built, install your package on any oikapi instance:
# From a local .oikapp fileoi app install ./my-app-1.0.0.oikapp
# Directly from a source directory (builds, then installs)oi app install ./my-appDemo data bundled with the package is managed separately after install — use oi app demo to
list or remove it.
Auto-prefixing
Section titled “Auto-prefixing”When an app is installed, all resource names are automatically prefixed with the app name to prevent conflicts between apps on the same instance:
| Source file | Installed as |
|---|---|
tables/projects.json | myapp_projects |
roles/manager.json | myapp_manager |
Reference to "tasks" | myapp_tasks |
Reference to "system.users" | system.users (preserved) |
You write clean, unprefixed names in your source files. The builder handles the rest.