# appshare Bootstrap lane instructions
Use this lane for most appshare mini apps.
Reference implementation: `examples/pending-incidents/` in the repository. It is the Bootstrap golden path and includes static frontend files, Project Functions, table schema, runtime policy, seed data, publish payload, and import job mapping.
## Stack
- HTML.
- CSS.
- Vanilla JavaScript.
- Bootstrap 5, themed by appshare.
- `/sdk/appshare.js`.
- `/sdk/appshare-ui.js`.
- `/sdk/appshare-icons.js` (icons, when the app needs any).
Do not use React, Preact, Alpine, Tailwind, shadcn, npm packages, bundlers, or build steps in this lane.
## When to use
Use this lane for:
- CRUD apps.
- Dashboards.
- Forms.
- Master-detail flows of moderate complexity.
- Detail modals.
- Tables, filters, tabs, alerts, toasts, and ordinary dropdowns.
- Product search by EAN or name when `as-combobox` is enough.
Escalate to the React lane only when the app has complex local state, nested views, rich editing, drag/drop, or many reusable interactive components.
## Required scripts
```html
```
Use the appshare-provided Bootstrap CSS URL when the deployment template exposes one. If the artifact must be fully standalone, inline or publish the approved Bootstrap 5 CSS with the app instead of adding a random CDN dependency.
## Appshare SDK
Create one client:
```js
const appshare = Appshare.create({
projectId: "prj_...",
environment: "dev"
});
```
Prefer server-side functions for business logic:
```js
const response = await appshare
.function("mis_incidencias_pendientes")
.invoke({ limit: 50 });
```
Use direct tables only for simple UI state or trusted project workflows:
```js
const rows = await appshare.table("incidents").list({ limit: 100 });
```
To seed or bulk-load many rows, use a `table_import` job (`jobs().create(...)` or `create_project_job`), never a loop of `create_table_row` — looping rewrites the whole project store per row. Pass the dataset inline as `source.content` (a JSON array or CSV, job payload limit 5MB) or from a storage object via `source.bucket`/`source.key` (object limit 10MB); `table_import` validates and writes the whole batch in one store write and one SQLite transaction (up to `APPSHARE_PROJECT_JOB_MAX_IMPORT_ROWS`, default 100000; see `/llms/tables.txt` for column aliases, number/date formats and who may import). To load several existing tables from one upload, use a `table_import_zip` job: upload a zip (with `put_storage_object`) holding a `manifest.json` (`tables` array of `file`/`table`/`mapping` entries) plus the data files, then point the job at it via `source.bucket`/`source.key`. Pass `wait: true` when creating an import job to run it inline and get the finished result in one call instead of polling `get_project_job`. To read an external API (e.g. HR), an admin sets up an org-level connector that holds the credential once and grants access per person/role; apps call it live with `appshare.connector(name).call(module)` (token stays server-side) or sync it into a table with a `table_import` job using `source.connector`/`source.module`.
## Reports and shared data queries
Read the topics `/llms/data-queries.txt` ("Data queries and report correctness")
and `/llms/quality.txt` ("Asynchronous app quality") before building or optimizing
a report. Discover existing saved
queries with `list_project_queries` / `get_project_query` before defining a new one.
For Madrid calendar or booking apps, also read `/llms/calendar.txt` and
`/llms/reservations.txt` before implementing date or
reservation behavior. To book Metrica meeting rooms in Outlook, read `/llms/rooms.txt`
("Microsoft 365 meeting rooms"): it is `ctx.rooms`, only inside Project Functions, never Graph from
the browser. To add events to or cancel meetings in an employee's Outlook
calendar, read `/llms/employee-calendars.txt`: it is `ctx.calendar`, also only
inside Project Functions, and the project needs a grant from a platform admin.
Use the same SDK client in this lane:
```js
// Only after confirming this named query exists in the project/environment:
const summary = await appshare.runQuery("orders_by_status", {status: "open"});
const groups = summary.result.rows;
// For detail, choose fields and a bounded page:
const page = await appshare.table("orders").listPage({
fields: ["status", "amount"], limit: 100
});
```
`table.aggregate()` handles SQL counts/sums/groups; Project Functions handle custom
or multi-table rules. `list()` returns a single array page, never all rows. Preserve
`data_revision` when paging; restart on 409. Reuse the summary revision when loading
matching detail. Keep row/field permissions on the server and inspect errors.
Do not download entire tables just to count them. Keep full dates until date cutoffs
are applied. Compare KPIs, history and exports against the current published source;
a successful request or quality job does not establish numeric equivalence.
A separate test app in the same environment shares the original tables, so isolate
write targets for editable tests. Inspect `get_app_quality` after publication and
associate form labels with inputs; review proper-name spelling flags manually.
## Bootstrap rules
- Use Bootstrap layout and components before inventing custom UI.
- Use modals for detail editors.
- Use `table`, `list-group`, `form-control`, `btn`, `badge`, `alert`, `toast`, `nav-tabs`, and `card` sparingly and consistently.
- Keep CSS local and small.
- Do not create a separate design system per app.
- Do not place business rules in the browser when a project function can return the safe result.
## Icons
appshare self-hosts a curated icon set (Lucide geometry, ~100 icons, same icons the console uses). Load it and use it — do NOT add lucide, Bootstrap Icons, Font Awesome, Material Symbols or any icon CDN, and do not paste raw `