An intelligent document and spreadsheet workspace combining UniverJS with Gemini LLM to translate natural language prompts into structured document and sheet mutations in real-time.
DocAI bridges conversational AI with interactive document and spreadsheet canvases. Instead of manually editing formulas, formatting cells, or structuring reports, users express their intent in natural language. DocAI's backend interprets the context and generates deterministic Univer mutations (commandId, params, app_context) that execute directly on the client canvas.
- 📊 Natural Language to Sheet Mutations: Automatically format ranges, insert rows, compute aggregations, and manipulate cells via structured JSON schemas.
- ⚡ Gemini-Powered Command Translation: Translates user intent into validated
UniverCommandpayloads with strict Pydantic schemas. - 🎨 UniverJS Interactive Workspace: High-performance canvas for rich text documents and spreadsheets.
- 🐳 Docker-Ready Fullstack Architecture: Containerized FastAPI backend, Vue 3 + Vite frontend, and PostgreSQL service.
docAI/
├── backend/ # FastAPI REST API & Gemini AI Service
│ ├── app/
│ │ ├── api/v1/routes.py # AI command translator & health endpoints
│ │ ├── core/config.py # Environment & settings configuration
│ │ ├── crud/ # Database operations
│ │ ├── db/ # Session & database initialization
│ │ ├── models/ # SQLAlchemy database models
│ │ └── schemas/ # Pydantic validation schemas
│ ├── Dockerfile
│ └── requirements.txt
├── frontend/ # Vue 3 + Vite + UniverJS Workspace
│ ├── src/
│ │ ├── App.vue # Core application layout
│ │ ├── views/ # Sheet and document views
│ │ └── router/ # Navigation routing
│ ├── package.json
│ └── vite.config.ts
├── docker-compose.yml # Multi-container orchestration
└── README.md
cp backend/.env.example backend/.envAdd your Google Gemini API key to backend/.env:
GEMINI_API_KEY="your-gemini-api-key"docker-compose up --build- Frontend Workspace:
http://localhost:3000 - FastAPI API & Docs:
http://localhost:8000/docs
cd backend
python -m venv venv
# On Windows:
.\venv\Scripts\activate
# On Unix:
source venv/bin/activate
pip install -r requirements.txt
uvicorn app.main:app --reload --port 8000cd frontend
npm install
npm run devMIT License