|
1 | | -# Chef |
| 1 | +<p align="center"> |
| 2 | +<picture> |
| 3 | + <source media="(prefers-color-scheme: dark)" srcset="https://static.convex.dev/logo/convex-logo-light.svg" width="600"> |
| 4 | + <source media="(prefers-color-scheme: light)" srcset="https://static.convex.dev/logo/convex-logo.svg" width="600"> |
| 5 | + <img alt="Convex logo" src="https://static.convex.dev/logo/convex-logo.svg" width="600"> |
| 6 | +</picture> |
| 7 | +</p> |
2 | 8 |
|
3 | | -This is fork of the `stable` branch of [bolt.diy](https://github.com/stackblitz-labs/bolt.diy). |
| 9 | +[Chef](https://chef.convex.dev) is the only AI app builder that knows backend. It builds full-stack web apps with a built-in database, zero config auth, file uploads, |
| 10 | +real-time UIs, and background workflows. |
4 | 11 |
|
5 | | -There are three special branches: |
| 12 | +Chef's capabilities are enabled by being built on top of [Convex](https://convex.dev), the open-source reactive database designed to make life easy for web app developers. |
6 | 13 |
|
7 | | -- main: detault branch, make PRs against this |
8 | | -- staging: what the world sees at [chef-staging.convex.dev](https://chef-staging.convex.dev) |
9 | | -- release: what the world sees at [chef.convex.dev](https://chef.convex.dev) |
| 14 | +Development of the Chef is led by the Convex team. We |
| 15 | +[welcome bug fixes](./CONTRIBUTING.md) and |
| 16 | +[love receiving feedback](https://discord.gg/convex). |
10 | 17 |
|
11 | | -### One-time setup |
| 18 | +This project was made in collaboration with the [Bolt](https://bolt.new/) team and is a fork of the `stable` branch of [bolt.diy](https://github.com/stackblitz-labs/bolt.diy). |
12 | 19 |
|
13 | | -``` |
14 | | -git clone [email protected]:get-convex/flex-diy.git chef |
15 | | -cd chef |
16 | | -nvm install |
17 | | -nvm use |
18 | | -npm install -g pnpm |
19 | | -pnpm i |
20 | | -npx vercel link --scope convex-dev --project chef -y |
21 | | -npx vercel env pull |
22 | | -echo 'VITE_CONVEX_URL=placeholder' >> .env.local |
23 | | -npx convex dev --configure existing --team convex --project chef --once |
24 | | -``` |
| 20 | +## Getting Started |
25 | 21 |
|
26 | | -Explanation: |
| 22 | +## Repository Layout |
27 | 23 |
|
28 | | -Clone the 100MB repo (don't worry, it's not much code) into a dir called chef. |
29 | | -We use Node.js version 20 to develop even though in production on Vercel backend code runs in Vercel's Node.js 22 environment! |
30 | | -This project uses `pnpm` instead of `npm`. Download an .env.local from Vercel. |
31 | | -Add `VITE_CONVEX_URL` because otherwise `npx convex dev` will incorrectly guess that you want to use `CONVEX_URL` as the client environment variable (Nicolas added a fix to the convex CLI that will be in the next client release so we can avoid this.) |
32 | | -Connect to the same Convex project as the rest of us so that you get some environment variables populated in your dev deployment automatically. |
| 24 | +- `app/` contains all of the client side code and some serverless APIs. |
33 | 25 |
|
34 | | -### Developing |
| 26 | + - `components/` defines the UI components |
| 27 | + - `lib/` contains client-side logic for syncing local state with the server |
| 28 | + - `routes/` defines some client and server routes |
35 | 29 |
|
36 | | -``` |
37 | | -pnpm i |
38 | | -pnpm run dev |
| 30 | +- `chef-agent/` handles the agentic loop by injecting system prompts, defining tools, and calling out to model providers. |
39 | 31 |
|
40 | | -# and in another terminal, |
| 32 | +- `chefshot/` defines a CLI interface for interacting with the Chef webapp. |
41 | 33 |
|
42 | | -npx convex dev |
| 34 | +- `convex/` contains the database that stores chats and user metadata. |
43 | 35 |
|
44 | | -# now visit http://127.0.0.1:5173 |
45 | | -# make sure to use this port and 127.0.0.1 instead of localhost as the hostname, it's been specifically listed in our WorkOS application. |
46 | | -# Wait a few seconds, and then RELOAD THE PAGE! Unfortunately this is currently required |
47 | | -# to use the hot-reloading dev server. |
48 | | -``` |
| 36 | +- `template/` contains the template that we use to start all Chef projects. |
49 | 37 |
|
50 | | -### Submitting PRs |
51 | | - |
52 | | -Probably set up an editor plugin for running prettier on save. |
53 | | - |
54 | | -We have a commit queue that blocks on tests, formatting, lints and typechecking. |
55 | | -Run `pnpm run lint:fix` for lints and formatting, `pnpm run test`for tests (or skip this, |
56 | | -there are very few tests so you're unlikely to break any), and `pnpm run typecheck` for typechecking. |
57 | | - |
58 | | -Hit "Merge when ready" on your own PR once it's ready. |
59 | | - |
60 | | -We have deploy previews, click the link on |
61 | | -your PR or push a branch and go to [vercel.com/convex-dev/chef/deployments](https://vercel.com/convex-dev/chef/deployments) |
62 | | -to find your preview deploy. |
63 | | - |
64 | | -Test your work, we don't have e2e tests. |
65 | | - |
66 | | -### Deploy Process |
67 | | - |
68 | | -Push from main to staging whenever it makes sense, it's not a protected branch on GitHub. |
69 | | - |
70 | | -``` |
71 | | -git checkout main |
72 | | -git pull |
73 | | -git push origin main:staging |
74 | | -``` |
75 | | - |
76 | | -Make a PR from staging to release using [go/chef-release](https://go.cvx.is/chef-release) and confirm that |
77 | | -the evals look good once they run (they should take ~10 mins). All of the evals should have an `isSuccess` |
78 | | -rate of 100%. (Do NOT merge this PR because the GitHub merge queue doesn't allow fast-forward only merges) |
79 | | -While you're waiting for evals to run, manually test staging. |
80 | | - |
81 | | -Merge the staging branch into release using the command below. |
82 | | -Announce in the #project-chef Slack channel when you do this. |
83 | | - |
84 | | -``` |
85 | | -git checkout staging |
86 | | -git pull |
87 | | -git push origin staging:release |
88 | | -``` |
89 | | - |
90 | | -If the change does not include non-backward compatible Convex DB changes you |
91 | | -can use the Vercel instant rollbacks to prompt old deployments to production. |
92 | | - |
93 | | -### Auth |
94 | | - |
95 | | -- Users sign in with their regular Convex account through WorkOS. |
96 | | -- Users choose a team to create a new project in for app they conconct with Chef. |
97 | | - Note that this is _not_ the OAuth flow that we offer to customers; if a customer wants this, |
98 | | - they need to use the OAuth flow that grants them access to a user's specific Convex project. |
99 | | -- You'll need the following env vars set in `.env.local` (values are in 1Password under `flex .env.local`) |
100 | | - - VITE_WORKOS_CLIENT_ID=client_01K0YV0SNPRYJ5AV4AS0VG7T1J |
101 | | - - VITE_WORKOS_REDIRECT_URI=http://127.0.0.1:5173 |
102 | | - - VITE_WORKOS_API_HOSTNAME=apiauth.convex.dev |
103 | | - |
104 | | -(it'll also be in the default Convex project env vars, so you can sync via dashboard). |
105 | | - |
106 | | -### Developing against local big-brain |
107 | | - |
108 | | -You will need a lot of terminals |
109 | | - |
110 | | -- just run-big-brain-for-chef-dev |
111 | | -- just run-dash |
112 | | -- Switch chef .env.local env vars to the dev variants (from 1Password) |
113 | | -- Set VITE_CONVEX_URL to 'placeholder' and remove CONVEX_URL |
114 | | -- just convex-bb dev |
115 | | -- Set VITE_CONVEX_SITE_URL to match the newly updated VITE_CONVEX_URL (but .convex.site instead) |
116 | | -- npm run dev |
117 | | - |
118 | | -# Working on the template |
119 | | - |
120 | | -There are a few steps to iterating on the template. |
121 | | - |
122 | | -Run `npm run rebuild-template` for directions. |
123 | | - |
124 | | -# Debugging |
125 | | - |
126 | | -We include source maps in production so you should be able to poke around in production. |
127 | | - |
128 | | -There are a few global variables available for debugging too: |
129 | | - |
130 | | -- `chefWebContainer` is the unix-ish container in which tooling and code runs |
131 | | -- `chefMessages` is the raw messages |
132 | | -- `chefParsedMessages` is similar |
133 | | -- `chefSentryEnabled` is whether Sentry is currently enabled |
134 | | -- `chefSetLogLevel()` can be called with log levels like `"debug"` or `"info"` to get more console logging. `"tracing"` is usually too much. |
135 | | -- `chefAssertAdmin()` enables admin features (after checking that you are a member of the Convex team in the prod dashboard) |
| 38 | +- `test-kitchen/` contains a test harness for the Chef agent loop. |
0 commit comments