[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-80009":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":8,"htmlUrl":8,"language":9,"languages":8,"totalLinesOfCode":8,"stars":10,"forks":11,"watchers":12,"openIssues":12,"contributorsCount":13,"subscribersCount":13,"size":13,"stars1d":13,"stars7d":13,"stars30d":12,"stars90d":13,"forks30d":13,"starsTrendScore":13,"compositeScore":14,"rankGlobal":8,"rankLanguage":8,"license":8,"archived":15,"fork":15,"defaultBranch":16,"hasWiki":17,"hasPages":15,"topics":18,"createdAt":8,"pushedAt":8,"updatedAt":19,"readmeContent":20,"aiSummary":21,"trendingCount":13,"starSnapshotCount":13,"syncStatus":22,"lastSyncTime":23,"discoverSource":24},80009,"async-document-processing","thehimel\u002Fasync-document-processing","thehimel",null,"Python",70,6,1,0,36.64,false,"main",true,[],"2026-06-12 04:01:26","# Core\n\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.14+-3776AB?logo=python&logoColor=white)](https:\u002F\u002Fwww.python.org\u002F)\n[![FastAPI](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FFastAPI-009688?logo=fastapi&logoColor=white)](https:\u002F\u002Ffastapi.tiangolo.com\u002F)\n[![Pydantic](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPydantic-E92063?logo=pydantic&logoColor=white)](https:\u002F\u002Fdocs.pydantic.dev\u002F)\n[![SQLAlchemy](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSQLAlchemy-1a1a1a?logo=sqlalchemy&logoColor=white)](https:\u002F\u002Fwww.sqlalchemy.org\u002F)\n[![Alembic](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FAlembic-Migrations-000000?logo=alembic&logoColor=white)](https:\u002F\u002Falembic.sqlalchemy.org\u002F)\n[![PostgreSQL](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPostgreSQL-4169E1?logo=postgresql&logoColor=white)](https:\u002F\u002Fwww.postgresql.org\u002F)\n[![uv](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fuv-Package%20Manager-00C853)](https:\u002F\u002Fdocs.astral.sh\u002Fuv\u002F)\n[![Ruff](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FRuff-linter-FFE873?logo=ruff&logoColor=000)](https:\u002F\u002Fdocs.astral.sh\u002Fruff\u002F)\n[![Vercel](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVercel-Deploy-000000?logo=vercel&logoColor=white)](https:\u002F\u002Fvercel.com\u002F)\n\n## System Diagram\n\n![System Diagram](assets\u002Fsystem-diagram-v2.png)\n\nFor ingestion scaling decisions and the production upload pattern, see\n[Document Ingestion Architecture](docs\u002Farchitecture\u002Fdocument-ingestion.md).\n\n## Tech Stack\n\n- **Framework:** FastAPI\n- **Database:** PostgreSQL (async via asyncpg)\n- **ORM:** SQLAlchemy 2.0 (async)\n- **Auth:** Authlib (Google OAuth), JWT in httpOnly cookie\n- **Rate limiting:** slowapi\n\n## Features\n\n- **Auth** — Google OAuth, session cookie, logout\n- **Users** — `GET \u002Fme`; admin CRUD for users\n\n## Prerequisites\n\n- Python 3.14+\n- PostgreSQL\n- Docker (optional, for running PostgreSQL)\n\n## Quick Start\n\n### 1. Clone and install\n\n```shell\nuv sync\n```\n\n### 2. Configure environment\n\nCopy `.env.example` to `.env` and set required variables:\n\n```shell\ncp .env.example .env\n```\n\nRequired: `POSTGRES_USER`, `POSTGRES_PASSWORD`, `POSTGRES_DB`, `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET`, `JWT_SECRET_KEY`, `SESSION_SECRET_KEY`. Generate secrets with `openssl rand -hex 32`.\n\n### 3. Start PostgreSQL\n\n```shell\ndocker compose up -d\n```\n\n### 4. Run migrations\n\n```shell\nalembic upgrade head\n```\n\n### 5. Start the API\n\n```shell\nuv run uvicorn app.main:app --reload\n```\n\nAPI: http:\u002F\u002Flocalhost:8000  \nDocs: http:\u002F\u002Flocalhost:8000\u002Fdocs\n\n## Commands\n\n| Command | Purpose |\n|---------|---------|\n| `uv sync` | Install dependencies (from pyproject.toml) |\n| `uv run uvicorn app.main:app --reload` | Run API (dev) |\n| `alembic upgrade head` | Apply migrations |\n| `alembic revision --autogenerate -m \"message\"` | Create migration |\n| `pytest` | Run tests |\n| `pytest -n auto` | Run tests in parallel (pytest-xdist) |\n| `pytest --drop-test-db` | Run tests and drop test DB after |\n| `ruff check .` | Lint |\n| `ruff format .` | Format |\n\nSee [docs\u002Fcommands.md](docs\u002Fcommands.md) for Docker, pre-commit, and more.\n\n## API Overview\n\nInteractive API docs: http:\u002F\u002Flocalhost:8000\u002Fdocs\n\n## Testing\n\nTests use a separate DB (`{postgres_db}_test`). Migrations run automatically before tests.\n\n```shell\npytest -v\npytest -n auto   # Parallel execution (pytest-xdist)\n```\n\nUnit, integration, E2E, security, and smoke tests. See [docs\u002Fcommands.md](docs\u002Fcommands.md#pytest) for Pytest commands.\n","这个项目是一个基于FastAPI框架构建的异步文档处理系统。它使用了Python 3.14+、PostgreSQL（通过asyncpg实现异步）、SQLAlchemy 2.0（支持异步操作）等技术栈，提供了用户认证（包括Google OAuth和JWT cookie管理）、用户信息查询以及管理员对用户的增删改查等功能。此外，项目还集成了限流功能以保护后端服务。适用于需要高效处理大量文档上传与管理的应用场景，如内容管理系统或在线协作平台。",2,"2026-06-11 03:58:53","CREATED_QUERY"]