An Agentic AI document editor! (we're trying lol)
-
Install Docker and Docker Compose
-
Navigate to the backend directory:
cd backend -
Create your
.envfile based on.env.example:cp .env.example .env
-
Important: Update the following values in
.envwith secure credentials:POSTGRES_PASSWORD- Set a strong password for the databaseDATABASE_URL- Update the password in the connection string to match
Your
.envshould look like:# CORS Configuration CORS_ORIGINS=http://localhost:5173 CORS_CREDENTIALS=true CORS_METHODS=* CORS_HEADERS=* # Database credentials POSTGRES_USER=hyperwrite POSTGRES_PASSWORD=your_secure_password POSTGRES_DB=hyperwrite DATABASE_URL=postgresql+asyncpg://hyperwrite:your_secure_password@db:5432/hyperwrite
-
Start the Docker containers:
docker compose up -d
-
Verify the services are running:
docker compose ps
The project uses two inference servers (llama.cpp + CUDA) for different purposes:
| Server | Port | Model | Purpose |
|---|---|---|---|
| Embeddings | 8080 | nomic-embed-text-v1.5.Q8_0.gguf |
RAG knowledge base |
| Chat | 8081 | gemma-4-E2B-RotorQuant-Q8_0.gguf |
Agent completions |
- Place your GGUF model files in
backend/llms/models/ - Update
backend/docker-compose.ymlwith your model filenames - Restart:
docker compose up -d
View logs:
docker logs -f inference-embeddings
docker logs -f inference-chatThe backend runs via Docker by default. Use local setup only when:
- Debugging - Step-through debugging with an IDE
- Without Docker - If Docker is not available
- Understanding the stack - Useful for learning the backend architecture
-
Create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- Linux/macOS:
source venv/bin/activate - Windows:
venv\Scripts\activate
- Linux/macOS:
-
Install dependencies:
pip install -r requirements.txt
-
Run the development server:
uvicorn main:app --reload
This project uses SQLAlchemy 2.0 as the ORM with Alembic for database migrations. Both are included in requirements.txt.
Make sure your .env contains DATABASE_URL:
DATABASE_URL=postgresql+asyncpg://user:password@localhost:5432/dbname-
Generate a migration (after modifying models):
cd backend python3 -m alembic revision --autogenerate -m "Description of changes"
-
Apply migrations:
python3 -m alembic upgrade head
-
Rollback a migration:
python3 -m alembic downgrade -1
Models go in backend/db/models.py. Import Base from db.base:
from db.base import Base
class MyModel(Base):
__tablename__ = "my_table"If using Docker, the backend container has Alembic installed. Run:
docker compose exec backend python3 -m alembic upgrade headWindows:
- Download the installer from nodejs.org
- Run the installer and follow the prompts
- Install pnpm:
npm install -g pnpm
Ubuntu/Debian:
sudo apt update
sudo apt install nodejs npm
npm install -g pnpmFedora:
sudo dnf install nodejs npm
npm install -g pnpmNote: This project uses Tanstack Router for routing.
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
pnpm install
-
Create your environment file:
cp .env.example .env
-
Run the development server:
pnpm run dev
Work on a separate branch for each feature or fix. Use the format:
type/part-of-project/what-you-are-doing
Examples:
feat/backend/user-authenticationfix/frontend/editor-crashdocs/api/endpoints
Use Conventional Commits format:
type(scope): brief summary
Detailed description (optional)
Types:
feat- New featurefix- Bug fixdocs- Documentationrefactor- Code refactoring
Examples:
feat/backend: add user login endpoint
fix/frontend: resolve editor crash on save
docs(api): update authentication docs
- Submit a pull request to the
mainbranch - Wait for review and approval from another contributor
- Resolve any feedback before merging
- Autocompletion with toggle - Tab to accept, Escape to dismiss, debounced streaming LLM fetch
- LaTeX/Math support - Inline (
$) and block ($ $) math, AMSLaTeX, amssymb, matrices (low priority: multiline matrices) - Image support - Local server storage per document, Base64 inline, safety checks (size limit, MIME validation), ordered insertion
- Table support - TipTap table extension with resizing and styling
- Focus Mode - Toggle distraction-free mode, dim surroundings, center doc
- Word Count / Reading Time - Bottom bar with live stats
- Find & Replace - Ctrl+F inline UI with match highlighting
- Code Blocks - Syntax highlighting with lowlight
- Callouts/Admonitions - Markdown-style > [!note] blocks
- Export to PDF - Browser print API integration
- Smart Quotes & Typography - Auto-convert quotes, proper dashes, ellipses via typography plugin
- Placeholder Text - Empty document prompt
- Agent Actions Menu - Select agent + action, stream result to document
- Chat Panel - WebSocket sidebar with streaming messages
- Custom Agents - DB-backed agent definitions with RAG folder linking
- MCP Integration - Tool definitions for web search, RAG lookup
- Document auto-save interval - Auto-save every 30s while document is dirty, debounced
- Error boundary components - React Suspense boundaries around async route components to prevent full-page crashes
- API retry logic with exponential backoff - Service layer with automatic retry (3 attempts, 1s/2s/4s delays)
- JWT refresh token rotation - New endpoint POST /auth/refresh to issue new access token from refresh token, old token invalidated
- Knowledge Base file operations (copy, move between folders)
- User documents folder management (create, rename, delete folders)
- Unit tests for backend services
- Docker healthchecks for inference servers
- Rate limiting on LLM endpoints
- Sentry frontend error monitoring
- Real-time collab (Y.js)
- Document versioning
- TikZ diagram rendering
