https://github.com/pratik-codes/ava-bot
An chatbot built on openai and flask (python)
https://github.com/pratik-codes/ava-bot
ai chatbot flask langchain openai python react
Last synced: 2 months ago
JSON representation
An chatbot built on openai and flask (python)
- Host: GitHub
- URL: https://github.com/pratik-codes/ava-bot
- Owner: pratik-codes
- Created: 2024-09-08T09:17:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-11T19:53:00.000Z (over 1 year ago)
- Last Synced: 2025-03-28T07:13:40.567Z (about 1 year ago)
- Topics: ai, chatbot, flask, langchain, openai, python, react
- Language: TypeScript
- Homepage: https://avaai.vercel.app
- Size: 271 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Ava AI Chatbot
## Overview
This repository contains a web application with a frontend built using Next.js and React, and a backend developed in Flask. The frontend and backend are organized in separate directories and can be run independently.
## Directory Structure
```
root/
│
├── ava-backend/ # Backend (Flask)
│ ├── __init__.py
│ ├── app.py
│ ├── constants.py
│ ├── handlers.py
│ ├── llm.py
│ ├── routes.py
│ ├── requirements.txt
│ ├── test/
│ │ ├── __init__.py
│ │ ├── test_app.py
│ │ ├── test_handlers.py
│ │ ├── test_llm.py
│ │ └── test_routes.py
│ └── venv/ # Virtual environment
│
└── ava-frontend/ # Frontend (Next.js + React)
├── README.md
├── components.json
├── next-env.d.ts
├── next.config.mjs
├── package-lock.json
├── package.json
├── pnpm-lock.yaml
├── postcss.config.mjs
├── public/
├── src/
│ ├── components/
│ ├── lib/
│ ├── pages/
│ ├── styles/
│ └── utils/
└── tailwind.config.ts
└── tsconfig.json
```
## Setup
### Frontend
1. Navigate to the `ava-frontend` directory:
```sh
cd ava-frontend
```
2. Install dependencies:
```sh
pnpm install
```
3. Start the development server:
```sh
pnpm run dev
```
The frontend will be available at `http://localhost:3000`.
### Backend
### Make sure to have `.env` file in you root directory with all the required enviorment variable listed in `.env.sample`
1. Navigate to the `ava-backend` directory:
```sh
cd ava-backend
```
2. Create a virtual environment (if not already created):
```sh
python -m venv venv
```
3. Activate the virtual environment:
- On macOS/Linux:
```sh
source venv/bin/activate
```
- On Windows:
```sh
venv\Scripts\activate
```
4. Install dependencies:
```sh
pip install -r requirements.txt
```
5. Start the Flask application:
```sh
python app.py
```
The backend will be available at `http://localhost:5000`.
## Testing
### Backend
1. Ensure the virtual environment is activated.
2. Run the tests:
```sh
pytest
```