A modern AI chat application with a FastAPI backend and React frontend.
- Backend: FastAPI (Python) with OpenAI integration
- Frontend: React + TypeScript with a modern UI
- Styling: Tailwind CSS for responsive design
- API: RESTful API for communication between frontend and backend
- Dockerized: Easy deployment with Docker Compose
- Python 3.8+
- Node.js 14+
- Docker and Docker Compose (optional)
-
Navigate to the backend directory:
cd backend -
Install dependencies:
pip install -r requirements.txt -
Create a
.envfile with your OpenAI API key:OPENAI_API_KEY=your_api_key_here -
Start the server:
uvicorn app:app --reload
The backend will be available at http://localhost:8000
-
Navigate to the frontend directory:
cd frontend -
Install dependencies:
npm install -
Start the development server:
npm start
The frontend will be available at http://localhost:3000
-
Run the entire stack with Docker Compose:
docker-compose up --build -
Access:
- Backend: http://localhost:8000
- Frontend: http://localhost:3000
backend/: FastAPI backend with OpenAI integrationfrontend/: React frontend with TypeScript and Tailwind CSS
POST /query: Send a query to the AIGET /health: Check the health of the backend
