{"id":16175476,"url":"https://github.com/app-generator/api-server-fastapi","last_synced_at":"2025-03-19T00:31:17.235Z","repository":{"id":100502745,"uuid":"585174969","full_name":"app-generator/api-server-fastapi","owner":"app-generator","description":"FastAPI (API) Server - Open-Source project | AppSeed","archived":false,"fork":false,"pushed_at":"2023-01-09T20:01:30.000Z","size":49,"stargazers_count":5,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-11T05:55:13.778Z","etag":null,"topics":["api-server","appseed","fastapi","fastapi-starter","fastapi-starter-kit","fastapi-starter-template","full-stack"],"latest_commit_sha":null,"homepage":"https://appseed.us/boilerplate-code/","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/app-generator.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}},"created_at":"2023-01-04T14:05:48.000Z","updated_at":"2024-06-27T23:07:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"3f0cb90c-54d7-42c5-b3f2-2502c9404410","html_url":"https://github.com/app-generator/api-server-fastapi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/app-generator%2Fapi-server-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/app-generator","download_url":"https://codeload.github.com/app-generator/api-server-fastapi/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244331790,"owners_count":20436005,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-server","appseed","fastapi","fastapi-starter","fastapi-starter-kit","fastapi-starter-template","full-stack"],"created_at":"2024-10-10T04:44:55.650Z","updated_at":"2025-03-19T00:31:17.229Z","avatar_url":"https://github.com/app-generator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## [FastAPI (API) Server](https://github.com/app-generator/api-server-fastapi)\n\nSimple **FastAPI Boilerplate** enhanced with `JWT` authentication, `OAuth` via **GitHub**, `SqlAlchemy`, **SQLite** persistence and deployment scripts via Docker - Provided by **[AppSeed](https://appseed.us/)**. It has all the ready-to-use bare minimum essentials and `active versioning` and [support](https://appseed.us/support/).\n\n\u003cbr /\u003e\n\n\u003e Product Roadmap \u0026 `Features`:\n\n| Status | Item | info | \n| --- | --- | --- |\n| ✅ | **Up-to-date Dependencies** | - |\n| ✅ | [API Definition](https://docs.appseed.us/boilerplate-code/api-unified-definition) |  the unified API structure implemented by this server |\n| ✅ | `JWT Authentication` |  (login, logout, register) via `oauth2` |\n| ✅ | **OAuth** | via GitHub` |\n| ✅ | **Persistence** | `SQLite`, `MySql` |\n| ✅ | **Docker** | - |\n| ✅ | **Unitary tests** | `minimal suite` |\n\n\u003cbr /\u003e\n\n ## ✨ Quick Start in `Docker`\n\n\u003e Get the code\n\n```bash\n$ git clone https://github.com/app-generator/api-server-fastapi.git\n$ cd api-server-fastapi\n```\n\n\u003e Start the app in Docker\n\n```bash\n$ docker-compose up --build  \n```\n\nNote: The `env.sample` file will be used to set the environment variables for the docker container. Make sure to set them as needed. \nThe API server will start using the PORT `5000`.\n\n\u003cbr /\u003e\n\n## ✨ Table of Contents\n\n1. [Getting Started](#getting-started)\n2. [Project Structure](#project-structure)\n3. [Modules](#modules)\n4. [Testing](#testing)\n\n\u003cbr /\u003e\n\n## ✨ How to use the code\n\n\u003e **Step #1** - Clone the project\n\n```bash\n$ git clone https://github.com/app-generator/api-server-flask.git\n$ cd api-server-flask\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #2** - create virtual environment using python3 and activate it (keep it outside our project directory)\n\n```bash\n$ # Virtualenv modules installation (Unix based systems)\n$ virtualenv env\n$ source env/bin/activate\n$\n$ # Virtualenv modules installation (Windows based systems)\n$ # virtualenv env\n$ # .\\env\\Scripts\\activate\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #3** - Install dependencies in virtualenv\n\n```bash\n$ pip install -r requirements.txt\n```\n\n\u003cbr /\u003e\n\n\u003e **Step #5** - Create a new `.env` file using sample `env.sample`\n\nThe meaning of each variable can be found below: \n\n- `DEBUG`: if `True` the app runs in develoment mode\n  - For production value `False` should be used\n- `SECRET_KEY`: used in assets management\n- `GITHUB_CLIENT_ID`: For GitHub social login\n- `GITHUB_SECRET_KEY`: For GitHub social login\n- `DATABASE_HOSTNAME`: For Mysql databse\n- `DATABASE_PORT`: For Mysql databse\n- `DATABASE_PASSWORD`: For Mysql databse\n- `DATABASE_NAME`: For Mysql databse\n- `DATABASE_USERNAME`: For Mysql databse\n- `ALGORITHM`: For JWT Tokens\n- `ACCESS_TOKEN_EXPIRE_MINUTES`: For JWT Tokens\n\n\n\n\n\u003cbr /\u003e\n\n\u003e **Step #6** - start test APIs server at `localhost:5000`\n\n```bash\n$ uvicorn src.app:app\n```\n\nUse the API via `POSTMAN` or Swagger Dashboard.\n\n![Flask API Server - Swagger Dashboard.](https://user-images.githubusercontent.com/51070104/141950891-ea315fca-24c2-4929-841c-38fb950a478d.png) \n\n\u003cbr /\u003e\n\n## ✨ Project Structure\n\n```bash\napi-server-flask/\n├── src\n    ├── helpers\n        ├── database.py\n        └── utils.py\n    ├── routers\n        ├── users.py\n│   ├── __init__.py\n│   ├── app.py\n│   ├── config.py\n│   ├── models.py\n│   ├── oatuh2.py\n│   └── schemas.py\n├── tests\n    ├── __init__.py\n    ├── conftest.py\n    ├── database.py\n    └── test_users.py\n├── Dockerfile\n├── docker-compose.yaml\n├── README.md\n├── requirements.txt\n├── run.py\n```\n\n\u003cbr /\u003e\n\n## ✨ API\n\nFor a fast set up, use this `POSTMAN` file: [api_sample](https://github.com/app-generator/api-unified-definition/blob/main/api.postman_collection.json)\n\n\u003e **Register** - `api/users/register` (**POST** request)\n\n```\nPOST api/users/register\nContent-Type: application/json\n\n{\n    \"username\":\"test\",\n    \"password\":\"pass\", \n    \"email\":\"test@appseed.us\"\n}\n```\n\n\u003cbr /\u003e\n\n\u003e **Login** - `api/users/login` (**POST** request)\n\n```\nPOST /api/users/login\nContent-Type: application/json\n\n{\n    \"password\":\"pass\", \n    \"email\":\"test@appseed.us\"\n}\n```\n\n\u003cbr /\u003e\n\n\u003e **Logout** - `api/users/logout` (**POST** request)\n\n```\nPOST api/users/logout\nContent-Type: application/json\nauthorization: JWT_TOKEN (returned by Login request)\n\n{\n    \"token\":\"JWT_TOKEN\"\n}\n```\n\n\u003cbr /\u003e\n\n## ✨ Testing\n\nRun tests using `pytest tests.py`\n\n\u003cbr /\u003e\n\n---\n**[FastAPI (API) Server](https://github.com/app-generator/api-server-fastapi)** - provided by [AppSeed](https://appseed.us)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fapi-server-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fapp-generator%2Fapi-server-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fapp-generator%2Fapi-server-fastapi/lists"}