This project is a simple chat application built with FastAPI for the backend and HTMX for dynamic frontend updates.
- Python 3.10 or higher
- pip (Python package installer)
Follow these steps to set up and run the project on your local machine.
git clone https://github.com/brylie/langflow-fastapi-htmx.git
cd langflow-fastapi-htmxpython -m venv venvpython3 -m venv venvvenv\Scripts\activatesource venv/bin/activateWith the virtual environment activated, install the project dependencies:
pip install -r requirements.txtStart the FastAPI server using Uvicorn:
uvicorn chat:app --reloadThe --reload flag enables auto-reloading on code changes, which is useful for development.
Open your web browser and navigate to:
http://127.0.0.1:8000
You should now see the chat interface and be able to interact with the chatbot.
- The main application code is in
chat.py. - HTML templates are stored in the
templatesdirectory. - Static files (CSS, JavaScript) are in the
staticdirectory.
To run tests, use the following command:
pytestThis will execute all tests in the tests/ directory. For measuring test coverage, you can use pytest-cov by running:
pytest --cov=appThis command will provide a report on the test coverage for the application.
If you encounter any issues:
- Ensure you're using Python 3.10 or higher.
- Make sure your virtual environment is activated when installing dependencies and running the app.
- Check that all required dependencies are installed correctly.
- If you encounter any "Module not found" errors, try reinstalling the dependencies.
Contributions are welcome! Please feel free to submit a Pull Request.