feat: Add AI Council Proxy UI and Docker configuration#17
Conversation
- 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.
There was a problem hiding this comment.
💡 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".
- 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.
- 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.
- 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.
| # Override if needed for different deployment scenarios | ||
| API_BASE_URL: ${API_BASE_URL} | ||
| ports: | ||
| - "${UI_PORT:-8080}:8080" |
There was a problem hiding this comment.
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.
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.
src/ui-server.tsto start the UI, connect to PostgreSQL/Redis, readAPI_BASE_URL/UI_PORT, and handle graceful shutdown.src/ui/interface.tsswitches to a long default API key and updates streaming/polling and config usage.Dockerfile.ui(multi-stage build, non-root user, healthcheck).uiservice indocker-compose.ymlwith DB/Redis env, port8080, healthcheck, and dependencies onpostgres,redis, andapi.database/schema.sqladdsapi_keys(with indexes,pgcrypto) and seeds a demo key; ensure index ondevils_advocate_logs.created_at.src/server.tsnow 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.