Skip to content

joaopedrodev23/talkingtomachine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🤓 Chat Helper – Chatbot with FastAPI + OpenAI + SQLite

This project is a real-time chatbot with a frontend in HTML/JS/CSS and a backend in FastAPI, integrated with the OpenAI API.
It supports message streaming, database persistence (SQLite) and file uploads (TXT and PDF) for preview.


🚀 Tech stack

  • FastAPI (backend)
  • SQLite + SQLAlchemy (database)
  • OpenAI API (AI assistant)
  • HTML + CSS + JS (frontend)
  • Jinja2 (templates)
  • Uvicorn (ASGI server)

📂 Project structure

PROJETOCHAT/ │── app.py # FastAPI backend (routes and main logic) │── database.py # Database models (SQLAlchemy) │── requirements.txt # Project dependencies │── .gitignore # Files ignored by Git │── .env # Environment variables (NOT uploaded to GitHub) │ ├── templates/ │ └── index.html # Main frontend │ ├── static/ │ ├── style.css # Styles │ └── script.js # Frontend logic


⚙️ How to run locally

1. Clone the repository

git clone https://github.com/joaopedrodev23/talkingtomachine.git
cd talkingtomachine


2. Create a virtual environment
python -m venv .venv
# Linux/Mac:
source .venv/bin/activate
# Windows:
.venv\Scripts\activate

3. Install dependencies
pip install -r requirements.txt

4. Configure environment variables
Create a file named .env in the root folder with:
OPENAI_API_KEY=your_api_key_here

5. Run the server
uvicorn app:app --reload
Access at 👉 http://127.0.0.1:8000

📌 Features

💬 Real-time chat with streaming responses
🗂️ Conversation history saved in SQLite
🌙 Dark/light mode
📎 File upload (TXT/PDF) with preview
💾 Export chat as .md
🔄 Conversation persistence by chatId

About

Real-time chatbot built with FastAPI, OpenAI API, SQLite, and HTML/CSS/JS.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors