BGChat is an AI-powered tool that helps users understand board game rules and situations by analyzing rulebook PDFs and providing contextual answers to questions.
- AI-Powered Q&A: Uses GPT-4 to answer board game questions
- Semantic Search: Finds relevant rulebook sections using embeddings
- Streaming Responses: Real-time AI responses
- PDF Integration: Direct access to rulebook PDFs
- User Authentication: Secure Auth0 integration
- Message History: Persistent chat history per user
- Token Management: Daily usage limits and tracking
- Frontend: React 19 with TypeScript, Chakra UI, deployed on Vercel
- Backend: Flask 3.1 API with Python 3.12, deployed on Railway
- Database: MongoDB Atlas
- Authentication: Auth0
- AI: OpenAI API
- Node.js 18+ and npm
- Python 3.12+
- MongoDB Atlas account
- Auth0 account
- OpenAI API key
- Clone the repository
git clone <repository-url>
cd BGChat- Backend Setup
cd backend
python3 -m venv myenv
source myenv/bin/activate # On Windows: myenv\Scripts\activate
pip install -r requirements.txt- Frontend Setup
cd frontend
npm install- Environment Configuration
Create .env.development in the backend/ directory:
FLASK_ENV=development
FLASK_DEBUG=True
FLASK_APP=run.py
# MongoDB
MONGODB_HOST=your-dev-mongodb-host
MONGODB_USERNAME=your-dev-username
MONGODB_PASSWORD=your-dev-password
MONGODB_DB_NAME=you-dev-db-name
# OpenAI
OPENAI_API_KEY=your-openai-api-key
# Auth0
AUTH0_DOMAIN=your-dev-auth0-domain
AUTH0_AUDIENCE=your-dev-audience
ALGORITHM=RS256
# Security
SECRET_KEY=dev-secret-key-change-in-productionCreate .env.development in the frontend/ directory:
REACT_APP_ENVIRONMENT=development
REACT_APP_API_URL=http://localhost:5000
REACT_APP_AUTH0_DOMAIN=your-dev-auth0-domain
REACT_APP_AUTH0_CLIENT_ID=your-dev-client-id
REACT_APP_AUTH0_AUDIENCE=your-dev-audience- Start Development Servers
./start-dev.sh- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.