|
| 1 | +# CLAUDE.md |
| 2 | + |
| 3 | +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. |
| 4 | + |
| 5 | +## Project Overview |
| 6 | + |
| 7 | +Inquiro is an AI-powered research discovery platform that matches user research interests with relevant scientific papers using semantic ranking. It uses SPECTER2 embeddings for paper similarity and pgvector for vector search. |
| 8 | + |
| 9 | +## Development Commands |
| 10 | + |
| 11 | +### Database |
| 12 | +```bash |
| 13 | +docker compose up -d # Start PostgreSQL with pgvector |
| 14 | +``` |
| 15 | + |
| 16 | +### Backend (from /backend directory) |
| 17 | +```bash |
| 18 | +pip install -r requirements.txt |
| 19 | +pip install -r requirements-dev.txt # Includes ruff and pre-commit |
| 20 | +pre-commit install # Setup git hooks for linting |
| 21 | +uvicorn app.main:app --reload # Start dev server on :8000 |
| 22 | +``` |
| 23 | + |
| 24 | +Requires `dev.env` file (copy from `.env.example`). |
| 25 | + |
| 26 | +### Frontend (from /frontend directory) |
| 27 | +```bash |
| 28 | +npm install |
| 29 | +npm run dev # Start Vite dev server on :5173 |
| 30 | +npm run lint # ESLint check |
| 31 | +npm run lint:fix # ESLint fix |
| 32 | +npm run format # Prettier |
| 33 | +npm run build # Production build |
| 34 | +``` |
| 35 | + |
| 36 | +### API Client Generation |
| 37 | +```bash |
| 38 | +cd openapi |
| 39 | +python generate.py # Regenerates frontend/src/api/ from OpenAPI spec |
| 40 | +``` |
| 41 | +Requires Docker. Generates TypeScript Axios client from FastAPI OpenAPI schema. |
| 42 | + |
| 43 | +## Architecture |
| 44 | + |
| 45 | +### Backend (FastAPI + SQLAlchemy async) |
| 46 | +- `app/main.py` - FastAPI app entry point, registers all routers |
| 47 | +- `app/core/config.py` - Settings via pydantic-settings (loads from `dev.env`) |
| 48 | +- `app/core/database.py` - Async SQLAlchemy engine, session factory, Base model |
| 49 | +- `app/routes/` - API endpoint handlers (auth, users, papers, projects, search) |
| 50 | +- `app/services/` - Business logic layer |
| 51 | +- `app/repositories/` - Database access layer |
| 52 | +- `app/models/` - SQLAlchemy ORM models |
| 53 | +- `app/schemas/` - Pydantic DTOs (*_dto.py) |
| 54 | +- `app/llm/embeddings/specter2.py` - SPECTER2 embeddings for semantic paper search |
| 55 | +- `app/llm/openai/` - OpenAI integration for paper summaries |
| 56 | +- `ingestion/` - Scripts for ingesting papers from arXiv |
| 57 | + |
| 58 | +Database: PostgreSQL 18 with pgvector extension for vector similarity search. |
| 59 | + |
| 60 | +### Frontend (Vue 3 + TypeScript) |
| 61 | +- Uses Composition API with `<script setup>` |
| 62 | +- `src/api/` - Auto-generated Axios client from OpenAPI (do not edit manually) |
| 63 | +- `src/services/` - Service wrappers around API client |
| 64 | +- `src/stores/` - Pinia stores with persistence (auth uses sessionStorage) |
| 65 | +- `src/components/` - Atomic design: atoms, molecules, organisms, templates |
| 66 | +- `src/pages/` - Route-level page components |
| 67 | +- `src/composables/` - Reusable composition functions (useTheme, useScrollToTop) |
| 68 | +- UI: Vuetify 3 + Tailwind CSS + Lucide icons |
| 69 | + |
| 70 | +### API Communication |
| 71 | +Frontend API types are generated from backend OpenAPI schema. When backend endpoints change: |
| 72 | +1. Update backend routes/schemas |
| 73 | +2. Run `python openapi/generate.py` to regenerate frontend types |
| 74 | + |
| 75 | +## Code Style |
| 76 | + |
| 77 | +### Backend |
| 78 | +- Ruff for linting and formatting (configured in pyproject.toml) |
| 79 | +- Line length: 100 characters |
| 80 | +- Pre-commit hooks run ruff on commit |
| 81 | + |
| 82 | +### Frontend |
| 83 | +- ESLint + Prettier |
| 84 | +- Husky + lint-staged for pre-commit hooks |
0 commit comments