This guide will walk you through setting up LanguagePal on your local machine.
- Python 3.11 or higher
- A Google Gemini API key (Pro 1.0 or Flash 2.0)
- Git (optional, for cloning the repository)
git clone https://github.com/BroskiJ/LanguageLearningChatbot.git
cd LanguageLearningChatbotAlternatively, you can download the code as a ZIP file from GitHub and extract it.
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows:
venv\Scripts\activate
# On macOS/Linux:
source venv/bin/activate# Install from the packages.txt file
pip install -r packages.txtYou'll need to set your Google Gemini API key as an environment variable:
set GEMINI_API_KEY=your_api_key_here
set SECRET_KEY=your_secret_key_here
export GEMINI_API_KEY=your_api_key_here
export SECRET_KEY=your_secret_key_here
Add these to your environment variables configuration or your shell's profile file.
python main.pyThe application will be available at http://localhost:5000
By default, LanguagePal uses session storage for simplicity. If you want to use a database:
- Set the
DATABASE_URLenvironment variable to your database connection string - Uncomment and modify the database configuration in
app.pyas needed
To run on a different port:
python main.py --port 8080Or modify the port in the main.py file.
If you see errors related to the Gemini API key:
- Verify that your API key is correct
- Check that the environment variable is set correctly
- Ensure your API key has the necessary permissions
If you encounter package installation issues:
- Make sure you're using Python 3.11+
- Try installing packages one by one
- Check for any system-specific requirements for packages like psycopg2-binary
For deployment to production, we recommend:
- Using gunicorn as a WSGI server
- Setting up HTTPS with a reverse proxy like Nginx
- Using environment variables for all sensitive information
- Setting DEBUG=False in production
gunicorn --bind 0.0.0.0:5000 main:app