Skip to content

turing-machines/BMC-UI

Repository files navigation

BMC-UI

BMC-UI is a web-based user interface for managing and configuring the BMC of a Turing Pi cluster.

Technologies Used

  • React - JavaScript library for building user interfaces
  • Tailwind CSS - Utility-first CSS framework
  • TanStack Router - Routing library for React applications
    • Handles route management and route protection
  • TanStack Query - Data fetching and caching library for React
  • react-i18next - Internationalization library for React
  • Vite - Fast build tool and development server
  • TypeScript - Typed superset of JavaScript

Getting Started

  1. Clone the repository:

    git clone https://github.com/turing-machines/BMC-UI.git
  2. Install dependencies:

    cd BMC-UI
    npm install
  3. Start the development server:

    There are multiple ways to run the development server:

    a. Connect to a local Turing Pi cluster (default):

    npm run dev

    This will connect to https://turingpi.local for the API by default.

    b. Connect to a specific Turing Pi cluster:

    If your Turing Pi cluster is using a different hostname, domain or IP address, you can specify it using the CLUSTER_URL environment variable:

    CLUSTER_URL=https://your-cluster.lan npm run dev

    or

    CLUSTER_URL=https://192.168.1.100 npm run dev

    c. Use bmcd-api-mock:

    If you want to use bmcd-api-mock as the API for development:

    • Clone and set up the bmcd-api-mock repository.

    • Run the mock server (usually on http://localhost:4460).

    • Start the BMC-UI development server with the CLUSTER_URL environment variable:

      CLUSTER_URL=http://localhost:4460 npm run dev
  4. Open your browser and visit http://localhost:5173 to see the application running.

Deployment

The deployment process for BMC-UI is automated using GitHub Actions. The version management is handled by the version field defined in the package.json file.

Whenever a pull request targeting the main branch is created and the package.json file is modified with an updated version, a new build is triggered automatically. Once the pull request is merged into the main branch, the version change will be detected, and the built files will be packaged into a tarball and released as an artifact on GitHub.

To deploy a new version:

  1. Create a new branch and update the version field in the package.json file following semantic versioning (e.g., 2.1.0, 2.1.1, 3.0.0).

  2. Commit the changes and push the branch to the repository.

  3. Open a pull request from the branch targeting the main branch.

  4. Review and merge the pull request into the main branch.

  5. GitHub Actions will automatically detect the version change, trigger a new build, and create a release with the tarball artifact.

  6. The release artifact can be downloaded and deployed to the target environment.

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvements, please open an issue or submit a pull request.

Please note that due to memory restrictions on the BMC, the final bundle size of the application cannot exceed 4MB. To ensure this limit is maintained, every pull request will report its bundle size, allowing us to track the bundle size over time. When contributing, please be mindful of the bundle size impact of your changes.

License

This project is licensed under the GNU General Public License v2.0.