# Conventions Where Elements differs from what you would guess from the outside, and the conventions its own source follows. Read this once before you write a first page and the rest of the manual reads faster. **Project structure** - Routes are declared in `index.ts`, not file-based. Folder names under `app/pages/` are labels, not URLs. - A scaffolded page has `index.ts` (route only) and `template.ehtml` (template, event handlers, inline RPC). As a page grows, move its `@rpc` functions and shared interfaces into a hand-authored `services.ts` sibling. An `@rpc` never belongs in a page's `index.ts`. - Scaffold with `elements create` and treat the scaffold as a guide: fill it in, and do not discard its parts without a good reason. - Cross-page services and templates live under `app/shared/`. - Import app source with the `#app/...` map (`#app/pages/...`, `#app/shared/...`), never `../../`. `#config` imports config. - Import a page's template extensionless: `import html from "./template"`. - Use kebab-case for directories and filenames. **HTML templates** - TypeScript goes outside template declarations or inside `{}` expressions, not in `