Development Setup Guide
This guide will help you set up your development environment for contributing to FlavumHive.
Prerequisites
Required Software
- Python 3.8 or higher
- Git
- Chrome/Chromium (for Selenium)
- Node.js (for documentation)
Optional Tools
- Docker
- Visual Studio Code
- Python virtual environment tool
Installation Steps
1. Clone Repository
# Fork the repository first, then:
git clone https://github.com/yourusername/flavumhive.git
cd flavumhive
2. Python Environment
# Create virtual environment
python -m venv venv
# Activate virtual environment
# On Windows:
venv\Scripts\activate
# On Unix or MacOS:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
pip install -r requirements-dev.txt
3. Configuration
# Copy example config
cp config.example.json config.json
cp .env.example .env
# Edit configuration files with your settings
Development Tools
Code Quality Tools
# Install pre-commit hooks
pre-commit install
# Run linters
flake8 .
black .
isort .
# Run type checking
mypy .
Testing
# Run all tests
pytest
# Run specific test file
pytest tests/test_twitter_handler.py
# Run with coverage
pytest --cov=flavumhive tests/
Documentation
# Install documentation dependencies
cd docs
npm install
# Run documentation locally
npm start
IDE Setup
VS Code
- Install Python extension
- Configure settings.json:
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true
}
PyCharm
- Set project interpreter
- Enable code style tools
- Configure test runner
Docker Development
Build Image
docker build -t flavumhive-dev -f Dockerfile.dev .
Run Container
docker run -it --rm \
-v $(pwd):/app \
-p 3000:3000 \
flavumhive-dev
Common Issues
Selenium Setup
- Install Chrome/Chromium
- Install ChromeDriver
- Add to PATH
- Test installation
Database Setup
- Initialize database
- Run migrations
- Verify connections
Environment Issues
- Check Python version
- Verify dependencies
- Check PATH variables