{"id":21710669,"url":"https://github.com/mbrav/tasks_api","last_synced_at":"2026-04-21T10:01:19.543Z","repository":{"id":149795112,"uuid":"476869543","full_name":"mbrav/tasks_api","owner":"mbrav","description":"An 100% asynchronous Fast API service for tasks","archived":false,"fork":false,"pushed_at":"2022-04-02T16:28:45.000Z","size":375,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T16:41:54.565Z","etag":null,"topics":["apscheduler","async","fastapi","python","sqlalchemy"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbrav.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}},"created_at":"2022-04-01T21:10:35.000Z","updated_at":"2023-10-27T23:10:17.000Z","dependencies_parsed_at":null,"dependency_job_id":"fb91ac60-2e34-4149-8142-8f6549b1e5ba","html_url":"https://github.com/mbrav/tasks_api","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/mbrav%2Ftasks_api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Ftasks_api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Ftasks_api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbrav%2Ftasks_api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbrav","download_url":"https://codeload.github.com/mbrav/tasks_api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244666463,"owners_count":20490286,"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":["apscheduler","async","fastapi","python","sqlalchemy"],"created_at":"2024-11-25T23:16:48.382Z","updated_at":"2025-10-17T23:00:12.923Z","avatar_url":"https://github.com/mbrav.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![FastAPI and Pytest CI](https://github.com/mbrav/signup_api/actions/workflows/fastapi.yml/badge.svg)](https://github.com/mbrav/signup_api/actions/workflows/fastapi.yml)\n\n## FastAPI tasks_api (based on [signup_api](https://github.com/mbrav/signup_api))\n\nAn 100% asynchronous Fast API service for tasks.\n\n### Client-server application.\n\n#### Server\n\nResponsible for receiving and completing tasks. Tasks are executed strictly in turn and one at a time, sequentially. Processing client requests and executing tasks are done asynchronously.\n\nProvides the following interface:\n\n1. Gets the task type and data and adds the task to the execution queue. Returns the task ID.\n2. Returns the status of the task by ID (for example: queued, in progress, completed)\n    - Tasks can be edited and postponed;\n    - Tasks can be deleted;\n    - Tasks can be aborted\n3. By identifier returns the result of the task execution (provide that the result can be accessed several times).\n\nStorage of tasks (identifiers, data, and results) are done in a PostgreSQL database via [asyncpg](https://github.com/MagicStack/asyncpg)\n\nThe list of tasks (type) is predefined, to simulate the duration of the task, add the specified delay during its execution:\n\n##### 1. Reverse a string example\n\n**(example -\u003e elpmaxe)**\nDelay by 10 seconds since creation.\n\nTo execute the following code:\n\n```python\nasync def reverse(text: str) -\u003e str:\n    return text[::-1]\n```\n\nA POST request to `/api/tasks` such as this must be made:\n\n```json\n{\n\t\"name\": \"reverse\",\n\t\"qwargs\": {\n\t\t\"text\": \"hello\"\n\t},\n\t\"delay_seconds\": 10\n}\n```\n\n### Stack\n\nThe project uses [FastAPI](https://fastapi.tiangolo.com/) as a base framework with the following stack:\n\n-   Integration with [SQLAlchemy's](https://www.sqlalchemy.org/) new ORM statement paradigm to be implemented in [v2.0](https://docs.sqlalchemy.org/en/20/changelog/migration_20.html);\n-   Asynchronous PostgreSQL database via [asyncpg](https://github.com/MagicStack/asyncpg), one of the fastest and high performant Database Client Libraries for python/asyncio;\n-   A token authorization system using the [argon2 password hashing algorithm](https://github.com/P-H-C/phc-winner-argon2), the password-hashing function that won the [Password Hashing Competition (PHC)](https://www.password-hashing.net/);\n-   Asynchronous task scheduling using [apscheduler](https://github.com/agronholm/apscheduler)\n\n### Run FastAPI backend in Docker\n\nCopy .env file:\n\n```bash\ncp backend/.env.example backend/.env\n```\n\nWith docker-compose installed, do:\n\n```bash\ndocker-compose up\n```\n\nGo to [localhost/docs](http://0.0.0.0/docs) for SwaggerUI\n\nToken auth for superuser permissions:\n\n-   **User**: `admin`\n-   **Password**: `password`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrav%2Ftasks_api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbrav%2Ftasks_api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbrav%2Ftasks_api/lists"}