{"id":18438677,"url":"https://github.com/seapagan/fastapi-tui","last_synced_at":"2025-08-02T10:05:14.036Z","repository":{"id":227479888,"uuid":"771526925","full_name":"seapagan/fastapi-tui","owner":"seapagan","description":"Example TUI to control a fastapi development server, showing the logs in a scrollable panel. Work in progress as a learning experience","archived":false,"fork":false,"pushed_at":"2024-11-25T18:14:53.000Z","size":2479,"stargazers_count":3,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T21:40:51.534Z","etag":null,"topics":["fastapi","logging","python","textual","tui","uvicorn"],"latest_commit_sha":null,"homepage":"","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/seapagan.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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-13T13:14:05.000Z","updated_at":"2024-12-28T16:09:59.000Z","dependencies_parsed_at":"2024-08-27T23:06:12.266Z","dependency_job_id":"6d17d6d4-1940-474e-b9db-1d6e4f639ab7","html_url":"https://github.com/seapagan/fastapi-tui","commit_stats":null,"previous_names":["seapagan/fastapi-tui"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/seapagan/fastapi-tui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Ffastapi-tui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Ffastapi-tui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Ffastapi-tui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Ffastapi-tui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/seapagan","download_url":"https://codeload.github.com/seapagan/fastapi-tui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/seapagan%2Ffastapi-tui/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268370018,"owners_count":24239745,"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","status":"online","status_checked_at":"2025-08-02T02:00:12.353Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fastapi","logging","python","textual","tui","uvicorn"],"created_at":"2024-11-06T06:21:05.883Z","updated_at":"2025-08-02T10:05:13.995Z","avatar_url":"https://github.com/seapagan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastapi Tui \u003c!-- omit in toc --\u003e\n\nThis is a work in progress to see how to use\n[Textual](https://textual.textualize.io/) and\n[FastAPI](https://fastapi.tiangolo.com/) together, and to see if it's possible\nto create a TUI application that can start/stop a FastAPI server and display the\nlogs in the TUI. This is primarily for development since you would not want to\nrun a FastAPI server in a TUI in production.\n\nThe code here works, but needs tidying up. The TUI application is very basic and\nI have made no effort to optimize it, it's also my first Textual App so don't\nexpect too much :grin:\n\n- [In Action](#in-action)\n- [Development setup](#development-setup)\n- [TUI application](#tui-application)\n- [FastAPI server](#fastapi-server)\n- [Further Plans](#further-plans)\n- [License](#license)\n- [Credits](#credits)\n\n## In Action\n\n![Example](media/screencast.gif)\n\n## Development setup\n\nInstall the dependencies using Poetry:\n\n```console\n$ poetry install\n```\n\nThen, activate the virtual environment:\n\n```console\n$ poetry shell\n```\n\n## TUI application\n\nYou can run the application using the following command:\n\n```console\n$ fastapi-tui\n```\n\nThe application allows you to start and stop the FastAPI server, and to display\n(and clear) the log output in a separate panel.\n\n## FastAPI server\n\nThe project contains a very basic FastAPI server. You can run it directly using\nthe following command:\n\n```console\n$ uvicorn fastapi_tui.server:api --reload\n```\n\nThere is a single endpoint at `\"/\"` that returns a JSON response with a message.\nThis server will be used initially to test the TUI application. The \"`/docs`\"\nand \"`/redoc`\" endpoints are also available for testing the FastAPI server.\n\n## Further Plans\n\nSee the [TODO](TODO.md) file for a list of things I want to do next with this\nproject. The original idea was to see if I could create a TUI application that\ncould start/stop a FastAPI server and display the logs in the TUI, which I have\ndone. The next steps are to tidy up the code and to see if I can make the TUI\napplication more useful. Not sure how far I'll take this, but it's been a fun\nexperiment so far.\n\n## License\n\nThis project is released under the terms of the MIT license.\n\n## Credits\n\nThe original Python boilerplate for this package was created using\n[Pymaker](https://github.com/seapagan/py-maker) by [Grant\nRamsay](https://github.com/seapagan) (Me! :grin:)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseapagan%2Ffastapi-tui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fseapagan%2Ffastapi-tui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fseapagan%2Ffastapi-tui/lists"}