{"id":19764613,"url":"https://github.com/sarmad426/fastapi","last_synced_at":"2026-04-13T13:03:28.300Z","repository":{"id":227113534,"uuid":"770498846","full_name":"Sarmad426/FastAPI","owner":"Sarmad426","description":"API development using Fast API and SQL Model ORM. Backend Microservices architecture.","archived":false,"fork":false,"pushed_at":"2024-10-29T08:23:13.000Z","size":519,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-29T09:43:25.421Z","etag":null,"topics":["api","docker","fastapi","fastapi-microservices","microservices","python","python-microservices","pythonwebapp","rest-api","sqlmodel","uvicorn"],"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/Sarmad426.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":"2024-03-11T16:53:13.000Z","updated_at":"2024-10-29T08:23:17.000Z","dependencies_parsed_at":"2024-03-11T18:03:56.786Z","dependency_job_id":"51858d7d-13b4-4340-ade5-202470a90073","html_url":"https://github.com/Sarmad426/FastAPI","commit_stats":null,"previous_names":["sarmad426/poetry-fastapi","sarmad426/fastapi"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Sarmad426/FastAPI","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarmad426%2FFastAPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarmad426%2FFastAPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarmad426%2FFastAPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarmad426%2FFastAPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sarmad426","download_url":"https://codeload.github.com/Sarmad426/FastAPI/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sarmad426%2FFastAPI/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31753552,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T09:16:15.125Z","status":"ssl_error","status_checked_at":"2026-04-13T09:16:05.023Z","response_time":93,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["api","docker","fastapi","fastapi-microservices","microservices","python","python-microservices","pythonwebapp","rest-api","sqlmodel","uvicorn"],"created_at":"2024-11-12T04:14:26.955Z","updated_at":"2026-04-13T13:03:28.294Z","avatar_url":"https://github.com/Sarmad426.png","language":"Python","readme":"# Fast API\n\nFastAPI is a modern, fast (high-performance) web framework for building APIs with Python 3.7+ based on standard Python type hints. FastAPI is built on top of **Starlette** for the web parts and Pydantic for data validation, which allows it to provide high speed and powerful data handling.\n\n**What Makes FastAPI stand out:**\n\nWhat makes FastAPI stand out is its automatic generation of **OpenAPI** and **JSON** Schema documentation, making it easy for developers to create and maintain clear, interactive API documentation. It also offers built-in support for asynchronous programming, enabling the development of highly concurrent systems. FastAPI's focus on type hints improves code quality and editor support, while its performance is comparable to frameworks like *Node.js*, making it one of the fastest Python web frameworks available.\n\n**Suitable for AI:**\n\nFastAPI is particularly well-suited for AI development due to its support for asynchronous programming, which is vital for handling multiple requests concurrently, especially in AI-driven applications that demand high performance and low latency. Its strong typing and validation features also help ensure the integrity of data passing through APIs, which is critical in AI models where data quality significantly impacts outcomes.\n\n## Setting up a FastAPI Project with Poetry\n\n### Poetry\n\nPoetry is a Python dependency management and packaging tool that simplifies project setup by managing dependencies, virtual environments, and package publishing all in one tool. It creates a `pyproject.toml` file to manage dependencies, allowing for precise version control and reducing conflicts.\n\n## Step 1: Install pipx\n\n- Open your terminal.\n- Install pipx using pip:\n\n```bash\npython -m pip install --user pipx\n```\n\n## Step 2: Ensure pipx's binary directory is in your PATH\n\nRun the following command to ensure pipx's binary directory is in your PATH:\n\n```bash\npython -m pipx ensurepath\n```\n\n## Step 3: Restart your terminal\n\nRestart your terminal to apply the PATH update.\n\n## Step 4: Install Poetry\n\nRun the command:\n\n```bash\npipx install poetry\n```\n\n## Step 5: Check the version of Poetry\n\nTo check the version, run:\n\n```bash\npoetry --version\n```\n\n## Step 6: Create a new project\n\nCreate a new project with Poetry:\n\n```bash\npoetry new poetry-class --name poetryclass\n```\n\n## Step 7: Navigate to the project folder\n\nOpen the subfolder inside the parent folder, in this case `poetryclass`.\n\n## Step 8: Create a main.py file\n\nCreate a new file named `main.py`.\n\n## Step 9 (Optional): Check the Python version\n\nTo check the version of Python, run:\n\n```bash\npoetry run python --version\n```\n\n## Step 10: Add FastAPI and Uvicorn\n\nRun the command:\n\n```bash\npoetry add fastapi[standard] \"uvicorn[standard]\"\n```\n\n## Step 10a (Optional): Check packages in pyproject.toml\n\nOptionally, check the packages inside the `pyproject.toml` file.\n\n## Step 11: Write the hello world code in main.py\n\n```python\nfrom typing import Union\n\nfrom fastapi import FastAPI\n\napp = FastAPI()\n\n\n@app.get(\"/\")\ndef read_root():\n    return {\"Hello\": \"World\"}\n\n\n@app.get(\"/items/{item_id}\")\ndef read_item(item_id: int, q: Union[str, None] = None):\n    return {\"item_id\": item_id, \"q\": q}\n```\n\n## Step 12: Run the server\n\nRun the server using Poetry:\n\n```bash\npoetry run uvicorn main:app --reload\n```\n\nOR\n\n```bash\nuvicorn main:app --reload\n```\n\n## Step 13: Open the URLs\n\nOpen the following URLs in your browser:\n\n- \u003chttp://127.0.0.1:8000\u003e to view the hello world message.\n- \u003chttp://127.0.0.1:8000/docs\u003e to view the interactive API documentation.\n\n### Learning Roadmap\n\n- Introduction to FastAPI\n- Creating API Endpoints\n- Path and Query Parameters\n- Request and Response Models\n- Dependency Injection\n- Asynchronous Programming\n- Middleware\n- Security and Authentication\n- Handling CORS (Cross-Origin Resource Sharing)\n- Database Integration\n- WebSockets\n- Testing\n- Deployment\n- API Documentation\n- Rate Limiting and Throttling\n- Logging and Monitoring\n- Graphql Integration\n- Caching\n- API Gateway integration\n- Event driven architecture\n- Error Handling and Validation\n\n### Other Repositories\n\n**Python**. \u003chttps://github.com/Sarmad426/Python\u003e\n\n**Python Projects**. \u003chttps://github.com/Sarmad426/Python-projects\u003e\n\nLearn **DSA** with python. \u003chttps://github.com/Sarmad426/DSA-Python\u003e\n\nLearn **AI** and **Data Science**. \u003chttps://github.com/Sarmad426/AI\u003e\n\nLearn **Generative AI**. \u003chttps://github.com/Sarmad426/Generative-AI\u003e\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarmad426%2Ffastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsarmad426%2Ffastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsarmad426%2Ffastapi/lists"}