{"id":15192370,"url":"https://github.com/jpcadena/fastapi-graphql","last_synced_at":"2026-02-16T05:32:30.250Z","repository":{"id":246288369,"uuid":"820647901","full_name":"jpcadena/fastapi-graphql","owner":"jpcadena","description":"FastAPI backend using GraphQL API","archived":false,"fork":false,"pushed_at":"2025-05-01T21:07:48.000Z","size":2452,"stargazers_count":6,"open_issues_count":5,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T17:41:47.819Z","etag":null,"topics":["api","api-server","backend","backend-api","fastapi","fastapi-boilerplate","graphene","graphql","graphql-api","graphql-server","postgresql","pydantic","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"https://github.com/jpcadena/fastapi-graphql","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/jpcadena.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","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":"2024-06-26T22:37:36.000Z","updated_at":"2025-10-21T23:48:48.000Z","dependencies_parsed_at":"2024-07-08T03:53:55.798Z","dependency_job_id":"6c5b6a85-989e-4a6c-a264-37ba037f4f45","html_url":"https://github.com/jpcadena/fastapi-graphql","commit_stats":{"total_commits":36,"total_committers":2,"mean_commits":18.0,"dds":0.05555555555555558,"last_synced_commit":"ef689b5bc66f105ee672d541484306b888c19945"},"previous_names":["jpcadena/fastapi-graphql"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jpcadena/fastapi-graphql","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Ffastapi-graphql","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Ffastapi-graphql/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Ffastapi-graphql/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Ffastapi-graphql/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jpcadena","download_url":"https://codeload.github.com/jpcadena/fastapi-graphql/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jpcadena%2Ffastapi-graphql/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29500832,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T03:57:51.541Z","status":"ssl_error","status_checked_at":"2026-02-16T03:55:59.854Z","response_time":115,"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","api-server","backend","backend-api","fastapi","fastapi-boilerplate","graphene","graphql","graphql-api","graphql-server","postgresql","pydantic","python","sqlalchemy"],"created_at":"2024-09-27T21:22:49.723Z","updated_at":"2026-02-16T05:32:30.233Z","avatar_url":"https://github.com/jpcadena.png","language":"Python","readme":"# fastapi-graphql\n\n\u003c!-- Improved compatibility of back to top link: See: https://github.com/othneildrew/Best-README-Template/pull/73 --\u003e\n\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\n\n\u003c!-- PROJECT SHIELDS --\u003e\n\u003c!--\n*** Markdown \"reference style\" links for readability.\n*** Reference links are enclosed in brackets [ ] instead of parentheses ( ).\n--\u003e\n\n\u003c!-- PROJECT LOGO --\u003e\n\u003cbr /\u003e\n\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"https://github.com/othneildrew/Best-README-Template\"\u003e\n    \u003cimg src=\"assets/images/logo.png\" alt=\"Logo\" width=\"80\" height=\"80\"\u003e\n  \u003c/a\u003e\n\n\u003ch3 align=\"center\"\u003eFastapi GraphQL project\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    Fastapi backend using GraphQL API\n    \u003cbr /\u003e\n    \u003ca href=\"https://github.com/jpcadena/fastapi-graphql\"\u003e\u003cstrong\u003eExplore the\ndocs\n»\u003c/strong\u003e\u003c/a\u003e\n    \u003cbr /\u003e\n  \u003c/p\u003e\n\u003c/div\u003e\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n\u003cdetails\u003e\n  \u003csummary\u003eTable of Contents\u003c/summary\u003e\n  \u003col\u003e\n       \u003cli\u003e\n      \u003ca href=\"#about-the-project\"\u003eAbout The Project\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#built-with\"\u003eBuilt With\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\n      \u003ca href=\"#getting-started\"\u003eGetting Started\u003c/a\u003e\n      \u003cul\u003e\n        \u003cli\u003e\u003ca href=\"#prerequisites\"\u003ePrerequisites\u003c/a\u003e\u003c/li\u003e\n        \u003cli\u003e\u003ca href=\"#installation\"\u003eInstallation\u003c/a\u003e\u003c/li\u003e\n      \u003c/ul\u003e\n    \u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#usage\"\u003eUsage\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contributing\"\u003eContributing\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#security\"\u003eSecurity\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#code-of-conduct\"\u003eCode of Conduct\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"#contact\"\u003eContact\u003c/a\u003e\u003c/li\u003e  \u003c/ol\u003e\n\u003c/details\u003e\n\n\u003c!-- ABOUT THE PROJECT --\u003e\n\n## About The Project\n\n![Project][project-screenshot]\n\nThis backend project is a FastAPI-based template designed to serve as a robust,\nreliable, and GraphQL API backend. It is crucial for facilitating user\nauthentication, real-time data processing, and deployment as serverless\nfunctions.\nBy leveraging GraphQL, this API ensures flexible and efficient data retrieval,\naddressing the limitations of REST APIs.\n\nThis project covers topics from basic GraphQL concepts to advanced features\nlike authentication, ORM integration, and deployment.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n### Built with\n\nThis project is built using a suite of modern, powerful technologies and\nframeworks to ensure high performance, ease of development, and robustness:\n\n[![Python][python-shield]][python-url] [![FastAPI][fastapi-shield]][fastapi-url] [![Graphene][graphene-shield]][graphene-url] [![GraphQL Playground][graphql-playground-shield]][graphql-playground-url] [![Pydantic][pydantic-shield]][pydantic-url] [![Starlette][starlette-shield]][starlette-url] [![Uvicorn][uvicorn-shield]][uvicorn-url] [![postgresql][postgresql-shield]][postgresql-url] [![Redis][redis-shield]][redis-url] [![JWT][jwt-shield]][jwt-url] [![HTML5][html5-shield]][html5-url] [![CSS3][css3-shield]][css3-url] [![isort][isort-shield]][isort-url] [![Black][black-shield]][black-url] [![Ruff][ruff-shield]][ruff-url] [![MyPy][mypy-shield]][mypy-url] [![pre-commit][pre-commit-shield]][pre-commit-url] [![GitHub Actions][github-actions-shield]][github-actions-url] [![Poetry][poetry-shield]][poetry-url] [![Pycharm][pycharm-shield]][pycharm-url] [![Visual Studio Code][visual-studio-code-shield]][visual-studio-code-url] [![Markdown][markdown-shield]][markdown-url] [![Swagger UI][swagger-ui-shield]][swagger-ui-url] [![License: MIT][license-shield]][license-url]\n\n### Components\n\nThe system is composed of the following main components, each playing a\ncrucial role in providing a scalable, maintainable, and robust application:\n\n- **FastAPI Backend**: Serves as the core of the GraphQL API, handling incoming\n  HTTP requests, processing data, and sending responses. It's designed for high\n  performance and encourages standard API development practices.\n- **Graphene**: A Python library for building GraphQL APIs, providing a simple\n  and powerful way to define schemas and handle queries and mutations.\n- **SQLAlchemy ORM**: Used for database interactions, providing a high-level\n  and pythonic way to interact with relational databases.\n- **JWT Authentication**: Implements secure authentication mechanisms using JSON\n  Web Tokens (JWT), ensuring secure access to the API.\n\nThis project adheres to GraphQL design principles, ensuring an intuitive and\nstandard approach to API development. This design facilitates easy integration,\nscalability, and interaction with various clients, including web and mobile\napplications. The API provides flexible query and mutation capabilities, uses\nJWT for secure, stateless authentication, and can be deployed as serverless\nfunctions for scalability and cost-efficiency.\n\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- GETTING STARTED --\u003e\n\n## Getting started\n\n### Prerequisites\n\n- [Python 3.11][python-docs]\n\n### Installation\n\n1. Clone the **repository**\n\n   ```bash\n   git clone https://github.com/jpcadena/fastapi-graphql.git\n   ```\n\n2. Change the directory to **root project**\n\n   ```bash\n   cd fastapi-graphql\n   ```\n\n3. Install **Poetry** package manager\n\n   ```bash\n   pip install poetry\n   ```\n\n4. Install the project's **dependencies**\n\n   ```bash\n   poetry install\n   ```\n\n5. Activate the **environment**\n\n   ```bash\n   poetry shell\n   ```\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- USAGE EXAMPLES --\u003e\n\n## Usage\n\n1. **Setting up environment variables:**\n\n   If you find a `.env.sample` in the project directory, make a copy of it and\n   rename to `.env`.\n\n   ```bash\n   cp .env.sample .env\n   ```\n\n   This `.env` file will be used to manage your application's environment\n   variables.\n\n2. **Configuring your credentials:**\n\n   Open the `.env` file in a text editor and replace the placeholder values with\n   your actual credentials.\n\n   ```bash\n   # .env file\n   POSTGRES_USER=your_database_user\n   SECRET_KEY=your_api_key\n   ```\n\n   Be sure to save the file after making these changes.\n\n3. **Generating RSA keys**\n\n   To ensure secure communication in this project, RSA keys are used. Before\n   running the application, you need to generate a public and private RSA key\n   pair.\n   We've provided a Python script to automatically generate these keys. You can\n   find the script at `app\\services\\infrastructure\\encryption.py`. To generate\n   your keys, simply run:\n\n    ```bash\n    python app\\services\\infrastructure\\encryption.py\n    ```\n\n   This will create `public_key.pem` and `private_key.pem` files in your\n   specified directory.\n\n   Once the keys are generated, the application will use them for cryptographic\n   operations. Ensure that these files are kept secure and are not exposed\n   publicly. The default configuration expects these keys in the root directory\n   of the project.\n\n4. **Starting the server:**\n\n   To start the local server on your machine, run the following command in your\n   terminal:\n\n   ```bash\n   uvicorn main:app --reload\n   ```\n\n   The `--reload` flag enables hot reloading, which means the server will\n   automatically update whenever you make changes to the code.\n\n5. **Interacting with the app:**\n\n   Once your server is running, you can interact with it using any API client\n   like Postman or your web browser. You can send GraphQL queries and mutations\n   to the API endpoints as defined in your main.py file. For example, to get all\n   users, you can send a query to http://localhost:8000/graphql.\n\n6. **Using GraphQL Playground:**\n\n   FastAPI provides automatic interactive API documentation using GraphQL\n   Playground. Once your server is up and running, you can go\n   to http://localhost:8000/graphql in your web browser to access it. From\n   there, you can explore and interact with your API directly.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\n\u003c!-- CONTRIBUTING --\u003e\n\n## Contributing\n\n[![GitHub][github-shield]][github-url]\n\nPlease read our [contributing guide](CONTRIBUTING.md) for details on our code of\nconduct, and the process for submitting pull requests to us.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- SECURITY --\u003e\n\n## Security\n\nFor security considerations and best practices, please refer to\nour [Security Guide](SECURITY.md) for a detailed guide.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CODE_OF_CONDUCT --\u003e\n\n## Code of Conduct\n\nWe enforce a code of conduct for all maintainers and contributors. Please read\nour [Code of Conduct](CODE_OF_CONDUCT.md) to understand the expectations before\nmaking any contributions.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- LICENSE --\u003e\n\n## License\n\nDistributed under the MIT License. See [LICENSE](LICENSE) for more information.\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- CONTACT --\u003e\n\n## Contact\n\n- [![LinkedIn][linkedin-shield]][linkedin-url]\n\n- [![Outlook][outlook-shield]](mailto:jpcadena@espol.edu.ec?subject=[GitHub]fastapi-graphql)\n\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\n\n\u003c!-- MARKDOWN LINKS \u0026 IMAGES --\u003e\n\u003c!-- https://www.markdownguide.org/basic-syntax/#reference-style-links --\u003e\n\n[project-screenshot]: assets/images/project.png\n\n[python-docs]: https://docs.python.org/3.11/\n\n[linkedin-shield]: https://img.shields.io/badge/linkedin-%230077B5.svg?style=for-the-badge\u0026logo=linkedin\u0026logoColor=white\n\n[outlook-shield]: https://img.shields.io/badge/Microsoft_Outlook-0078D4?style=for-the-badge\u0026logo=microsoft-outlook\u0026logoColor=white\n\n[python-shield]: https://img.shields.io/badge/python-3670A0?style=for-the-badge\u0026logo=python\u0026logoColor=ffdd54\n\n[fastapi-shield]: https://img.shields.io/badge/FastAPI-FFFFFF?style=for-the-badge\u0026logo=fastapi\n\n[pydantic-shield]: https://img.shields.io/badge/Pydantic-FF43A1?style=for-the-badge\u0026logo=pydantic\u0026logoColor=white\n\n[starlette-shield]: https://img.shields.io/badge/Starlette-392939?style=for-the-badge\u0026logo=starlette\u0026logoColor=white\n\n[uvicorn-shield]: https://img.shields.io/badge/Uvicorn-2A308B?style=for-the-badge\u0026logo=uvicorn\u0026logoColor=white\n\n[redis-shield]: https://img.shields.io/badge/Redis-DC382D?style=for-the-badge\u0026logo=redis\u0026logoColor=white\n\n[html5-shield]: https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge\u0026logo=html5\u0026logoColor=white\n\n[jwt-shield]: https://img.shields.io/badge/JWT-black?style=for-the-badge\u0026logo=JSON%20web%20tokens\n\n[pycharm-shield]: https://img.shields.io/badge/PyCharm-21D789?style=for-the-badge\u0026logo=pycharm\u0026logoColor=white\n\n[markdown-shield]: https://img.shields.io/badge/Markdown-000000?style=for-the-badge\u0026logo=markdown\u0026logoColor=white\n\n[swagger-ui-shield]: https://img.shields.io/badge/-Swagger-%23Clojure?style=for-the-badge\u0026logo=swagger\u0026logoColor=white\n\n[github-shield]: https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge\u0026logo=github\u0026logoColor=white\n\n[ruff-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v1.json\n\n[black-shield]: https://img.shields.io/badge/code%20style-black-000000.svg?style=for-the-badge\u0026logo=appveyor\n\n[mypy-shield]: https://img.shields.io/badge/mypy-checked-2A6DB2.svg?style=for-the-badge\u0026logo=appveyor\n\n[visual-studio-code-shield]: https://img.shields.io/badge/Visual_Studio_Code-007ACC?style=for-the-badge\u0026logo=visual-studio-code\u0026logoColor=white\n\n[poetry-shield]: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/python-poetry/website/main/static/badge/v0.json\n\n[postgresql-shield]: https://img.shields.io/badge/PostgreSQL-336791?style=for-the-badge\u0026logo=postgresql\u0026logoColor=white\n\n[isort-shield]: https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat\u0026labelColor=ef8336\n\n[github-actions-shield]: https://img.shields.io/badge/github%20actions-%232671E5.svg?style=for-the-badge\u0026logo=githubactions\u0026logoColor=white\n\n[pre-commit-shield]: https://img.shields.io/badge/pre--commit-F7B93E?style=for-the-badge\u0026logo=pre-commit\u0026logoColor=white\n\n[css3-shield]: https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge\u0026logo=css3\u0026logoColor=white\n\n[license-shield]: https://img.shields.io/badge/License-MIT-yellow.svg\n\n[graphene-shield]: https://img.shields.io/badge/Graphene-FF6F3F?style=for-the-badge\u0026logo=graphql\u0026logoColor=white\n\n[graphql-playground-shield]: https://img.shields.io/badge/GraphQL%20Playground-E535AB?style=for-the-badge\u0026logo=graphql\u0026logoColor=white\n\n[linkedin-url]: https://linkedin.com/in/juanpablocadenaaguilar\n\n[python-url]: https://docs.python.org/3.11/\n\n[fastapi-url]: https://fastapi.tiangolo.com\n\n[pydantic-url]: https://docs.pydantic.dev\n\n[starlette-url]: https://www.starlette.io/\n\n[uvicorn-url]: https://www.uvicorn.org/\n\n[redis-url]: https://redis.io/\n\n[html5-url]: https://developer.mozilla.org/en-US/docs/Glossary/HTML5\n\n[jwt-url]: https://jwt.io/\n\n[pycharm-url]: https://www.jetbrains.com/pycharm/\n\n[markdown-url]: https://daringfireball.net/projects/markdown/\n\n[swagger-ui-url]: https://swagger.io/\n\n[github-url]: https://github.com/jpcadena/fastapi-graphql\n\n[ruff-url]: https://beta.ruff.rs/docs/\n\n[black-url]: https://github.com/psf/black\n\n[mypy-url]: http://mypy-lang.org/\n\n[visual-studio-code-url]: https://code.visualstudio.com/\n\n[poetry-url]: https://python-poetry.org/\n\n[postgresql-url]: https://www.postgresql.org/\n\n[isort-url]: https://pycqa.github.io/isort/\n\n[github-actions-url]: https://github.com/features/actions\n\n[pre-commit-url]: https://pre-commit.com/\n\n[css3-url]: https://developer.mozilla.org/en-US/docs/Web/CSS\n\n[license-url]: https://opensource.org/licenses/MIT\n\n[graphene-url]: https://docs.graphene-python.org/en/latest/\n\n[graphql-playground-url]: https://github.com/graphql/graphql-playground\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcadena%2Ffastapi-graphql","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjpcadena%2Ffastapi-graphql","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjpcadena%2Ffastapi-graphql/lists"}