Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions docs/DEPLOY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ tag.
## Vercel (recommended: static, free)

The demo needs no server: `npm run build:demo` builds the UI and indexes the demo repo into a static `graph.json`,
and `vercel.json` routes the UI's `/api/graph` request to it.
and `packages/web/vercel.json` routes the UI's `/api/graph` request to it. This is the only Vercel config, so
Root Directory must be `packages/web`.

1. Sign in at <https://vercel.com> with GitHub. The free Hobby plan is enough.
2. Click **Add New → Project**, import `harsharajkumar-273/CodeGraph` and click **Deploy**. Leave every setting as
it is; `vercel.json` provides the install command, build command and output folder.
3. Vercel prints a `https://<project>.vercel.app` URL. Every push to `main` redeploys it.
2. Click **Add New → Project** and import `harsharajkumar-273/CodeGraph`.
3. Vercel detects two apps (the `Dockerfile` and `packages/web`) and offers a multi-service import. Don't use it.
Set **Root Directory** to `packages/web` instead, so it is imported as one Vite project. Its `vercel.json`
supplies the install command, build command and output folder, so leave those alone, and click **Deploy**.
4. Vercel prints a `https://<project>.vercel.app` URL. Every push to `main` redeploys it.

To show a different repo, set `DEMO_REPO` (a git URL) and `DEMO_REF` (a branch or tag) under **Settings →
Environment Variables**, then redeploy. To try the static build locally, run `npm run build:demo` and serve
Expand Down
2 changes: 1 addition & 1 deletion packages/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"type": "module",
"private": true,
"scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview" },
"scripts": { "dev": "vite", "build": "vite build", "preview": "vite preview", "build:demo": "cd ../.. && npm run build:demo" },
"dependencies": {
"@codegraph/analysis": "*",
"@codegraph/core": "*",
Expand Down
6 changes: 3 additions & 3 deletions vercel.json → packages/web/vercel.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"framework": null,
"installCommand": "npm ci",
"buildCommand": "npm run build:demo",
"outputDirectory": "packages/web/dist",
"installCommand": "cd ../.. && npm ci",
"buildCommand": "cd ../.. && npm run build:demo",
"outputDirectory": "dist",
"rewrites": [{ "source": "/api/graph", "destination": "/graph.json" }]
}
Loading