Rust crates
When working on Rust crates in thecrates/ directory, follow this workflow:
After each change
Format your code using cargo fmt:When a change is ready
Formatting configuration
The project usesrustfmt with custom configuration in rustfmt.toml. Key settings include:
- Field init shorthand
- Try shorthand
- Nightly features enabled
- Vertical imports layout
- Comment wrapping
TypeScript monorepo
When working on TypeScript packages in thenpm-packages/ directory, follow this workflow:
After each modification
Format your code using dprint:When the change is ready
Dependencies management
This project uses Rush to manage dependencies. After modifying the dependencies of a package, run:just rush build- Build all projects in npm-packagesjust rush rebuild- Build when Rush doesn’t realize something’s changedjust rush install- Install dependencies when the repo has changed JS depsjust rush update- Update dependencies when you’re changing JS deps
Code organization
The Convex Backend project is organized into several key areas:Client libraries
The JavaScript/React libraries for Convex:CLI
The command-line tool for Convex users (npx convex):
Dashboard
The web user interface for Convex users:npm-packages/dashboard/- Convex Cloud dashboard (https://dashboard.convex.dev/)npm-packages/dashboard-self-hosted/- Self-hosted build of the dashboardnpm-packages/dashboard-common/- Code common to both dashboard versionsnpm-packages/@convex-dev/design-system/- UI elementsnpm-packages/system-udfs/- Convex functions the dashboard/CLI can call on deployments
Documentation
Public docs at https://docs.convex.dev/:Local backend management
Running the local backend
Start the open source Convex backend on port 3210:Running the dashboard
Run the self-hosted dashboard locally:Resetting local data
Clear any data or stored files from the local backend:convex_local_storage/directoryconvex_local_backend.sqlite3file