{"id":30172872,"url":"https://github.com/bngiahuy/fastapi-template","last_synced_at":"2026-04-14T14:33:11.728Z","repository":{"id":308098574,"uuid":"1031612109","full_name":"bngiahuy/fastapi-template","owner":"bngiahuy","description":"A modern FastAPI project template with async SQLAlchemy, Alembic migrations, JWT authentication, and Dockerized PostgreSQL.","archived":false,"fork":false,"pushed_at":"2025-08-05T13:11:48.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-11T23:23:50.623Z","etag":null,"topics":["docker","fastapi","jwt","postgres","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bngiahuy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-08-04T04:30:24.000Z","updated_at":"2025-08-05T13:11:51.000Z","dependencies_parsed_at":"2025-08-04T07:32:12.348Z","dependency_job_id":"a4f43ab1-7705-4daf-9577-3741cc4c79a5","html_url":"https://github.com/bngiahuy/fastapi-template","commit_stats":null,"previous_names":["bngiahuy/fastapi-template"],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/bngiahuy/fastapi-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bngiahuy%2Ffastapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bngiahuy%2Ffastapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bngiahuy%2Ffastapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bngiahuy%2Ffastapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bngiahuy","download_url":"https://codeload.github.com/bngiahuy/fastapi-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bngiahuy%2Ffastapi-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31801388,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T11:13:53.975Z","status":"ssl_error","status_checked_at":"2026-04-14T11:13:53.299Z","response_time":153,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["docker","fastapi","jwt","postgres","python"],"created_at":"2025-08-11T23:17:59.546Z","updated_at":"2026-04-14T14:33:11.709Z","avatar_url":"https://github.com/bngiahuy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI PostgreSQL Template\n\nA modern FastAPI project template with async SQLAlchemy, Alembic migrations, JWT authentication, and Dockerized PostgreSQL. Includes user registration, login, and secure endpoints.\n\n## Features\n- FastAPI (async)\n- PostgreSQL (Docker)\n- SQLAlchemy 2.x ORM\n- Alembic migrations\n- JWT authentication (register, login, protected endpoints)\n- Password hashing (bcrypt)\n- Environment variable configuration\n\n## Requirements\n- Python 3.12+\n- Docker and Docker Compose\n\n## Setup Instructions\n\n### 1. Clone the repository\n\n### 2. Create and activate a virtual environment\n```bash\npython -m venv venv\n# On Windows:\nvenv\\Scripts\\activate\n# On Linux/Mac:\nsource venv/bin/activate\n```\n\n### 3. Install dependencies\n```bash\npip install -r requirements.txt\n```\n\n### 4. Start PostgreSQL with Docker\n```bash\ndocker compose up -d postgres\n```\n\n### 5. Configure environment variables\nEdit `.env` for database and JWT settings, you can visit my `JWT Secret Generator` at this url: [JWT Secret Generator](https://bngiahuy.github.io/jwt-secret-generator/)\n```\nPG_HOST=localhost\nPG_PORT=5432\nPG_USER=postgres\nPG_PASSWORD=postgres\nPG_DB=db\nSQLALCHEMY_ECHO=true\nJWT_SECRET=supersecretkey\nJWT_ALGORITHM=HS256\nJWT_EXPIRE_MINUTES=30\n```\n\n\n\n### 6. Run Alembic migrations\n```bash\nalembic upgrade head\n```\n\n### 7. Start the FastAPI server\n```bash\npython -m src.main\n```\n\n### 8. Access Swagger UI\nOpen [http://localhost:8000/docs](http://localhost:8000/docs) in your browser to explore and test the API endpoints.\n\n## API Endpoints\n- `POST /api/v1/register` — Register a new user\n- `POST /api/v1/login` — Login and get JWT token\n- `GET /api/v1/users/me` — Get current user info (JWT required)\n\n## Notes\n- All passwords are securely hashed using bcrypt.\n- JWT tokens are required for protected endpoints. Use the \"Authorize\" button in Swagger UI.\n- For development, you can change settings in `.env`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbngiahuy%2Ffastapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbngiahuy%2Ffastapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbngiahuy%2Ffastapi-template/lists"}