@@ -54,125 +54,15 @@ To see how to contribute, visit [Contributing.md](./CONTRIBUTING.md).
54
54
- GitHub Issues. Best for: surfacing bugs and errors you encounter while
55
55
building and using the open source Convex backend
56
56
57
- ## Running on your own machine
58
-
59
- Instead of self-hosting via docker, you can run the Convex backend locally on
60
- your own machine.
61
-
62
57
## Building from source
63
58
64
- To get started, clone this repo:
65
-
66
- ``` sh
67
- git clone https://github.com/get-convex/convex-backend.git
68
- cd convex-backend
69
- ```
70
-
71
- ## Dependencies
72
-
73
- You will need to first install the following dependencies if you don't already
74
- have them on your machine:
75
-
76
- To use the scripts set up in this repo:
77
-
78
- - [ ` Just ` ] ( https://github.com/casey/just )
79
- - Just is used to execute scripts set up in the ` Justfile ` .
80
- - To install it see
81
- [ Packages] ( https://github.com/casey/just?tab=readme-ov-file#packages ) , for
82
- example ` cargo install just ` or ` brew install just `
83
-
84
- To run the Convex CLI:
85
-
86
- - [ Node.js] ( https://nodejs.org/en )
87
- - Make sure you have the version specified in ` .nvmrc `
88
- - We recommend installing Node.js via
89
- [ nvm] ( https://github.com/nvm-sh/nvm#installing-and-updating ) .
90
- - Run ` nvm use ` from the root of the repo.
91
-
92
- To [ build the backend from source] ( #building-from-source ) :
93
-
94
- - Cargo
95
- - The convex local backend is written in Rust. Cargo is the build system.
96
- - We recommend installing Cargo via [ rustup] ( https://rustup.rs/ ) .
97
- - The Rust nightly version specified in ` rust-toolchain `
98
- - Assuming you installed Rust/Cargo with ` rustup ` , this will install
99
- automatically.
100
- - Rush
101
- - ` npm clean-install --prefix scripts `
102
- - We manage the packages in a monorepo using [ Rush] ( https://rushjs.io/ ) .
103
- - Convex JavaScript dependencies
104
- - ` just rush install `
105
-
106
- ### Building from source
107
-
108
- Build and run the local backend from the source in this repo:
109
-
110
- ``` sh
111
- just run-local-backend
112
- ```
113
-
114
- Under the hood, this builds with Cargo:
115
-
116
- ``` sh
117
- cargo run -p local_backend --bin convex-local-backend
118
- ```
119
-
120
- ## Provisioning a demo app locally
121
-
122
- This example will go through running the backend with the included demo project.
123
-
124
- ** 1. Start the backend**
125
-
126
- [ Run the backend] ( #running-the-convex-backend )
127
-
128
- If this fails with an error "persisted db metadata ..." you might need to erase
129
- the local database, in root directory run ` rm convex_local_backend.sqlite3 ` .
130
-
131
- ** 2. Develop against the backend**
132
-
133
- The Convex CLI watches for changes in the application source code and pushes the
134
- code to backend.
135
-
136
- To make the local backend run the included demo project, do:
137
-
138
- ``` bash
139
- cd demo
140
- npm i
141
- just convex dev
142
- ```
143
-
144
- The ` convex ` script in ` Justfile ` automatically adds appropriate ` --url ` and
145
- ` --admin-key ` flags to point the CLI to the local backend.
146
-
147
- To run the client web application you can run the demo Vite server via:
148
-
149
- ``` bash
150
- npm run dev:frontend
151
- ```
152
-
153
- Note that unlike the hosted Convex workflow, we don't want to run the
154
- ` dev:backend ` command since ` convex dev ` is already running.
155
-
156
- _ The following CLI commands may be useful when interacting with your backend:_
157
-
158
- - ` just convex data ` - Lists tables in your Convex deployment
159
- - ` just convex env ` - Allows you to list/set/update/delete environment variables
160
- - ` just convex logs ` - Streams out log lines to the terminal (it includes all
161
- successful executions if ` --success ` is passed in)
162
- - ` just convex import ` - Allows you to import tables
163
- - ` just convex export ` - Allows you to export tables
59
+ See [ BUILD.md] ( ./BUILD.md ) .
164
60
165
61
## Disclaimers
166
62
167
63
- If you choose to self-host, we recommend following the self-hosting guide. If
168
- you are going off the beaten path , make sure to change your instance secret
64
+ you are instead building from source , make sure to change your instance secret
169
65
and admin key from the defaults in the repo.
170
- - Migrating to a new version of self-hosted requires carefully following the
171
- migration guide in our release notes.
172
- - If you're using both the local backend and the hosted cloud platform, make
173
- sure to run ` npx convex dev ` or ` just convex dev ` before you start testing
174
- your client. The ` dev ` command will take care of updating your ` .env.local `
175
- file with the correct ` CONVEX_URL ` .
176
66
- Convex is battle tested most thoroughly on Linux and Mac. On Windows, it has
177
67
less experience. If you run into issues, please message us on
178
68
[ Discord] ( https://convex.dev/community ) in the #open-source channel.
@@ -201,5 +91,3 @@ _The following CLI commands may be useful when interacting with your backend:_
201
91
- ` udf-tests/ ` is a collection of functions used in testing the isolate
202
92
layer
203
93
- ` system-udfs/ ` contains functions used by the Convex system e.g. the CLI
204
- - ` demo/ ` contains a demo project that showcases the basic functionality of
205
- Convex using React
0 commit comments