DocGen is a AI Project that generates complete professional documentation for any programming code or project file.
It works completely offline using:
- Ollama
- Qwen2.5-Coder Model
- Django REST Backend
- React + Tailwind Frontend
- PDF Export Support
- Doc Export Support
✅ Paste code and generate documentation instantly
✅ Upload code files (.py, .cpp, .java, .js)
✅ AI-generated structured Markdown documentation
✅ Export documentation as a perfectly aligned PDF
✅ Modern SaaS-grade UI (Gemini-level design)
✅ Fully Offline (No OpenAI / No Gemini API needed)
| Layer | Technology |
|---|---|
| Frontend | React, Tailwind CSS, Framer Motion |
| Backend | Django, Django REST Framework |
| AI Model | Ollama + Qwen2.5-Coder:7B |
| PDF Generator | ReportLab (Platypus Engine) |
# Clone and enter repo
git clone https://github.com/SanjayMarathi/DocGen.git
cd DocGenollama pull qwen2.5-coder:7b
ollama serve
cd backend
python -m venv venv
.\venv\Scripts\activate
pip install django djangorestframework django-cors-headers requests reportlab
python manage.py migrate
python manage.py runserver 8000
The venv activation above for powershell needs to be changed to venv/bin/activate if using bash.
cd frontend
npm install
npm start
-
Node.js + npm (for frontend)
-
Python 3.10+ (for backend)
-
Ollama installed and running locally (project uses
qwen2.5-coder:7b) -
API endpoints:
- POST
http://127.0.0.1:8000/api/generate/(streaming documentation) - POST
http://127.0.0.1:8000/api/pdf/(returns generated PDF)
- POST
The backend calls Ollama at http://localhost:11434.
- Paste or upload code in the UI → Click Generate Documentation.
- Click EXPORT PDF to download the generated PDF.
Model not responding. Check Ollama.→ Ensure Ollama is running and the model is available.- If the frontend or backend use different host/ports, update
frontend/src/App.jsandbackend/generator/views.pyaccordingly. - CORS is already enabled in
backend/settings.py(CORS_ALLOW_ALL_ORIGINS = True).
If you want npm start to start the frontend from the repo root, add this script to the root package.json under scripts:
"scripts": {
"start": "npm --prefix frontend start"
}