Skip to content

pratik-codes/ava-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

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:

    cd ava-frontend
  2. Install dependencies:

    pnpm install
  3. Start the development server:

    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:

    cd ava-backend
  2. Create a virtual environment (if not already created):

    python -m venv venv
  3. Activate the virtual environment:

    • On macOS/Linux:
      source venv/bin/activate
    • On Windows:
      venv\Scripts\activate
  4. Install dependencies:

    pip install -r requirements.txt
  5. Start the Flask application:

    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:

    pytest