Skip to content

feat: Add AI Council Proxy UI and Docker configuration#17

Merged
alias8818 merged 4 commits into
mainfrom
feat/add-ui-docker-support
Nov 24, 2025
Merged

feat: Add AI Council Proxy UI and Docker configuration#17
alias8818 merged 4 commits into
mainfrom
feat/add-ui-docker-support

Conversation

@alias8818
Copy link
Copy Markdown
Owner

@alias8818 alias8818 commented Nov 24, 2025

  • Introduced a new UI service in docker-compose.yml with environment variables for database and Redis configuration.
  • Added Dockerfile.ui for building the UI with multi-stage setup, including health checks.
  • Implemented the UI server entry point in src/ui-server.ts, establishing connections to PostgreSQL and Redis.
  • Enhanced UserInterface class to use a longer default API key for testing purposes.
  • Created a new API keys table in the database schema for authentication management.

This update sets up a complete UI service for the AI Council Proxy, improving user interaction and system integration.


Note

Adds a Dockerized UI service, introduces an API key storage table with seed data, and refines server/UI configuration and shutdown behavior.

  • UI:
    • New server: src/ui-server.ts to start the UI, connect to PostgreSQL/Redis, read API_BASE_URL/UI_PORT, and handle graceful shutdown.
    • Interface updates: src/ui/interface.ts switches to a long default API key and updates streaming/polling and config usage.
  • Docker:
    • New image: Dockerfile.ui (multi-stage build, non-root user, healthcheck).
    • Compose: Add ui service in docker-compose.yml with DB/Redis env, port 8080, healthcheck, and dependencies on postgres, redis, and api.
  • Database:
    • New table: database/schema.sql adds api_keys (with indexes, pgcrypto) and seeds a demo key; ensure index on devils_advocate_logs.created_at.
  • API Server:
    • Shutdown handling: src/server.ts now differentiates graceful vs error shutdown and sets exit codes accordingly.

Written by Cursor Bugbot for commit 6fbf08e. This will update automatically on new commits. Configure here.

- Introduced a new UI service in docker-compose.yml with environment variables for database and Redis configuration.
- Added Dockerfile.ui for building the UI with multi-stage setup, including health checks.
- Implemented the UI server entry point in src/ui-server.ts, establishing connections to PostgreSQL and Redis.
- Enhanced UserInterface class to use a longer default API key for testing purposes.
- Created a new API keys table in the database schema for authentication management.

This update sets up a complete UI service for the AI Council Proxy, improving user interaction and system integration.
@alias8818 alias8818 requested a review from Copilot November 24, 2025 00:23
@alias8818 alias8818 self-assigned this Nov 24, 2025
Comment thread src/ui/interface.ts
Comment thread src/ui/interface.ts
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread database/schema.sql
- Added the pgcrypto extension to support the gen_random_uuid() function for generating UUIDs.
- Updated the API keys table definition to utilize the new UUID generation method for the primary key.

This enhancement improves the database schema by ensuring unique identifiers for API keys.
Comment thread docker-compose.yml
- Introduced a seed entry for a demo API key in the database schema to facilitate development and testing.
- Added an index on the 'active' column in the api_keys table for improved query performance.

This enhancement supports easier testing and development workflows by providing a pre-configured API key.
Comment thread src/ui-server.ts
- Updated shutdown functions in both src/server.ts and src/ui-server.ts to differentiate between normal and error-induced shutdowns.
- Added an optional parameter to the shutdown function to log appropriate messages and exit codes based on the shutdown reason.
- Ensured that uncaught exceptions and unhandled rejections trigger the error shutdown process.

This improvement enhances the robustness of the application by providing clearer logging and proper exit codes during shutdown scenarios.
@alias8818 alias8818 merged commit 6fbf08e into main Nov 24, 2025
1 check passed
Comment thread docker-compose.yml
# Override if needed for different deployment scenarios
API_BASE_URL: ${API_BASE_URL}
ports:
- "${UI_PORT:-8080}:8080"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Port configuration mismatch in UI service

The UI_PORT environment variable is passed to the container, allowing the UI server to listen on a configurable port, but the Docker port mapping always forwards to container port 8080. If UI_PORT is set to a different value (e.g., 9000), the container listens on 9000 while Docker forwards to 8080, causing connection failures. The health check also hardcodes port 8080, which would fail if UI_PORT differs. The container should always listen on a fixed port internally.

Additional Locations (1)

Fix in Cursor Fix in Web

@alias8818 alias8818 review requested due to automatic review settings March 23, 2026 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant