-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Nginx proxy layer for multi-app routing #239
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
base: main
Are you sure you want to change the base?
Conversation
Bumps [@testing-library/react](https://github.com/testing-library/react-testing-library) from 15.0.7 to 16.3.0. - [Release notes](https://github.com/testing-library/react-testing-library/releases) - [Changelog](https://github.com/testing-library/react-testing-library/blob/main/CHANGELOG.md) - [Commits](testing-library/react-testing-library@v15.0.7...v16.3.0) --- updated-dependencies: - dependency-name: "@testing-library/react" dependency-version: 16.3.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
…#185) * Initial plan * chore(deps): add missing peer dependencies for @testing-library/react@16.3.0 Co-authored-by: stevei101 <287896+stevei101@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: stevei101 <287896+stevei101@users.noreply.github.com>
- Keep @types/react and @types/react-dom (required for @testing-library/react v16.3.0) - Use @typescript-eslint/parser ^8.0.0 to match typescript-eslint ^8.46.2 - Keep @typescript-eslint/eslint-plugin ^8.0.0 Resolves merge conflict from PR #185
- Add nginx-proxy service for routing agentnav, prompt-vault, and cursor-ide - Configure nginx with landing page and route handling - Fix prompt-vault vite config (remove base path for proxy compatibility) - Add proxy build and deploy steps to CI/CD workflow - Add Terraform configuration for proxy Cloud Run service - Add restart script for prompt-vault stability - Fix nginx config to handle optional services gracefully Resolves stability issues with 502 errors and port conflicts.
Summary of ChangesHello @stevei101, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request establishes a crucial Nginx proxy layer to centralize access and routing for several independent applications: agentnav, prompt-vault, and cursor-ide. The proxy acts as a unified entry point, intelligently directing traffic to the correct service components, including frontends, backends, and specialized endpoints like WebSockets. This architectural enhancement not only streamlines the user experience by providing a single URL for all applications but also prepares the system for robust Cloud Run deployments. It includes necessary configurations, such as environment variable management and port conflict resolution, alongside thorough documentation to ensure ease of setup and maintenance. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This PR introduces a comprehensive Nginx proxy layer to route traffic to multiple applications, which is a great step towards unifying the services. The setup includes Docker configuration, a landing page, and extensive local testing scripts. The changes are well-structured. However, I've found a few critical issues in the Nginx configuration and Dockerfile that need to be addressed to ensure the proxy functions correctly. There are also some medium-severity issues related to maintainability, consistency in documentation, and scripting that I've highlighted for improvement.
nginx-proxy/Dockerfile
Outdated
| FROM nginx:1.25-alpine | ||
|
|
||
| # Install envsubst for environment variable substitution | ||
| RUN apk add --no-cache gettext |
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.
The HEALTHCHECK instruction on line 43 uses wget, but it is not installed in the nginx:1.25-alpine base image. This will cause the health check to fail, and container orchestrators like Cloud Run will consider the container unhealthy and restart it. Please install wget along with gettext.
RUN apk add --no-cache gettext wget
| # Main server block | ||
| server { | ||
| listen ${PORT}; | ||
| server_name _; |
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.
When using variables in proxy_pass directives for upstream hostnames (like ${AGENTNAV_BACKEND_URL}), Nginx needs a resolver to resolve these domain names at runtime. Without it, Nginx will fail to start or will be unable to route requests to the upstream services, resulting in 502 errors. Please add a resolver directive inside the server block. For Cloud Run, using a public DNS resolver is a good choice.
server_name _;
resolver 8.8.8.8 valid=300s;
| # Nginx Proxy Configuration for Agentnav Cloud Run | ||
| # Thin proxy layer for request routing and load balancing | ||
|
|
||
| user nginx; | ||
| worker_processes auto; | ||
| error_log /var/log/nginx/error.log warn; | ||
| pid /var/run/nginx.pid; | ||
|
|
||
| events { | ||
| worker_connections 1024; | ||
| use epoll; | ||
| } | ||
|
|
||
| http { | ||
| include /etc/nginx/mime.types; | ||
| default_type application/octet-stream; | ||
|
|
||
| log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
| '$status $body_bytes_sent "$http_referer" ' | ||
| '"$http_user_agent" "$http_x_forwarded_for"'; | ||
|
|
||
| access_log /var/log/nginx/access.log main; | ||
|
|
||
| # Performance optimizations for Cloud Run | ||
| sendfile on; | ||
| tcp_nopush on; | ||
| tcp_nodelay on; | ||
| keepalive_timeout 65; | ||
| types_hash_max_size 2048; | ||
| client_max_body_size 10M; | ||
|
|
||
| # Gzip compression | ||
| gzip on; | ||
| gzip_vary on; | ||
| gzip_proxied any; | ||
| gzip_comp_level 6; | ||
| gzip_types text/plain text/css text/xml text/javascript | ||
| application/json application/javascript application/xml+rss | ||
| application/rss+xml font/truetype font/opentype | ||
| application/vnd.ms-fontobject image/svg+xml; | ||
|
|
||
| # Upstream backend services | ||
| # These will be set via environment variables at runtime | ||
| upstream backend_service { | ||
| server ${BACKEND_SERVICE_URL}; | ||
| keepalive 32; | ||
| } | ||
|
|
||
| upstream frontend_service { | ||
| server ${FRONTEND_SERVICE_URL}; | ||
| keepalive 32; | ||
| } | ||
|
|
||
| upstream gemma_service { | ||
| server ${GEMMA_SERVICE_URL}; | ||
| keepalive 32; | ||
| } | ||
|
|
||
| # Main server block | ||
| server { | ||
| listen ${PORT:-8080}; | ||
| server_name _; | ||
|
|
||
| # Health check endpoint | ||
| location /healthz { | ||
| access_log off; | ||
| return 200 "healthy\n"; | ||
| add_header Content-Type text/plain; | ||
| } | ||
|
|
||
| # API routes - proxy to backend | ||
| location /api/ { | ||
| proxy_pass ${BACKEND_SERVICE_URL}; | ||
| proxy_http_version 1.1; | ||
|
|
||
| # Headers | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| proxy_set_header Connection ""; | ||
|
|
||
| # Timeouts | ||
| proxy_connect_timeout 60s; | ||
| proxy_send_timeout 60s; | ||
| proxy_read_timeout 60s; | ||
|
|
||
| # Buffering | ||
| proxy_buffering on; | ||
| proxy_buffer_size 4k; | ||
| proxy_buffers 8 4k; | ||
| } | ||
|
|
||
| # WebSocket support for streaming | ||
| location /ws/ { | ||
| proxy_pass ${BACKEND_SERVICE_URL}; | ||
| proxy_http_version 1.1; | ||
|
|
||
| # WebSocket headers | ||
| proxy_set_header Upgrade $http_upgrade; | ||
| proxy_set_header Connection "upgrade"; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
|
|
||
| # WebSocket timeouts (longer for streaming) | ||
| proxy_connect_timeout 300s; | ||
| proxy_send_timeout 300s; | ||
| proxy_read_timeout 300s; | ||
| } | ||
|
|
||
| # Gemma GPU service routes | ||
| location /gemma/ { | ||
| rewrite ^/gemma/(.*) /$1 break; | ||
| proxy_pass ${GEMMA_SERVICE_URL}; | ||
| proxy_http_version 1.1; | ||
|
|
||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| proxy_set_header Connection ""; | ||
|
|
||
| # Longer timeouts for GPU operations | ||
| proxy_connect_timeout 300s; | ||
| proxy_send_timeout 300s; | ||
| proxy_read_timeout 300s; | ||
| } | ||
|
|
||
| # Frontend static assets and SPA routing | ||
| location / { | ||
| proxy_pass ${FRONTEND_SERVICE_URL}; | ||
| proxy_http_version 1.1; | ||
|
|
||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| proxy_set_header X-Forwarded-Proto $scheme; | ||
| proxy_set_header Connection ""; | ||
|
|
||
| # SPA routing - return index.html for non-file requests | ||
| proxy_intercept_errors on; | ||
| error_page 404 = @frontend_fallback; | ||
| } | ||
|
|
||
| # Fallback for SPA routing | ||
| location @frontend_fallback { | ||
| proxy_pass ${FRONTEND_SERVICE_URL}; | ||
| proxy_set_header Host $host; | ||
| } | ||
|
|
||
| # FastAPI docs (if needed) | ||
| location /docs { | ||
| proxy_pass ${BACKEND_SERVICE_URL}/docs; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Host $host; | ||
| proxy_set_header X-Real-IP $remote_addr; | ||
| proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
| } | ||
|
|
||
| location /openapi.json { | ||
| proxy_pass ${BACKEND_SERVICE_URL}/openapi.json; | ||
| proxy_http_version 1.1; | ||
| proxy_set_header Host $host; | ||
| } | ||
| } | ||
| } | ||
|
|
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.
This new configuration file appears to be broken and is likely not used by the Docker build (which uses nginx.conf.template).
Specifically:
listen ${PORT:-8080};uses a default value syntax not supported byenvsubst.upstreamblocks are defined with variables likeserver ${BACKEND_SERVICE_URL};, which is not a valid way to use variables for upstream servers. Nginx will fail to parse this.
If this file is intended for use, it needs to be fixed. If it's a leftover or an example, it should be removed or clearly marked as such to avoid confusion.
| RUN echo '#!/bin/sh' > /docker-entrypoint.sh && \ | ||
| echo 'set -e' >> /docker-entrypoint.sh && \ | ||
| echo 'export PORT=${PORT:-8080}' >> /docker-entrypoint.sh && \ | ||
| echo 'export AGENTNAV_BACKEND_URL=${AGENTNAV_BACKEND_URL:-${BACKEND_SERVICE_URL:-}}' >> /docker-entrypoint.sh && \ | ||
| echo 'export AGENTNAV_FRONTEND_URL=${AGENTNAV_FRONTEND_URL:-${FRONTEND_SERVICE_URL:-}}' >> /docker-entrypoint.sh && \ | ||
| echo 'export AGENTNAV_GEMMA_URL=${AGENTNAV_GEMMA_URL:-${GEMMA_SERVICE_URL:-_disabled_}}' >> /docker-entrypoint.sh && \ | ||
| echo 'export PROMPT_VAULT_BACKEND_URL=${PROMPT_VAULT_BACKEND_URL:-_disabled_}' >> /docker-entrypoint.sh && \ | ||
| echo 'export PROMPT_VAULT_FRONTEND_URL=${PROMPT_VAULT_FRONTEND_URL:-_disabled_}' >> /docker-entrypoint.sh && \ | ||
| echo 'export CURSOR_IDE_BACKEND_URL=${CURSOR_IDE_BACKEND_URL:-_disabled_}' >> /docker-entrypoint.sh && \ | ||
| echo 'export CURSOR_IDE_FRONTEND_URL=${CURSOR_IDE_FRONTEND_URL:-_disabled_}' >> /docker-entrypoint.sh && \ | ||
| echo 'envsubst '"'"'$$PORT $$AGENTNAV_BACKEND_URL $$AGENTNAV_FRONTEND_URL $$AGENTNAV_GEMMA_URL $$PROMPT_VAULT_BACKEND_URL $$PROMPT_VAULT_FRONTEND_URL $$CURSOR_IDE_BACKEND_URL $$CURSOR_IDE_FRONTEND_URL'"'"' < /etc/nginx/templates/nginx.conf.template > /etc/nginx/nginx.conf' >> /docker-entrypoint.sh && \ | ||
| echo 'echo "✅ Nginx config generated"' >> /docker-entrypoint.sh && \ | ||
| echo 'echo " PORT=${PORT}"' >> /docker-entrypoint.sh && \ | ||
| echo 'echo " AGENTNAV_BACKEND_URL=${AGENTNAV_BACKEND_URL}"' >> /docker-entrypoint.sh && \ | ||
| echo 'echo " AGENTNAV_FRONTEND_URL=${AGENTNAV_FRONTEND_URL}"' >> /docker-entrypoint.sh && \ | ||
| echo 'nginx -t' >> /docker-entrypoint.sh && \ | ||
| echo 'exec nginx -g "daemon off;"' >> /docker-entrypoint.sh && \ | ||
| chmod +x /docker-entrypoint.sh |
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.
Creating the docker-entrypoint.sh script using a long chain of echo commands inside the Dockerfile makes it difficult to read, modify, and maintain. It's better practice to create a separate docker-entrypoint.sh file in the nginx-proxy directory and COPY it into the image. This will significantly improve the readability and maintainability of your Docker setup.
| cd /Users/stevenirvin/Documents/GitHub/agentnav | ||
| bun run dev # Runs on port 5173 | ||
| ``` | ||
|
|
||
| **Terminal 2: Agentnav Backend** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav/backend | ||
| PORT=8081 uvicorn main:app --host 0.0.0.0 --port 8081 --reload | ||
| ``` | ||
|
|
||
| **Terminal 3: Prompt-vault** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav/prompt-vault | ||
| ./start-local.sh # Starts frontend (5176) and backend (8001) | ||
| ``` | ||
|
|
||
| **Terminal 4: Cursor-ide** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/cursor-ide/frontend | ||
| bun run dev # Runs on port 5173 (conflicts with agentnav if both running) | ||
| ``` | ||
|
|
||
| **Terminal 5: Nginx Proxy** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/stevei101/agentnav/nginx-proxy | ||
| ./test-local.sh # Starts proxy on port 8082 | ||
| ``` |
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.
The documentation contains hardcoded, user-specific absolute paths (e.g., /Users/stevenirvin/...). This makes the instructions not directly usable by other developers. Please replace these with generic placeholders like ~/path/to/your/repo/agentnav or relative paths from the project root to make the documentation more portable.
| cd /Users/stevenirvin/Documents/GitHub/agentnav | ||
| # Temporarily change port to 5174 | ||
| export PORT=5174 | ||
| bun run dev --port 5174 | ||
| ``` | ||
|
|
||
| **Terminal 2: Agentnav Backend (use port 8083 to avoid gvproxy)** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav/backend | ||
| PORT=8083 uvicorn main:app --host 0.0.0.0 --port 8083 --reload | ||
| ``` | ||
|
|
||
| **Terminal 3: Prompt-vault (ports already configured)** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav/prompt-vault | ||
| ./start-local.sh | ||
| # This starts: | ||
| # - Frontend on 5176 | ||
| # - Backend on 8001 | ||
| ``` | ||
|
|
||
| **Terminal 4: Cursor-ide (already running)** | ||
| - Frontend: Already on 5173 ✅ | ||
| - Backend: Already on 8188 ✅ | ||
|
|
||
| **Terminal 5: Nginx Proxy** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/stevei101/agentnav/nginx-proxy | ||
| # Update ports in test script or set env vars: | ||
| export AGENTNAV_FRONTEND_PORT=5174 | ||
| export AGENTNAV_BACKEND_PORT=8083 | ||
| ./test-local.sh | ||
| ``` | ||
|
|
||
| ### Option 2: Run Without Cursor-ide (Simpler) | ||
|
|
||
| If you don't need cursor-ide running simultaneously: | ||
|
|
||
| **Terminal 1: Agentnav Frontend** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav | ||
| bun run dev # Uses port 5173 (cursor-ide not running) | ||
| ``` | ||
|
|
||
| **Terminal 2: Agentnav Backend** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav/backend | ||
| PORT=8083 uvicorn main:app --host 0.0.0.0 --port 8083 --reload | ||
| ``` | ||
|
|
||
| **Terminal 3: Prompt-vault** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/agentnav/prompt-vault | ||
| ./start-local.sh | ||
| ``` | ||
|
|
||
| **Terminal 4: Nginx Proxy** | ||
| ```bash | ||
| cd /Users/stevenirvin/Documents/GitHub/stevei101/agentnav/nginx-proxy | ||
| export AGENTNAV_FRONTEND_PORT=5173 | ||
| export AGENTNAV_BACKEND_PORT=8083 | ||
| ./test-local.sh | ||
| ``` |
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.
nginx-proxy/landing/index.html
Outdated
| <h2>Agentnav</h2> | ||
| <p class="app-description">Multi-agent knowledge exploration system with ADK and A2A Protocol</p> | ||
| <div class="app-preview"> | ||
| <iframe src="/agentnav/" frameborder="0" class="preview-frame" title="Agentnav Preview"></iframe> |
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.
The frameborder="0" attribute on <iframe> elements is obsolete in HTML5. This attribute is used on lines 24, 45, and 65. For better standards compliance and maintainability, you should use CSS to control the border. You can add border: none; to your .preview-frame class in styles.css and remove this attribute from all iframe tags.
| <iframe src="/agentnav/" frameborder="0" class="preview-frame" title="Agentnav Preview"></iframe> | |
| <iframe src="/agentnav/" class="preview-frame" title="Agentnav Preview"></iframe> |
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then | ||
| HOST_ADDR="172.17.0.1" # Default Docker bridge IP on Linux | ||
| else | ||
| HOST_ADDR="host.docker.internal" | ||
| fi |
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.
Hardcoding the host address for Linux as 172.17.0.1 is not always reliable, as the Docker bridge network IP can vary. A more robust approach would be to dynamically determine the host's IP on the Docker network.
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
| HOST_ADDR="172.17.0.1" # Default Docker bridge IP on Linux | |
| else | |
| HOST_ADDR="host.docker.internal" | |
| fi | |
| if [[ "$OSTYPE" == "linux-gnu"* ]]; then | |
| # Try to dynamically find the docker bridge IP, fallback to a common default | |
| HOST_ADDR=$(ip -4 addr show docker0 | grep -oP 'inet \K[\d.]+' || echo "172.17.0.1") | |
| else | |
| HOST_ADDR="host.docker.internal" | |
| fi |
prompt-vault/frontend/vite.config.ts
Outdated
| export default defineConfig({ | ||
| plugins: [react()], | ||
| server: { | ||
| port: 5175, |
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.
This Vite config sets the development server port to 5175. However, other files in this PR, such as nginx-proxy/test-local.sh and nginx-proxy/MULTI_APP_SETUP.md, expect it to be on port 5176. This inconsistency can cause confusion and failures during local testing. Please align the port across all relevant files to 5176 for consistency.
| port: 5175, | |
| port: 5176, |
scripts/test-all-apps.sh
Outdated
| if [ -f "package.json" ]; then | ||
| echo " Testing frontend..." | ||
| if command -v bun >/dev/null 2>&1; then | ||
| if bun test --run >/tmp/prompt-vault-tests.log 2>&1 2>/dev/null; then |
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.
The command to run prompt-vault tests includes 2>/dev/null, which redirects stderr to null. This could suppress important error messages from the test runner, potentially hiding real test failures or configuration issues. It's better to let stderr be printed or logged to the file so that failures can be debugged.
| if bun test --run >/tmp/prompt-vault-tests.log 2>&1 2>/dev/null; then | |
| if bun test --run >/tmp/prompt-vault-tests.log 2>&1; then |
Replace frameborder="0" with CSS border: none; for HTML5 compliance. Fixes code review comment on PR #239.
Install wget along with gettext to support HEALTHCHECK instruction. Fixes code review comment on PR #239.
- Fix Linux Docker bridge IP detection (dynamically determine instead of hardcoding) - Align prompt-vault port to 5176 for consistency across all files - Remove stderr suppression in test script to allow proper error reporting Fixes code review comments on PR #239.
Replace frameborder="0" with CSS border: none; for HTML5 compliance. Fixes code review comment on PR #239.
Install wget along with gettext to support HEALTHCHECK instruction. Fixes code review comment on PR #239.
- Fix Linux Docker bridge IP detection (dynamically determine instead of hardcoding) - Align prompt-vault port to 5176 for consistency across all files - Remove stderr suppression in test script to allow proper error reporting Fixes code review comments on PR #239.
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.
Pull Request Overview
This PR introduces a comprehensive multi-app nginx proxy setup that unifies access to three applications (agentnav, prompt-vault, and cursor-ide) through a single entry point. The changes include a new prompt-vault frontend application with Supabase integration, nginx proxy configuration with routing for all apps, testing infrastructure, and CI/CD updates.
Key changes:
- New nginx proxy service with multi-app routing and landing page
- Prompt-vault frontend application (React/TypeScript with Supabase authentication)
- Terraform variables and outputs for proxy configuration
- Comprehensive testing scripts for local development
- CI/CD pipeline updates to build and deploy the proxy service
Reviewed Changes
Copilot reviewed 38 out of 40 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| terraform/variables.tf | Adds proxy region and container port variables |
| terraform/outputs.tf | Adds proxy service URL output |
| nginx-proxy/* | Complete nginx proxy implementation with multi-app routing, landing page, and documentation |
| prompt-vault/frontend/* | New React/TypeScript frontend with Supabase, Tailwind CSS, and comprehensive UI components |
| scripts/test-all-apps.sh | Testing script for all three applications |
| scripts/restart-prompt-vault.sh | Utility script for restarting prompt-vault |
| package.json | Updates testing library dependencies |
| .github/workflows/build.yml | Adds proxy service to CI/CD pipeline |
| export default defineConfig({ | ||
| plugins: [react()], | ||
| server: { | ||
| port: 5176, |
Copilot
AI
Nov 9, 2025
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.
Port mismatch detected. The vite.config.ts specifies port 5176, but scripts/restart-prompt-vault.sh references port 5175 (line 10, 15, 21). According to the project documentation (nginx-proxy/MULTI_APP_SETUP.md line 18 and START_SERVICES.md line 99), prompt-vault frontend should use port 5176. The restart script should be updated to match.
| echo 'export PORT=${PORT:-8080}' >> /docker-entrypoint.sh && \ | ||
| echo 'export AGENTNAV_BACKEND_URL=${AGENTNAV_BACKEND_URL:-${BACKEND_SERVICE_URL:-}}' >> /docker-entrypoint.sh && \ | ||
| echo 'export AGENTNAV_FRONTEND_URL=${AGENTNAV_FRONTEND_URL:-${FRONTEND_SERVICE_URL:-}}' >> /docker-entrypoint.sh && \ | ||
| echo 'export AGENTNAV_GEMMA_URL=${AGENTNAV_GEMMA_URL:-${GEMMA_SERVICE_URL:-_disabled_}}' >> /docker-entrypoint.sh && \ |
Copilot
AI
Nov 9, 2025
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.
Inconsistent whitespace/indentation. Line 24 has extra leading whitespace (8 spaces instead of 4) compared to surrounding lines (21-23, 25-28). This breaks the visual alignment of the shell script construction.
| echo 'export AGENTNAV_GEMMA_URL=${AGENTNAV_GEMMA_URL:-${GEMMA_SERVICE_URL:-_disabled_}}' >> /docker-entrypoint.sh && \ | |
| echo 'export AGENTNAV_GEMMA_URL=${AGENTNAV_GEMMA_URL:-${GEMMA_SERVICE_URL:-_disabled_}}' >> /docker-entrypoint.sh && \ |
|
|
||
| # Kill existing processes | ||
| pkill -f "vite.*prompt" 2>/dev/null || true | ||
| lsof -ti :5175 | xargs kill -9 2>/dev/null || true |
Copilot
AI
Nov 9, 2025
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.
Port mismatch. This script attempts to kill processes on port 5175, but the vite.config.ts and other documentation indicate prompt-vault should use port 5176. This will fail to kill the correct process.
| if lsof -i :5175 | grep -q LISTEN; then | ||
| echo "✅ Prompt Vault running on port 5175" |
Copilot
AI
Nov 9, 2025
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.
Port verification checks wrong port. Lines 21-26 verify port 5175, but should check port 5176 to match the vite.config.ts configuration.
Summary
This PR adds a thin Nginx proxy layer for routing requests to multiple applications (agentnav, prompt-vault, cursor-ide) through a single entry point.
Changes
Nginx Proxy Service
Prompt Vault Fixes
CI/CD Integration
Documentation
Testing
Related Issues
Deployment Notes
The proxy will be deployed to Cloud Run and serve as the main entry point for all applications. Service URLs are configured via environment variables.