{"id":50671321,"url":"https://github.com/thehimel/fast-auth","last_synced_at":"2026-06-08T11:05:19.487Z","repository":{"id":358574109,"uuid":"1241919473","full_name":"thehimel/fast-auth","owner":"thehimel","description":"Production-ready FastAPI auth API starter: Google OAuth, secure JWT httpOnly cookies, user management, RBAC, async Postgres, and Alembic migrations.","archived":false,"fork":false,"pushed_at":"2026-05-18T01:57:51.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-18T03:47:54.607Z","etag":null,"topics":["alembic","api","asyncio","authentication","authorization","backend","boilerplate","cookie-auth","fastapi","google-oauth","jwt","oauth2","postgresql","pytest","python","rate-limiting","rbac","sqlalchemy","starter-template","user-management"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thehimel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-05-18T01:02:22.000Z","updated_at":"2026-05-18T01:57:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/thehimel/fast-auth","commit_stats":null,"previous_names":["thehimel/fast-auth"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/thehimel/fast-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehimel%2Ffast-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehimel%2Ffast-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehimel%2Ffast-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehimel%2Ffast-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thehimel","download_url":"https://codeload.github.com/thehimel/fast-auth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thehimel%2Ffast-auth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34059210,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alembic","api","asyncio","authentication","authorization","backend","boilerplate","cookie-auth","fastapi","google-oauth","jwt","oauth2","postgresql","pytest","python","rate-limiting","rbac","sqlalchemy","starter-template","user-management"],"created_at":"2026-06-08T11:05:18.889Z","updated_at":"2026-06-08T11:05:19.483Z","avatar_url":"https://github.com/thehimel.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Core\n\n[![Python](https://img.shields.io/badge/Python-3.14+-3776AB?logo=python\u0026logoColor=white)](https://www.python.org/)\n[![FastAPI](https://img.shields.io/badge/FastAPI-009688?logo=fastapi\u0026logoColor=white)](https://fastapi.tiangolo.com/)\n[![Pydantic](https://img.shields.io/badge/Pydantic-E92063?logo=pydantic\u0026logoColor=white)](https://docs.pydantic.dev/)\n[![SQLAlchemy](https://img.shields.io/badge/SQLAlchemy-1a1a1a?logo=sqlalchemy\u0026logoColor=white)](https://www.sqlalchemy.org/)\n[![Alembic](https://img.shields.io/badge/Alembic-Migrations-000000?logo=alembic\u0026logoColor=white)](https://alembic.sqlalchemy.org/)\n[![PostgreSQL](https://img.shields.io/badge/PostgreSQL-4169E1?logo=postgresql\u0026logoColor=white)](https://www.postgresql.org/)\n[![uv](https://img.shields.io/badge/uv-Package%20Manager-00C853)](https://docs.astral.sh/uv/)\n[![Ruff](https://img.shields.io/badge/Ruff-linter-FFE873?logo=ruff\u0026logoColor=000)](https://docs.astral.sh/ruff/)\n[![Vercel](https://img.shields.io/badge/Vercel-Deploy-000000?logo=vercel\u0026logoColor=white)](https://vercel.com/)\n\nA FastAPI backend focused on authentication and user management, built with async PostgreSQL, OAuth, and JWT session cookies.\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 /me`; 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://localhost:8000  \nDocs: http://localhost:8000/docs\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/commands.md](docs/commands.md) for Docker, pre-commit, and more.\n\n## API Overview\n\nInteractive API docs: http://localhost:8000/docs\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/commands.md](docs/commands.md#pytest) for Pytest commands.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehimel%2Ffast-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthehimel%2Ffast-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthehimel%2Ffast-auth/lists"}