{"id":25813712,"url":"https://github.com/lukeharwood11/fastapi-chat-app-template","last_synced_at":"2026-05-08T01:37:11.781Z","repository":{"id":264385687,"uuid":"893195391","full_name":"lukeharwood11/fastapi-chat-app-template","owner":"lukeharwood11","description":"A FastAPI template that includes a chat application frontend for quick prototyping.","archived":false,"fork":false,"pushed_at":"2024-11-23T23:14:17.000Z","size":261,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-24T00:18:55.231Z","etag":null,"topics":["fastapi","llms","mle","python"],"latest_commit_sha":null,"homepage":"https://lukeharwood.dev","language":"JavaScript","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/lukeharwood11.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2024-11-23T19:30:30.000Z","updated_at":"2024-11-23T23:18:06.000Z","dependencies_parsed_at":"2024-11-24T00:28:57.187Z","dependency_job_id":null,"html_url":"https://github.com/lukeharwood11/fastapi-chat-app-template","commit_stats":null,"previous_names":["lukeharwood11/chat-app-template","lukeharwood11/fastapi-chat-app-template"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeharwood11%2Ffastapi-chat-app-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeharwood11%2Ffastapi-chat-app-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeharwood11%2Ffastapi-chat-app-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lukeharwood11%2Ffastapi-chat-app-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lukeharwood11","download_url":"https://codeload.github.com/lukeharwood11/fastapi-chat-app-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241090718,"owners_count":19908005,"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","llms","mle","python"],"created_at":"2025-02-28T02:49:43.313Z","updated_at":"2026-05-08T01:37:11.753Z","avatar_url":"https://github.com/lukeharwood11.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FastAPI Chat App Template \n![badge](https://badgen.net/badge/MLE/Template/blue?icon=link)\n\nThis repository contains a quick start for creating a chat app with a FastAPI server.\n\n![GIF](./img/FastAPIChatTemplate.gif)\n\n## Getting Started\n\n### Project structure\n\n```\n.\n├── api/\n│   ├── __init__.py\n│   ├── llm         # business logic for calling llm\n│   ├── controller  # interface connecting app logic to the router\n│   ├── main.py     # define application\n│   ├── models.py   # define request models here\n│   ├── router.py   # define routes here\n│   └── settings.py # interface for using environment variables\n├── build/          # directory built by `yarn build`\n├── client/         # client code (typescript)\n├── config/         # js config files, shouldn't need to modify\n├── docker/         # docker config files\n│   └── Dockerfile\n├── node_modules/   # client dependencies generated by `yarn install`\n│   └── ...\n├── scripts/\n├── venv/           # virtual environment\n├── example.env     # file showing what environment variables to put in .env file\n├── .env            # .env file defining values that will be pulled in during development\n├── package.json            # react app config\n├── requirements.txt        # python production dependencies\n├── requirements-dev.txt    # dev dependencies\n...\n└── docker-compose.yml      # local docker run configuration\n\n```\n \n### Prerequisites\n1. Ensure you have python installed (this project was built with [Python 3.11](https://www.python.org/downloads/release/python-3119/))\n\nCreate a virtual environment with `venv`\n```bash\n# install virtualenv (if not already installed)\npip install -m virtualenv\n# create the new virtual environment\npython -m virtualenv venv\n\n# activate the virtual environement\n# windows\n./venv/Scripts/activate\n# mac / linux\nsource ./venv/bin/activate\n```\n2. Ensure you have [node](https://nodejs.org/en/download/package-manager) installed.\n3. Install yarn\n\n```bash\nnpm install -g yarn\n```\n\n### Prepare your Development Environment\n#### Python\n```bash\npip install -r requirements-dev.txt\n```\n\nTo install all the necessary dependencies for python.\n\n#### Client\nRun the following command to install the client dependencies:\n\n```bash\n# install deps\nyarn install\n# build client application\n# if you don't do this, `yarn start:server` in the next step will fail!\nyarn build\n```\n#### Environment Variables\nNext create a `.env` file in the root directory and copy/paste the keys from [`./example.env`](./example.env). \n\nReplace the values with actual api-keys/model names.\n\n### Run the App!\nI included a command to start the server in development mode, which can be found in the [package.json](./package.json) under the \"scripts\" key.\n\n```bash\nyarn start:server\n```\n\nThe server will listen to any changes in the project and will reload for you so you don't have to continue re-running that command.\n\n### Running with Docker\n\nFollow [Docker's instructions](https://www.docker.com/get-started/) on getting started if you don't already have docker installed.\n\n#### `docker run`\n\nFirst we must build the api/client\n```bash\ndocker build -t chat -f ./docker/Dockerfile .\n```\n\nNext we can run the application\n```bash\ndocker run --env-file .env -p 8080:8080 chat\n```\n\n#### Docker Compose\n\nFirst we must build the api/client\n```bash\ndocker-compose build\n```\n\nRun the built app\n```bash\n# run detached\ndocker-compose up -d \n# spin things down\ndocker-compose down\n```\n\n### (Extra) Client Application Development\n\n\u003e If you don't want/need to work on the client application these steps are not needed.\n\n### `yarn start:client`\n\n- Runs the app in the development mode.\n    - Open [http://localhost:3000](http://localhost:3000) to view it in the browser.\n- The dev proxy will forward all api requests made to localhost:3000/api to localhost:8080/api.\n\n- The page will reload if you make edits.\n- You will also see any lint errors in the console.\n\n### `yarn build`\n\nBuilds the app for production to the `build` folder.\\\nIt correctly bundles React in production mode and optimizes the build for the best performance.\n\nThe build is minified and the filenames include the hashes.\\\nYour app is ready to be deployed!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeharwood11%2Ffastapi-chat-app-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukeharwood11%2Ffastapi-chat-app-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukeharwood11%2Ffastapi-chat-app-template/lists"}