A minimal Chatbot Platform built with FastAPI (backend) and HTML/CSS/JS (frontend).
It supports authentication, project/agent creation, document uploads, and context-aware conversations with an LLM using the OpenAI Responses API.
You can try the hosted version here:
https://chatbot-4-jvnz.onrender.com/
- Register and log in with email and password
- JWT-based authentication
- Secure password hashing with
bcrypt
- Each user can create multiple projects
- Projects are private to each user
- Projects store uploaded files and chat history
- Supports
.pdf,.docx, and.txtfiles - Extracts text and uses it as context during chats
- Optional support for uploading to the OpenAI Files API
- Chat sessions are scoped to a project
- Uploaded documents are used as context when generating answers
- Integrated with the OpenAI Responses API (extensible to other LLM services)
- Simple login/registration form (email + password)
- Project creation and selection
- File upload and chat box with conversation history
WEB_CHATBOT/
├── backend/
│ ├── main.py # FastAPI application
│ ├── index.html # Frontend UI
│ ├── requirements.txt # Dependencies
│ ├── .env.example # Example environment variables
│ └── uploads/ # Temporary file storage (ignored in git)
├── README.md # Project documentation
└── .gitignore # Ignore venv, .env, cache files, etc.
- Python 3.9+
- An OpenAI API key (or compatible provider)
- Git
-
Clone the repository:
git clone https://github.com/YOUR-USERNAME/web-chatbot.git cd web-chatbot/backend -
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Copy
.env.exampleto.envand set your secrets:OPENAI_API_KEY=your_openai_api_key OPENAI_MODEL=gpt-4o-mini SECRET_KEY=your_secret_key -
Run the application:
uvicorn main:app --reload
-
Open the app in your browser:
http://127.0.0.1:8000/
This project is deployed on Render.
To deploy your own version:
- Push your code to GitHub
- Create a new Web Service on Render
- Connect your GitHub repo
- Set build command:
pip install -r backend/requirements.txt
- Set start command:
uvicorn backend.main:app --host 0.0.0.0 --port 10000
- Add environment variables in the Render dashboard (
OPENAI_API_KEY,OPENAI_MODEL,SECRET_KEY)
Your app will be live at a Render-provided URL.