Skip to main content

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

  1. Install Python extension
  2. Configure settings.json:
{
"python.linting.enabled": true,
"python.linting.flake8Enabled": true,
"python.formatting.provider": "black",
"editor.formatOnSave": true
}

PyCharm

  1. Set project interpreter
  2. Enable code style tools
  3. 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

  1. Install Chrome/Chromium
  2. Install ChromeDriver
  3. Add to PATH
  4. Test installation

Database Setup

  1. Initialize database
  2. Run migrations
  3. Verify connections

Environment Issues

  1. Check Python version
  2. Verify dependencies
  3. Check PATH variables

Next Steps