Korrektor is an experimental prototype developed in just 30 minutes to explore the capabilities of modern tools paired with GenAI. This prototype is intended solely for demonstration purposes and will not undergo further development. It serves as a proof-of-concept to showcase how quickly and easily a basic code-refactoring application can be created.
An AI Code Assistant built with Streamlit, Streamlit Monaco, and Ollama.
Korrektor is a web-based AI Code Assistant designed to refactor and optimize your code. It leverages the power of Ollama's language model to enhance code readability, efficiency, and maintainability, following Clean Code principles. The intuitive interface allows users to input code snippets and receive refactored code instantly.
- Integrated Code Editor: Write or paste code using the Monaco editor embedded in the app.
- AI-Powered Refactoring: Utilize Ollama's AI capabilities to improve your code.
- User-Friendly Interface: Interactive web application built with Streamlit.
Ensure you have Python 3.12 or higher installed on your system.
-
Clone the Repository
git clone https://github.com/trbndev/korrektor.git cd korrektor
-
Create a Virtual Environment
python -m venv venv
-
Activate the Virtual Environment
-
On macOS/Linux:
source venv/bin/activate
-
On Windows:
venv\Scripts\activate
-
-
Install Dependencies
pip install -r requirements.txt
Alternatively, if using
pyproject.toml
:pip install .
-
Run the Application
streamlit run app.py
-
Access the App
The app will open in your default web browser at
http://localhost:8501/
. -
Refactor Your Code
- Write or paste your code into the Monaco editor labeled "YOUR CODE HERE".
- Click the "Process code" button to refactor.
- View the refactored code displayed below the editor.
- Ollama (>=0.4.4): Language model for code refactoring.
- Streamlit (>=1.41.0): Web application framework.
- Streamlit-Monaco (>=0.1.3): Integration of Monaco code editor into Streamlit.
Contributions are welcome! Please fork the repository and submit a pull request with your improvements.
This project is licensed under the MIT License. See the LICENSE file for details.
- Ollama for providing the language model.
- Streamlit for the web application framework.
- Streamlit-Monaco for the Monaco editor integration.