A Django implementation of an AT Protocol custom feed generator designed to aggregate and filter Saskatchewan-related content from the Bluesky social network.
- Python 3.8 or higher
- Docker (optional for containerized deployment)
- pip or pipenv for dependency management
This project uses both pipenv
and traditional requirements.txt
for flexibility in dependency management.
# Install pipenv if you haven't already
pip install pipenv
# Install dependencies
pipenv install
# Activate the virtual environment
pipenv shell
# Create a virtual environment
python -m venv venv
# Activate the virtual environment
# On Windows:
venv\Scripts\activate
# On Unix or MacOS:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
- Copy the example environment file:
cp example.env .env
- Update the
.env
file with your configuration:
# Required settings
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
BLUESKY_HANDLE=your-handle.bsky.social
BLUESKY_APP_PASSWORD=your-app-password
# Optional settings
DEBUG=True
SECRET_KEY=your-secret-key
# Apply database migrations
python manage.py migrate
# Run the development server
python manage.py runserver
# Start the feed ingestion process
python manage.py start_feed <service_uri> --algorithm=<algorithm_name>
# Examples:
# For Flatlanders feed:
python manage.py start_feed wss://bsky.social --algorithm=flatlanders
# For logging only:
python manage.py start_feed wss://bsky.social --algorithm=logger
# Start the content labelling service
python manage.py start_labeler
# Build the Docker image
docker build -t sask-atproto .
# Run the container
docker run -p 8000:8000 --env-file .env sask-atproto
# Run all tests
pytest
# Run specific test files
pytest tests/flatlanders/test_views.py
# Run with coverage report
pytest --cov=.
The project is organized into several key components:
firehose/
: Handles Bluesky firehose connection and data ingestionflatlanders/
: Core feed algorithm implementation and content filteringsk_atp_feed/
: Main Django project configuration- For complete structure, see docs/PROJECT_STRUCTURE.md
We welcome contributions! Here's how you can help:
- Fork the repository
- Create your feature branch:
git checkout -b feature/amazing-feature
-
Set up your development environment following the steps above
-
Make your changes and ensure:
- All tests pass (
pytest
) - Code follows PEP 8 style guide
- New features include appropriate tests
- Documentation is updated as needed
- All tests pass (
-
Commit your changes:
git commit -m 'Add amazing feature'
- Push to your branch:
git push origin feature/amazing-feature
- Open a Pull Request
- Follow PEP 8 guidelines
- Include docstrings for all functions and classes
- Write meaningful commit messages
- Add tests for new functionality
- Update documentation as needed
This project is licensed under the terms specified in the LICENSE file.
- Currently supports single-instance deployment only
- Rate limiting on the Bluesky API may affect feed updates
- Content labelling is optimized for English language posts
Made with ❤️ for the Saskatchewan Bluesky community