Installing dependencies
You will need to first install the following dependencies if you don’t already have them on your machine.Required tools
Just
Just is used to execute scripts set up in theJustfile.
Node.js
Make sure you have Node.js version20.19.5 (specified in .nvmrc).
We recommend installing Node.js via nvm.
Rust toolchain
The Convex local backend is written in Rust. Install Cargo and the Rust toolchain via rustup. The Rust nightly version specified inrust-toolchain will install automatically when you use rustup.
JavaScript dependencies
The project uses Rush to manage packages in a monorepo.Building the backend
Build and run the local backend from the source in this repo:If this fails with an error “persisted db metadata …”, you might need to erase the local database:
Provisioning a demo app
This example demonstrates running the backend with the included demo project.Run Convex dev
The Convex CLI watches for changes in the application source code and pushes the code to the backend.The
convex script in Justfile automatically adds appropriate --url and --admin-key flags to point the CLI to the local backend.Useful CLI commands
When interacting with your backend, these CLI commands may be helpful:just convex data- Lists tables in your Convex deploymentjust convex env- Allows you to list/set/update/delete environment variablesjust convex logs- Streams out log lines to the terminal (includes all successful executions if--successis passed in)just convex import- Allows you to import tablesjust convex export- Allows you to export tables