Skip to main content

Overview

EduMate requires several environment variables for proper configuration. This guide covers all the environment variables used across the application.
Create a .env file in your project root to store these variables securely.

Required Variables

AI/ML Configuration

GEMINI_API_KEY
string
required
Google Gemini API key for generating MCQ assessments.Used in:
  • chatting.py:11
  • backend/queue/chat.py:11
Example:
GEMINI_API_KEY=your_gemini_api_key_here
Get your API key from Google AI Studio

Database Configuration

DATABASE_URL
string
required
PostgreSQL database connection string.Used in: backend/database.py:7Format:
postgresql://username:password@host:port/database_name
Default configuration:
postgresql://edumate_user:edumate_pass@localhost:5432/edumate
Replace default credentials in production environments!

Security Configuration

SECRET_KEY
string
required
Secret key for JWT token generation and encryption.Used in: backend/server.py:31Default (for development only):
SECRET_KEY=super_secret_edumate_key
Generate a strong, random secret key for production:
python -c "import secrets; print(secrets.token_urlsafe(32))"
ALGORITHM
string
default:"HS256"
JWT signing algorithm.Used in: backend/server.py:32
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES
integer
default:"1440"
JWT access token expiration time in minutes (default: 24 hours).Used in: backend/server.py:33
ACCESS_TOKEN_EXPIRE_MINUTES=1440
RESET_TOKEN_EXPIRE_MINUTES
integer
default:"15"
Password reset token expiration time in minutes.Used in: backend/server.py:34
RESET_TOKEN_EXPIRE_MINUTES=15

Redis Configuration

REDIS_HOST
string
default:"localhost"
Redis server host address.Used in: backend/client/rq_client.py:6
REDIS_HOST=localhost
REDIS_PORT
string
default:"6379"
Redis server port number.Used in: backend/client/rq_client.py:7
REDIS_PORT=6379

Vector Database Configuration

QDRANT_URL
string
default:"http://localhost:6333"
Qdrant vector database URL.Used in:
  • backend/queue/chat.py:38
  • backend/queue/doc_chunking.py:99
QDRANT_URL=http://localhost:6333

Ollama Configuration

OLLAMA_BASE_URL
string
default:"http://localhost:11434"
Ollama server base URL for embeddings.Used in:
  • backend/queue/chat.py:25,33
  • backend/queue/doc_chunking.py:93
OLLAMA_BASE_URL=http://localhost:11434
EMBEDDING_MODEL
string
default:"qwen3-embedding:0.6b"
Ollama embedding model name.Used in:
  • backend/queue/chat.py:32
  • backend/queue/doc_chunking.py:92
EMBEDDING_MODEL=qwen3-embedding:0.6b
Alternative model: nomic-embed-text

Example .env File

# AI/ML
GEMINI_API_KEY=your_gemini_api_key_here

# Database
DATABASE_URL=postgresql://edumate_user:edumate_pass@localhost:5432/edumate

# Security
SECRET_KEY=your_super_secret_key_here_change_in_production
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=1440
RESET_TOKEN_EXPIRE_MINUTES=15

# Redis
REDIS_HOST=localhost
REDIS_PORT=6379

# Vector Database
QDRANT_URL=http://localhost:6333

# Ollama
OLLAMA_BASE_URL=http://localhost:11434
EMBEDDING_MODEL=qwen3-embedding:0.6b

Loading Environment Variables

EduMate uses python-dotenv to load environment variables:
from dotenv import load_dotenv
import os

load_dotenv()

GEMINI_API_KEY = os.getenv('GEMINI_API_KEY')
Make sure to add .env to your .gitignore file to prevent committing sensitive credentials.

Build docs developers (and LLMs) love