{"id":20536275,"url":"https://github.com/agn-7/ifsguid-backend","last_synced_at":"2025-04-14T07:21:27.633Z","repository":{"id":206432989,"uuid":"715147532","full_name":"agn-7/ifsguid-backend","owner":"agn-7","description":"Async AI Chat Application on top of FastAPI","archived":false,"fork":false,"pushed_at":"2024-02-10T16:46:15.000Z","size":235,"stargazers_count":30,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-02-10T17:40:57.995Z","etag":null,"topics":["aiosqlite","alembic","async","asyncio","asyncpg","docker","docker-compose","fastapi","gunicorn","nginx","poetry","postgresql","pydantic","pydantic-v2","pytest","python","sqlalchemy","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/agn-7.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-11-06T15:14:03.000Z","updated_at":"2023-12-19T16:38:04.000Z","dependencies_parsed_at":"2024-11-16T00:36:08.347Z","dependency_job_id":"994f3c8c-3bb8-4d49-87da-cdad3cfc50e9","html_url":"https://github.com/agn-7/ifsguid-backend","commit_stats":null,"previous_names":["agn-7/ifsguid-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agn-7%2Fifsguid-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agn-7%2Fifsguid-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agn-7%2Fifsguid-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/agn-7%2Fifsguid-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/agn-7","download_url":"https://codeload.github.com/agn-7/ifsguid-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837175,"owners_count":21169379,"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":["aiosqlite","alembic","async","asyncio","asyncpg","docker","docker-compose","fastapi","gunicorn","nginx","poetry","postgresql","pydantic","pydantic-v2","pytest","python","sqlalchemy","uvicorn"],"created_at":"2024-11-16T00:36:04.915Z","updated_at":"2025-04-14T07:21:27.609Z","avatar_url":"https://github.com/agn-7.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Docker](https://badgen.net/badge/icon/docker?icon=docker\u0026label)](https://https://docker.com/)\n[![CI](https://github.com/agn-7/ifsguid-backend/workflows/build/badge.svg)](https://github.com/agn-7/ifsguid-backend/actions/workflows/github-actions.yml)\n[![black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![codecov](https://codecov.io/gh/agn-7/ifsguid-backend/graph/badge.svg?token=RGwuSevG8u)](https://codecov.io/gh/agn-7/ifsguid-backend)\n\n# IFSGuid Backend\nAsync AI Chat Application Powered by gpt4free on top of FastAPI\n\n## Setup\nIt contains two generic entity models Interaction and Message.\nWe store all of the data in the Postgres database.\nThe interaction with the database is done with the [SQLAlchemy](https://www.sqlalchemy.org/) library, and the simple GET and POST endpoints are exposed via the API, which is written with the [FastAPI](https://fastapi.tiangolo.com/) framework.\n\nTo manage dependencies, we use [poetry](https://python-poetry.org/).\n\nTo launch an API instance, you should:\n1. Have a running Postgres instance, e.g. in a container. The application will read the [.env](/.env) file to access the database.\n2. Create a virtual environment and install the dependencies in it. You can run `poetry install` for that.\n3. Use [start_app.sh](/start_app.sh) to run the server. By default, it will bind to http://localhost:8000.\n4. An automatically generated documentation can be found at http://localhost:8000/docs. The endpoints are accessible at http://localhost:8000/api/\u003cendpoint_name\u003e.\n\nYou can also run the project via `docker-compose` (i.e. `docker compose up -d`) on port `80` in which you would need the [.docker.env](/.docker.env) containing the following variable to create the database:\n\n```\nSQLALCHEMY_DATABASE_URI=postgresql+asyncpg://\u003cusername\u003e:\u003cpassword\u003e@ifsguid_db/\u003cdb-name\u003e\n```\n\n\n---\nHere is a benchmark of the API using by [wrk](https://github.com/wg/wrk) to demonstrate the performance of the service in different configuration:\n\n| Service      | Loading Strategy | WRK Configuration   | Throughput (reqs/sec) |\n|--------------|------------------|---------------------|-----------------------|\n| Async        | Joined           | 4 threads, 10 conns | 132                   |\n| Async        | Selectin         | 4 threads, 10 conns | 112                   |\n| Sync         | Lazy             | 4 threads, 10 conns | 36                    |\n| Sync         | Joined           | 4 threads, 10 conns | 132                   |\n| Sync         | Selectin         | 4 threads, 10 conns | 114                   |\n| Async        | Joined           | 4 threads, 50 conns | 159                   |\n| Sync         | Joined           | 4 threads, 50 conns | 1                     |\n| **Async**    | **Joined**       | 4 threads, 15 conns | **126**               |\n| **Sync**     | **Joined**       | 4 threads, 15 conns | **69**                |\n\n\n![benchmark](https://github.com/agn-7/ifsguid-backend/assets/14202344/d435b604-f492-4fc0-b6a0-26ca3284d448)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagn-7%2Fifsguid-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fagn-7%2Fifsguid-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fagn-7%2Fifsguid-backend/lists"}