Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Design and build reusable Convex components with isolated tables, backend functions, and app-facing wrappers.
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
references/local-components.md
1# Local Convex Components23Read this file when the component should live inside the current app and does4not need to be published as an npm package.56## When to Choose This78- The user wants the simplest path9- The component only needs to work in this repo10- The goal is extracting app logic into a cleaner boundary1112## Default Layout1314Use this structure unless the repo already has a clear alternative pattern:1516```text17convex/18convex.config.ts19components/20<name>/21convex.config.ts22schema.ts23<feature>.ts24```2526## Workflow Notes2728- Define the component with `defineComponent("<name>")`29- Install it from the app with `defineApp()` and `app.use(...)`30- Keep auth, env access, public API wrappers, and HTTP route mounting in the app31- Let the component own isolated tables and reusable backend workflows32- Add app wrappers if clients need to call into the component3334## Checklist3536- [ ] Component is inside `convex/components/<name>/`37- [ ] App installs it with `app.use(...)`38- [ ] Component owns only its own tables39- [ ] App wrappers handle client-facing calls when needed40