Drona.ai is a Socratic code editor designed to foster deep understanding of code logic and prevent the practice of blindly pasting AI-generated solutions.
When a user attempts to paste a significant block of code (e.g., more than 25 lines), the editor locks. To unlock the functionality, the user must answer context-aware questions generated by an AI Mentor regarding the code they wish to paste. This mechanism ensures that the user comprehends the logic, security implications, and performance characteristics of the code before integrating it into the project.
- Paste Verification: detect large paste actions and temporarily lock the editor to prevent unverified code integration.
- Socratic Mentor: utilizing Anthropic Claude 3.5 Sonnet, the system generates relevant questions to test the user's understanding of the code.
- Builder Score: a scoring system to incentivize manual coding and understanding over copy-pasting. Steps are taken to penalize unverified pasting.
- Verification Override: users may choose to reject the paste action to revert the editor state and restore their score.
- Modern Interface: a dark-themed, professional interface designed for extended coding sessions.
- Frontend: React 19, Vite, TypeScript, Tailwind CSS v4, Monaco Editor.
- Backend: FastAPI (Python 3.11), Uvicorn, Anthropic API (Claude 3.5 Sonnet).
- Communication: Server-Sent Events (SSE) for real-time AI interaction.
- Node.js v18 or higher
- Python 3.11 or higher
- An Anthropic API Key (
ANTHROPIC_API_KEY)
-
Clone the Repository
-
Configure Environment Variables Copy the example environment file and add your API key:
cp .env.example .env # Open .env and set your ANTHROPIC_API_KEY -
Run the Application Execute the startup script to initialize the environment and start services:
./run.sh
This script will:
- Set up the Python virtual environment.
- Install necessary dependencies.
- Launch the frontend at
http://localhost:5173. - Launch the backend at
http://localhost:8000.
- Navigate to
http://localhost:5173. - Type code manually to observe the Builder Score increase.
- Paste the provided snippet from
structure/demo_paste_snippet.py. - Observe the editor lock mechanism.
- Answer the questions provided by the Mentor in the sidebar.
- Upon answering correctly, the editor will unlock.
- If necessary, use
Ctrl+Zto undo the paste and reset the state.
MIT License.