Follow these simple steps to run the API using Docker Compose:
-
Set Up Environment Variables: Create a
.env
file in the project root:SECRET_KEY=your-secret-key JWT_SECRET_KEY=your-jwt-secret OPENAI_API_KEY=your-openai-api-key OPENAI_MODEL=gpt-4o-mini
-
Start the Application:
docker-compose up -d --build
-
Access the API:
- API available at http://localhost:5000
- Health check at http://localhost:5000/health
-
API Documentation:
-
Set Up Test Environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate pip install -r requirements.txt pip install pytest pytest-cov
-
Run All Tests:
python -m pytest
-
Run Specific Test Categories:
python -m pytest tests/unit/ # Unit tests only python -m pytest tests/integration/ # Integration tests only python -m pytest -v # Verbose output python -m pytest --cov=app # With coverage
- Database Connection: Verify port 5432 is available for container communication
- Test Database Issues: Delete test.db and restart tests if database errors occur
- API Key Issues: Ensure your OpenAI API key has sufficient quota