Skip to content

Generate improvements #2

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

Merged
merged 18 commits into from
Mar 4, 2025
Merged

Generate improvements #2

merged 18 commits into from
Mar 4, 2025

Conversation

shahariaazam
Copy link
Member

@shahariaazam shahariaazam commented Mar 4, 2025

This pull request introduces several significant changes to the project, focusing on Docker integration, environment configuration, and enhancements to the frontend application. Below is a summary of the most important changes:

Docker and Environment Configuration

  • .dockerignore: Added to exclude unnecessary files and directories from the Docker build context, improving build efficiency.
  • Dockerfile: Created a multi-stage Dockerfile to build and serve the application using Nginx, ensuring a production-ready deployment.
  • .github/workflows/docker-build.yml: Added a GitHub Actions workflow to automate Docker image builds and pushes to the container registry on specific triggers.
  • .env.example and .env.production: Added environment variable for backend API endpoint configuration. [1] [2]

Frontend Enhancements

  • README.md: Updated with detailed project information, installation instructions, and usage guidelines, including Docker usage.
  • src/App.tsx: Improved the header layout by adding a container for the toggle button and application name. [1] [2] [3]
  • src/api/index.ts: Updated API endpoint to use environment variable for backend API URL.
  • src/components/ModelControls.tsx: Integrated Auth0 for authentication, restricting access to model controls based on user authentication status. [1] [2] [3] [4] [5] [6] [7]

Dependency Updates

  • package.json: Added new dependencies for @auth0/auth0-react, @primer/octicons-react, and react-icons to enhance the application with authentication and additional UI icons.

Licensing and Metadata

  • LICENSE: Added MIT License to the project, ensuring open-source compliance.

These changes collectively enhance the project's deployment process, improve frontend capabilities, and ensure proper licensing and documentation.This pull request includes several changes to the Dockerfile, package.json, and various components in the src directory to enhance the application's build process, dependency management, and user interface.

Build Process Improvements:

  • Created a multi-stage build in the Dockerfile to optimize the image size and build process. This includes a build stage using node:20-alpine, installing dependencies, and building the application, followed by a production stage that uses the built assets and serves the application on port 3000.

Dependency Management:

  • Added new dependencies to package.json for improved functionality and UI components, including @auth0/auth0-react, @primer/octicons-react, and react-icons.

User Interface Enhancements:

  • Updated src/App.tsx to include a new container for the toggle and app name in the header, and added the application name "MCP Kit". [1] [2]
  • Modified src/components/ModelControls.tsx to integrate authentication checks using @auth0/auth0-react. This ensures that certain controls are only accessible to authenticated users. [1] [2] [3] [4]
  • Updated src/components/Sidebar.tsx to open the GitHub repository for help and support when the help button is clicked.
  • Refined src/components/sidebar/SidebarFooter.tsx to replace the help icon with a GitHub icon and update the button titles for clarity. [1] [2]

Configuration Cleanup:

  • Removed unnecessary build configuration from vite.config.ts to streamline the build process.

Grouped the sidebar toggle button and the app name "MCP Kit" into a shared container for improved layout structure. This enhances the header's design by providing a clearer and more informative user interface.
Added a conditional check using Auth0 to display model controls only for authenticated users. Unauthenticated users will see a message prompting them to log in. This ensures secure access to model settings.
Replaced the help icon with a GitHub icon linking to the repository and updated tooltips for better clarity. Modified dependencies to add `react-icons` and `@auth0/auth0-react` to enhance styling and authentication support. Cleaned up code for consistency and streamlined help functionality.
Eliminated the 'base' and 'build' options for a cleaner setup. This simplifies the configuration and relies on default behavior for output handling. Existing workflows may require adjustments to align with these changes.
This Dockerfile uses a multi-stage build to create and serve the app. It includes steps for installing dependencies, building the application, and running a lightweight production server. This setup ensures a streamlined and efficient containerization process.
Replaced hardcoded API URL with a configurable environment variable. Added `.env.example` for clarity and updated the `README` with setup instructions. Also included `.env` in `.gitignore` to protect sensitive data.
Expanded the README to include a comprehensive overview of the MCP Frontend, including features, architecture, setup instructions, contributing guidelines, and support resources. Improved documentation ensures clarity for users and contributors alike.
Corrected the formatting of the Vite link in the architecture section to ensure consistency in the documentation. This improves readability and maintains professional standards.
Introduce a Docker-based installation method alongside the standard setup process in the README. Included instructions for pulling the Docker image, running it, and configuring necessary environment variables. This complements the existing installation options for improved deployment flexibility.
Switch the production configuration from Serve to Nginx for improved performance and flexibility. Added custom Nginx configurations, environment variable injection script, and updated the Dockerfile for a multi-stage build. Introduced `.dockerignore` to streamline the Docker image build process.
Replaced "MY_APP_" with "MCP_" for environment variables to align with updated naming conventions. Adjusted `.env.production`, `env.sh`, and `README.md` accordingly to reflect the change. This ensures consistency across configuration and documentation.
Refactor Docker run command for better readability and update the environment variables section to clarify usage in production. These changes aim to enhance understanding and ease of setup for users.
Updated all references to MCP_BACKEND_API_ENDPOINT to VITE_MCP_BACKEND_API_ENDPOINT for consistency with Vite naming conventions. Adjusted related code, configuration files, and documentation accordingly.
Introduces a new workflow to automate Docker image building and pushing to GitHub Container Registry. The workflow triggers on pushes and pull requests to the main branch, leveraging caching and metadata extraction for efficient builds.
This update allows workflows to trigger Docker builds when version tags (e.g., v1.0.0) are pushed. Conditional logic was added to ensure proper tagging and pushing of images for both main and version-tag refs. This enhances automation for versioned releases while retaining existing behavior for the main branch.
@shahariaazam shahariaazam merged commit 0edf732 into main Mar 4, 2025
1 check passed
@shahariaazam shahariaazam deleted the development branch March 4, 2025 17:44
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