{"id":50304582,"url":"https://github.com/pvlbzn/auth-api-template","last_synced_at":"2026-05-28T15:01:35.944Z","repository":{"id":353224149,"uuid":"1126978167","full_name":"pvlbzn/auth-api-template","owner":"pvlbzn","description":"API service template with social authentication out of the box. Production ready, lean, opinionated.","archived":false,"fork":false,"pushed_at":"2026-04-23T00:32:21.000Z","size":112,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-23T02:14:45.826Z","etag":null,"topics":["api","authentication","fastapi","oauth2","service"],"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/pvlbzn.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-01-02T23:34:29.000Z","updated_at":"2026-04-23T00:32:24.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/pvlbzn/auth-api-template","commit_stats":null,"previous_names":["pvlbzn/auth-api-template"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/pvlbzn/auth-api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fauth-api-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fauth-api-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fauth-api-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fauth-api-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvlbzn","download_url":"https://codeload.github.com/pvlbzn/auth-api-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvlbzn%2Fauth-api-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33613431,"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-05-28T02:00:06.440Z","response_time":99,"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":["api","authentication","fastapi","oauth2","service"],"created_at":"2026-05-28T15:01:34.789Z","updated_at":"2026-05-28T15:01:35.935Z","avatar_url":"https://github.com/pvlbzn.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Setup\n\nCopy `.env.example` and provide your credentials in `.env`.\n\n```shell\ncp .env.example .env\n```\n\nInitialize docker image with database.\n\n```shell\ndocker compose up -d\n```\n\nLoad dependencies and sync the project.\n\n```shell\nuv sync\n```\n\nApply migrations.\n\n```shell\nuv run db-migrate\n\n# Should return\nINFO  [alembic.runtime.migration] Context impl PostgresqlImpl.\nINFO  [alembic.runtime.migration] Will assume transactional DDL.\nINFO  [alembic.runtime.migration] Running upgrade  -\u003e d9e9ff0ca69b, auth\n```\n\nRun the app.\n\n```shell\nuv run dev\n\n# Should return\nINFO:     Will watch for changes in these directories: ['...']\nINFO:     Uvicorn running on http://0.0.0.0:35000 (Press CTRL+C to quit)\nINFO:     Started reloader process [17450] using WatchFiles\nINFO:     Started server process [17452]\nINFO:     Waiting for application startup.\nINFO:     Application startup complete.\n```\n\n## Setup Social Login Provider\n\n### GitHub\n\nSet up:\n1. Navigate to [Developer Settings](https://github.com/settings/developers), and create a new OAuth app\n2. Get Client ID and put it into `PROJECT_GITHUB_CLIENT_ID` at `.env`\n3. Generate Client secrets and put it into `PROJECT_GITHUB_CLIENT_SECRET` at `.env`\n4. Set Authorization callback URL to be http://localhost:35000/api/v1/auth/callback/github, substitute address and port if needed\n\nTest it:\n1. Navigate to http://localhost:35000/api/v1/auth/login/github\n2. Follow the login flow\n3. Once done you'll be redirected to http://localhost:35000/auth/callback?token=TOKEN\n4. Copy `TOKEN` value, its JWT token\n5. Open any HTTP client like Postman, set auth to Bearer Token, and put the token there\n6. Call GET http://0.0.0.0:35000/api/v1/auth/user\n\nYou will your user details back:\n```json\n{\n    \"id\": \"ad53c641-d666-4670-b6fe-3799bd4fd657\",\n    \"email\": \"pvlbzn@gmail.com\",\n    \"name\": \"Pavel Bazin\",\n    \"provider\": \"github\",\n    \"provider_id\": \"9218794\",\n    \"avatar_url\": \"https://avatars.githubusercontent.com/u/9218794?v=4\"\n}\n```\n\nYou can connect to the database and see your user there in `users` table.\n\n\n# Migrations\n\n```shell\nuv run alembic revision --autogenerate -m \"message\"\n\n# Drop and apply migrations\nuv run db-reset\n\n# Apply migrations\nuv run db-migrate\n```\n\n# Update Dependencies\n\n```shell\nuv lock --upgrade \nuv sync\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvlbzn%2Fauth-api-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvlbzn%2Fauth-api-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvlbzn%2Fauth-api-template/lists"}