-
-
Notifications
You must be signed in to change notification settings - Fork 8
Vercel Sandbox Integration #640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ngoiyaeric
wants to merge
6
commits into
main
Choose a base branch
from
feature/vercel-sandbox-integration-4831652204283404284
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
58859ab
feat: integrate Vercel Sandbox for code execution and live previews
google-labs-jules[bot] d41ece3
Merge branch 'main' into feature/vercel-sandbox-integration-483165220…
ngoiyaeric ecbd4c3
chore: synchronize with main and fix map component type error
google-labs-jules[bot] 8fc5dda
docs: add instructions for Vercel Sandbox credentials in .env.local.e…
google-labs-jules[bot] dccf04b
chore: merge latest changes from main branch
google-labs-jules[bot] a1cb143
chore: merge latest changes from main branch
google-labs-jules[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,6 @@ docker-compose*.yml | |
| cloudbuild.yaml | ||
|
|
||
| # Drizzle | ||
| drizzle/ | ||
|
|
||
| # Scripts | ||
| install.sh | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| # Cloud Deployment Guide for QCX | ||
|
|
||
| This guide provides instructions for deploying the QCX stack (Next.js, PostgreSQL with pgvector/PostGIS, and Qdrant) to various cloud platforms. | ||
|
|
||
| ## Infrastructure Overview | ||
|
|
||
| The application consists of: | ||
| 1. **QCX Web App**: Next.js application running on Bun. | ||
| 2. **PostgreSQL**: Database with `pgvector` and `PostGIS` extensions. | ||
| 3. **Qdrant**: High-performance vector database (optional, for advanced vector search). | ||
|
|
||
| --- | ||
|
|
||
| ## 1. Deploying with Docker Compose (VPS / EC2 / Compute Engine) | ||
|
|
||
| The easiest way to deploy the entire stack is using `docker-compose`. | ||
|
|
||
| 1. **Clone the repository** on your server. | ||
| 2. **Create a `.env` file** based on the environment variables in `docker-compose.yaml`. | ||
| 3. **Run the stack**: | ||
| ```bash | ||
| docker-compose up -d --build | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 2. Deploying to Render | ||
|
|
||
| Render is a great choice for managed services. | ||
|
|
||
| ### PostgreSQL (Managed) | ||
| 1. Create a **New PostgreSQL** instance on Render. | ||
| 2. **Note**: Standard Render Postgres does not include `pgvector` or `PostGIS` by default on all plans. You may need to use a Docker-based Postgres on Render or ensure your plan supports these extensions. | ||
| 3. If using Render's managed Postgres, run the extensions command manually via a SQL client: | ||
| ```sql | ||
| CREATE EXTENSION IF NOT EXISTS postgis; | ||
| CREATE EXTENSION IF NOT EXISTS vector; | ||
| ``` | ||
|
|
||
| ### Web Service | ||
| 1. Create a **New Web Service** pointing to your repository. | ||
| 2. Select **Docker** as the runtime. | ||
| 3. Specify the **Dockerfile path** as `Dockerfile`. | ||
| 4. Add environment variables: | ||
| * `DATABASE_URL`: Your Render Postgres connection string. | ||
| * `EXECUTE_MIGRATIONS`: `true` | ||
| * `NEXT_PUBLIC_MAPBOX_ACCESS_TOKEN`: Your Mapbox token. | ||
| * (Add other necessary API keys like Google, xAI, etc.) | ||
|
|
||
| ### Qdrant (Optional) | ||
| 1. Create a **New Private Service** or **Web Service**. | ||
| 2. Select **Docker** as the runtime. | ||
| 3. Use the image: `qdrant/qdrant:latest`. | ||
| 4. Set `QDRANT_URL` in your Web Service to point to this service. | ||
|
|
||
| --- | ||
|
|
||
| ## 3. Deploying to Google Cloud (GCP) | ||
|
|
||
| ### Cloud Run | ||
| 1. **Build and Push** the image to Google Artifact Registry: | ||
| ```bash | ||
| docker build -t gcr.io/YOUR_PROJECT/qcx . | ||
| docker push gcr.io/YOUR_PROJECT/qcx | ||
| ``` | ||
| 2. **Deploy to Cloud Run**: | ||
| ```bash | ||
| gcloud run deploy qcx --image gcr.io/YOUR_PROJECT/qcx --platform managed | ||
| ``` | ||
|
|
||
| ### Cloud SQL | ||
| 1. Create a **Cloud SQL for PostgreSQL** instance (version 15+). | ||
| 2. Cloud SQL supports both `pgvector` and `postgis`. Enable them via: | ||
| ```sql | ||
| CREATE EXTENSION IF NOT EXISTS postgis; | ||
| CREATE EXTENSION IF NOT EXISTS vector; | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## 4. Vector Database Options | ||
|
|
||
| QCX is configured to support two vector database options: | ||
|
|
||
| 1. **PostgreSQL (pgvector)**: Integrated into the main database. Best for smaller datasets and simplicity. | ||
| 2. **Qdrant**: Dedicated vector database. Recommended for large-scale production use cases requiring high performance and advanced filtering. | ||
|
|
||
| To use Qdrant, ensure the `QDRANT_URL` environment variable is set in your application environment. | ||
|
|
||
| --- | ||
|
|
||
| ## 5. Security Checklist | ||
|
|
||
| * [ ] Change default passwords in `docker-compose.yaml`. | ||
| * [ ] Use SSL for database connections in production (`ssl=true` in `DATABASE_URL`). | ||
| * [ ] Set `NODE_ENV=production`. | ||
| * [ ] Ensure all sensitive API keys are stored as secrets, not committed to code. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| FROM postgres:16-alpine | ||
|
|
||
| # Install build dependencies and pgvector | ||
| RUN apk add --no-cache --virtual .build-deps \ | ||
| git \ | ||
| build-base \ | ||
| clang15 \ | ||
| llvm15-dev \ | ||
| postgis-dev \ | ||
| postgresql-dev \ | ||
| && git clone --branch v0.8.0 https://github.com/pgvector/pgvector.git /tmp/pgvector \ | ||
| && cd /tmp/pgvector \ | ||
| && make \ | ||
| && make install \ | ||
| && apk add --no-cache postgis \ | ||
| && rm -rf /tmp/pgvector \ | ||
| && apk del .build-deps | ||
|
|
||
| # Use the default entrypoint | ||
| ENTRYPOINT ["docker-entrypoint.sh"] | ||
| CMD ["postgres"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧹 Nitpick | 🔵 Trivial | 💤 Low value
Reorder environment variables to alphabetical order.
The static analysis tool (dotenv-linter) reports that
VERCEL_TEAM_ID(line 38) should appear beforeVERCEL_TOKEN(line 36) to maintain alphabetical/conventional ordering.🔧 Proposed reordering
📝 Committable suggestion
🧰 Tools
🪛 dotenv-linter (4.0.0)
[warning] 38-38: [UnorderedKey] The VERCEL_TEAM_ID key should go before the VERCEL_TOKEN key
(UnorderedKey)
🤖 Prompt for AI Agents
Source: Linters/SAST tools