- Introduction
- Installation Guide
- Usage
- API Routes
- File Structure
- Features
- Troubleshooting
- Contributing
This application is a web-based code editor that supports interaction with various programming languages, offers chat functionalities powered by AI, and integrates with Git for version control.
Before running the application, ensure you have the following installed:
- Python 3.x
- Git
- Flask
- Flask-SocketIO
- OpenAI API Key
-
Clone the Repository:
git clone <repository_url> cd <repository_name>
-
Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install Required Python Packages:
pip install -r requirements.txt
-
Install Frontend Dependencies: Ensure you navigate to the static folder and run:
npm install
-
Set Environment Variables: You will need to set the following environment variables:
export OPEN_ROUTER_KEY=<your_openai_api_key>
To start the application, execute the following command:
python app.py
Then, you can access the application in your web browser at http://localhost:5000
.
Once the application is running, you can:
- Select directories and files from the interface.
- Edit files in the code editor.
- Save and run your code (supports Python and C++).
- Chat with an AI assistant regarding the code you are editing.
- Use Git functionalities such as committing changes and pushing to a remote repository.
Route | Method | Description |
---|---|---|
/ |
GET | Render the main application page |
/browse_directory |
GET | Browse the current directory |
/select_directory |
POST | Select a directory to navigate into |
/file/<path:filepath> |
GET | Get content of the specified file |
/save |
POST | Save the content of the currently open file |
/run |
POST | Compile and run C++/Python code |
/chat |
POST | Interact with the AI chatbot |
/git_push |
POST | Push changes to the remote Git repository |
For an exhaustive list of API routes and their descriptions, refer to the source code or comments in the API functions in app.py
.
<repository_name>/
|-- app.py # Main application logic
|-- requirements.txt # List of Python package dependencies
|-- static/ # Frontend assets
| |-- script.js # JavaScript for frontend interaction
|-- templates/ # Templates for rendering HTML pages
|-- .editor_session/ # Session files for managing state
|-- manifest.json # Manifest file for PWA support
- Real-time Code Editing: Utilize a powerful code editor to write and edit your code.
- AI Support: Get assistance with code explanation and suggestions.
- File Management: Manage files and directories effortlessly, including creating, renaming, and deleting.
- Git Integration: Perform Git operations directly from the interface.
- Responsive UI: Adaptable layout for various screen sizes and devices.
- Flask fails to start: Ensure all dependencies are installed and the environment variables are set.
- C++ related issues: Ensure you have
g++
installed and properly set up in your system PATH.
Check the console for any error messages or logs that may help debug any issues during runtime.
Contributions are welcome! If you'd like to contribute:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Submit a pull request with a description of your changes.