| Requirement | Version | Notes |
|---|---|---|
| Python | 3.11+ | Required for backend |
| uv | latest | Python package manager; replaces pip/venv |
| Node.js | 22.12+ LTS | Required for frontend |
| npm | bundled with Node | |
| Supabase account | — | Free tier works; provides PostgreSQL + Storage |
| OpenAI API key | — | Optional, enables AI features |
Install uv: https://docs.astral.sh/uv/getting-started/installation/
git clone <repo-url>
cd researchosCreate backend/.env:
OPENAI_API_KEY=sk-...
SUPABASE_URL=https://<project-ref>.supabase.co
SUPABASE_KEY=<anon-key>SUPABASE_URL: found in your Supabase project Settings > API > Project URL.SUPABASE_KEY: the "anon" (publishable) key from Settings > API > Project API keys. Do not use the service role key.
This file is in .gitignore and must never be committed.
Run all migration files in order in the Supabase SQL editor:
backend/migrations/001_init.sql
backend/migrations/002_add_paper_urls.sql
backend/migrations/002_library_id.sql
backend/migrations/003_notes.sql
backend/migrations/003_add_links.sql
backend/migrations/003_auto_notes.sql
backend/migrations/004_chat_messages.sql
backend/migrations/004_website_notes.sql
backend/migrations/005_paper_texts.sql
backend/migrations/006_chat_suggestions.sql
backend/migrations/007_website_chat.sql
... (continue through the latest migration file)
001_init.sql creates all base tables, disables RLS on all tables, and sets up the pdfs Storage bucket with public access policies. Each subsequent migration file adds columns, tables, or indexes.
To find the latest migration, list backend/migrations/ sorted by name.
cd backend
uv syncThis creates a .venv and installs all dependencies from uv.lock.
cd frontend
npm installFrom the repository root, run both development servers in one terminal.
node dev.mjsOpen http://localhost:5173. The API docs are at http://127.0.0.1:8000/docs. Press Ctrl+C to stop both servers.
You can also run each service in its own terminal.
cd backend
uv run uvicorn app:app --reload --port 8000The --reload flag watches for source file changes and restarts automatically.
cd frontend
npm run devVite proxies all /api requests to http://localhost:8000, so there are no CORS issues in development.
Open http://localhost:5173 in your browser.
On startup, backend/app.py calls seed_data(). This function checks whether each Supabase table is empty and inserts seed records from a built-in SEED dict if so. The seed data creates:
- A default library
- A few sample collections
- A few sample papers (with real arXiv metadata)
- Sample workflow catalog entries
After the first run, seed data is not re-inserted (each check is "empty?" before inserting).
- The Vite proxy in
frontend/vite.config.jsforwards all/api/*requests tohttp://localhost:8000. This means you can call/api/papersfrom the browser and it routes to the FastAPI backend. - Backend auto-reload (
--reload) restarts on any.pyfile change underbackend/. - Frontend HMR (Vite) updates the browser on any
.jsx/.js/.csschange underfrontend/src/. - PDF files are stored in Supabase Storage (
pdfsbucket). The bucket is created by001_init.sql. No local file system is used for PDFs. - LLM model preferences are persisted to
backend/data/llm_settings.json. This file is created automatically on first use.
| Variable | Required | Description |
|---|---|---|
OPENAI_API_KEY |
For AI features | Enables copilot chat, note generation, metadata extraction, agent workflows, and embeddings |
SUPABASE_URL |
Yes | PostgreSQL + Storage endpoint |
SUPABASE_KEY |
Yes | Anon key for client-side Supabase access |
Set SUPABASE_URL and SUPABASE_KEY in backend/.env or in the shell environment before starting the backend. The app uses python-dotenv to load .env at startup.