{"id":27946008,"url":"https://github.com/pureleach/backend-test-maslov.ai","last_synced_at":"2025-05-07T13:47:34.380Z","repository":{"id":291762610,"uuid":"978320275","full_name":"PureLeach/backend-test-maslov.ai","owner":"PureLeach","description":"A simple application on FastAPI + Strawberry GraphQL to retrieve a list of books and authors from PostgreSQL","archived":false,"fork":false,"pushed_at":"2025-05-06T11:59:32.000Z","size":51,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-06T12:50:26.426Z","etag":null,"topics":["fastapi","graphql","postgresql"],"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/PureLeach.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}},"created_at":"2025-05-05T20:00:17.000Z","updated_at":"2025-05-06T11:59:35.000Z","dependencies_parsed_at":"2025-05-06T12:50:29.157Z","dependency_job_id":"cbaafee5-18be-4244-af2f-30b05ef5842e","html_url":"https://github.com/PureLeach/backend-test-maslov.ai","commit_stats":null,"previous_names":["pureleach/backend-test-maslov.ai"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureLeach%2Fbackend-test-maslov.ai","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureLeach%2Fbackend-test-maslov.ai/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureLeach%2Fbackend-test-maslov.ai/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PureLeach%2Fbackend-test-maslov.ai/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PureLeach","download_url":"https://codeload.github.com/PureLeach/backend-test-maslov.ai/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252890221,"owners_count":21820344,"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":["fastapi","graphql","postgresql"],"created_at":"2025-05-07T13:47:33.377Z","updated_at":"2025-05-07T13:47:34.368Z","avatar_url":"https://github.com/PureLeach.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 📚 GraphQL Books API\n\nA simple application on FastAPI + Strawberry GraphQL to retrieve a list of books and authors from PostgreSQL.\n\n## 🚀 Technologies used\n\n- Python 3.12+\n- FastAPI\n- Strawberry (GraphQL)\n- PostgreSQL\n- Databases\n- asyncpg\n- yoyo (migrations)\n- ruff\n- mypy\n- docker-compose\n\n\n## 📦 Installation and startup\n\n1. **Clone the repository:**\n\n```bash\ngit clone https://github.com/PureLeach/backend-test-maslov.ai.git\ncd backend-test-maslov.ai\n````\n\n2. **Create and activate a virtual environment:**\n\n```bash\npoetry shell\n```\nNOTE: If it doesn't work, install plugin `poetry self add poetry-plugin-shell`\n\n3. **Install dependencies:**\n\n```bash\npoetry install\n```\n\n4. **Create'.env` or specify the environment variables:**\n\n\n```bash\ncp .env.example .env\n```\n\n5. **Run PostgreSQL and apply migrations**\n\n```bash\ndocker-compose up -d\nmake migrate\n```\n\n6. **Start the app:**\n\n```bash\nmake run\n```\n\n7. **Open GraphQL Playground:**\n\nGo to the browser: [http://localhost:8000/graphql](http://localhost:8000/graphql)\n\n---\n\n## 🔍 Examples of requests\n\n### 1. Get all the books\n```graphql\nquery {\n  books {\n    title\n    author {\n      name\n    }\n  }\n}\n```\n\n### 2. Get books by author (e.g., Oscar Wilde - ID = 1)\n```graphql\nquery {\n  books(authorIds: [1]) {\n    title\n    author {\n      name\n    }\n  }\n}\n```\n\n### 3. Search for books by part of title (case is not important)\n```graphql\nquery {\n  books(search: \"adventures\") {\n    title\n    author {\n      name\n    }\n  }\n}\n```\n\n### 4. Get no more than 2 books\n```graphql\nquery {\n  books(limit: 2) {\n    title\n    author {\n      name\n    }\n  }\n}\n```\n\n### 5. Combination of all filters\n```graphql\nquery {\n  books(authorIds: [3], search: \"Adventures\", limit: 1) {\n    title\n    author {\n      name\n    }\n  }\n}\n```\n\n### 6. No match (empty result)\n```graphql\nquery {\n  books(search: \"Nonexistent\") {\n    title\n    author {\n      name\n    }\n  }\n}\n```\n\n## 🌐 Interfaces\n\n- Swagger UI: http://localhost:8000/docs\n- Strawberry GraphiQL playground: http://localhost:8000/graphql\n- pgAdmin: http://localhost:5050\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpureleach%2Fbackend-test-maslov.ai","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpureleach%2Fbackend-test-maslov.ai","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpureleach%2Fbackend-test-maslov.ai/lists"}