This guide provides detailed instructions on how to set up and run the PolySEE project locally. The project consists of three main components:
- Frontend: A React-based user interface.
- Auth Service: A Node.js/Express service for authentication.
- Backend Core: A Python/FastAPI service for the AI/RAG functionality.
Frontend:
React Vite Tailwind CSS Framer Motion Lucide React Recharts Axios
Auth Service:
Node.js Express MongoDB JWT Bcrypt.js
Backend Core:
Python FastAPI LangChain ChromaDB Google Generative AI Google Cloud Speech
Before you begin, ensure you have the following installed on your machine:
- Node.js (v18 or higher) & npm - Download
- Python (v3.8 or higher) - Download
- MongoDB (Local instance or Atlas URI) - Download
- Git - Download
You will also need a Google API Key for the AI features (Gemini).
git clone <repository-url>
cd PolySEEThis service handles user authentication and connects to MongoDB.
-
Navigate to the
Authdirectory:cd Auth -
Install dependencies:
npm install
-
Configure environment variables:
- Create a
.envfile by copying the example:cp .env.example .env # On Windows Command Prompt: copy .env.example .env - Open
.envand update the values if necessary (especiallyMONGO_URIif your MongoDB is not local).PORT=4000 MONGO_URI=mongodb://localhost:27017/chatbot JWT_SECRET=your_strong_secret_here FRONTEND_ORIGIN=http://localhost:5173 FASTAPI_URL=http://localhost:8000
- Create a
-
Start the Auth service:
node index.js
- You should see a message indicating the server is running (e.g.,
Server running on port 4000).
- You should see a message indicating the server is running (e.g.,
This service powers the RAG (Retrieval-Augmented Generation) and AI features.
-
Navigate to the
backend/coredirectory:cd ../backend/core -
Create a virtual environment:
python -m venv .venv
-
Activate the virtual environment:
- Windows:
.venv\Scripts\activate
- Mac/Linux:
source .venv/bin/activate
- Windows:
-
Install Python dependencies:
pip install -r requirements.txt
-
Configure environment variables:
- Create a
.envfile:cp .env.example .env # On Windows Command Prompt: copy .env.example .env - Crucial: Open
.envand add your Google API Key.GOOGLE_API_KEY=your_google_api_key_here PERSIST_DIR=./chroma_db TEMP_MD_DIR=./temp_md HOST=127.0.0.1 PORT=8000
- Create a
-
Start the Backend service:
uvicorn app:app --reload --host 127.0.0.1 --port 8000
- The API docs will be available at
http://127.0.0.1:8000/docs.
- The API docs will be available at
-
Navigate to the
Frontenddirectory:cd ../../Frontend -
Install dependencies:
npm install
-
Start the development server:
npm run dev
- The application will typically run at
http://localhost:5173.
- The application will typically run at
- Frontend runs on
http://localhost:5173 - Auth Service runs on
http://localhost:4000 - Backend Core runs on
http://localhost:8000
Ensure all three terminals are running simultaneously for the full application to work.
- MongoDB Connection Error: Ensure your MongoDB service is running locally (
mongod) or your connection string inAuth/.envis correct. - Python Module Not Found: Make sure you activated the virtual environment (
.venv) before runningpip install. - CORS Errors: Check the
FRONTEND_ORIGINinAuth/.envmatches your Frontend URL. - Google API Error: Verify your
GOOGLE_API_KEYinbackend/core/.envis valid and has access to the Generative AI API.
Happy Coding! 👨💻👩💻