Skip to content

greg-ogs/controller-ui-with-flask

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Alignment System UI

This project is a Flask-based web application that provides a simple user interface to run and monitor a background controller process. The controller process is executed in a separate thread and its output is streamed in real time to the UI using Server-Sent Events (SSE).

Features

  • Start Controller Process: Launch the controller process with a single click. The process runs in the background.
  • Live Log Streaming: View real-time logs generated by the controller process.
  • Responsive UI: The interface uses CSS for styling and is mobile-friendly.

Project Structure

Installation

  1. Clone the Repository:

    git clone <repository_url>
    cd AlignmentSystemUI
  2. Create and Activate a Virtual Environment (optional but recommended):

    python -m venv .venv
    .venv\Scripts\activate  # On Windows
    source .venv/bin/activate  # On macOS/Linux
  3. Install Dependencies:

    This project requires Flask. Install it using pip:

    pip install flask

Running the Application

  1. Start the Flask Application:

    Run the application by executing the following command in your terminal:

    python app.py
  2. Access the UI:

    Open your web browser and navigate to http://127.0.0.1:5000/ to view the main page.
    Click the Start controller button on the home page to run the controller process.
    In the controller view page, click Show Logs to view live output from the process.

How It Works

  • The main Flask application (app.py) uses threading to run controller.py as a background process.
  • The output of the controller process is collected and stored in a shared log buffer.
  • An SSE (Server-Sent Events) endpoint (/stream) streams the log data to the browser, where client-side JavaScript updates the log view in real time.

Troubleshooting

  • Virtual Environment Issues: Make sure you have activated the virtual environment if you are using one.

License

This project is provided as-is, without any warranty. You are free to modify and distribute it for your own use.

Acknowledgments

  • Developed using Flask.
  • Styled with a custom CSS file.

Happy coding!

About

Flask application as UI for controller algorithms.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors