Tekshila is an AI-powered application that generates technical documentation (like README files) and adds contextual comments to source code. It features a modern web frontend built with Vite and a FastAPI backend, with GitHub integration for creating pull requests and AI-driven code quality analysis.
- 📄 README Generator: Automatically generate detailed README files from your codebase.
- 💬 Code Commenting: Add helpful and contextual comments to source code.
- 🧪 Code Quality Analysis: Identify code smells, security issues, performance bottlenecks, and best practices.
- 🔄 GitHub Integration: Create pull requests directly with your documentation or annotated code.
- 🌐 Modern Web Interface: Clean, responsive frontend built with Vite.
- 🚀 FastAPI Backend: High-performance REST API backend.
- 🧠 Powered by Gemini API for intelligent and language-aware code processing.
- Frontend: Modern web interface (Vite + Vanilla JS)
- Backend: FastAPI REST API server
- AI Engine: Google Gemini API for code analysis and generation
- Version Control: GitHub API integration
-
Clone the repository:
git clone https://github.com/your-username/tekshila.git cd tekshila -
Install Python dependencies: Make sure you have Python 3.8+ installed, then:
pip install -r requirements.txt
-
Install Node.js dependencies:
npm install
-
Configure environment variables: Create a
.envfile with the following:GOOGLE_API_KEY=your_gemini_api_key GEMINI_API_URL=https://generativelanguage.googleapis.com/v1beta/models/gemini-2.0-flash:generateContent GEMINI_API_MODEL=gemini-2.0-flash GITHUB_TOKEN=your_github_token_here STREAMLIT_PORT=8501 VITE_PORT=3000 API_PORT=8000 API_BASE_URL=http://localhost:8000
npm startThis will start both the FastAPI backend (port 8000) and Vite frontend (port 3000) simultaneously.
Start the FastAPI backend:
python api_bridge.pyStart the Vite frontend (in another terminal):
npm run devnpm run build
npm run start:prod- Frontend: http://localhost:3000
- API Backend: http://localhost:8000
- API Documentation: http://localhost:8000/docs
- API Health Check: http://localhost:8000/health
-
Generate Documentation:
- Upload one or more code files (or a ZIP).
- Choose whether to generate a README or add comments.
- Provide a project name and optional instructions.
- Download results or push directly to GitHub.
-
GitHub Integration:
- Authenticate with your GitHub token.
- Select a repository and branch.
- Create a PR with the newly generated documentation.
-
Code Quality Analysis:
- Upload a file to receive detailed analysis and improvement suggestions from the AI.
The app uses Gemini's large language model to analyze and understand code. Ensure you set up your API key and endpoint in the .env file.
- Tekshila uses PyGithub for GitHub operations.
- Your personal access token should have
reposcope to allow for PR creation.
.
├── api_bridge.py # FastAPI backend server
├── main.py # Legacy Streamlit UI (can be removed)
├── core.py # Code processing and Gemini interaction
├── code_quality.py # AI-driven code quality analysis
├── github_integration.py # GitHub API integration
├── index.html # Main frontend HTML
├── script.js # Frontend JavaScript logic
├── styles.css # Frontend styling
├── vite.config.js # Vite configuration
├── package.json # Node.js dependencies and scripts
├── requirements.txt # Python dependencies
├── .env # API credentials (not committed)
├── .gitignore
└── LICENSEPOST /api/generate-docs- Generate documentation from code filesPOST /api/generate-docs-advanced- Enhanced documentation generationPOST /api/upload-files- Upload and process code files
POST /api/github/connect- Connect to GitHub with tokenPOST /api/github/validate-token- Validate GitHub tokenGET /api/github/repos?session_id=- Get user repositoriesGET /api/github/branches?session_id=&repo=- Get repository branchesPOST /api/github/create-pr- Create pull request
POST /api/analyze-quality- Analyze code quality with AI
GET /health- Health checkGET /api/supported-files- Get supported file typesGET /docs- API documentation (Swagger UI)
To extend the application:
- Backend: Modify
api_bridge.pyto add new endpoints - Frontend: Edit
script.jsandstyles.cssfor UI changes - AI Logic: Update
core.pyandcode_quality.pyfor AI functionality - GitHub Features: Extend
github_integration.pyfor more GitHub operations
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.