A privacy-focused, location-aware, federated social media platform designed for local community building with ActivityPub compatibility.
Glade is designed to be an ethical alternative to mainstream social media platforms, focusing on local communities without advertising or user tracking. It enables self-hosted instances that can federate with other ActivityPub-compatible platforms while maintaining strong privacy guarantees.
- Privacy-First Design: User-controlled location fuzzing, privacy levels, and data protection
- Local Community Focus: Location-based content discovery and "Groves" (geographic communities)
- Federation: ActivityPub-compatible for cross-instance communication
- Self-Hostable: Easy deployment for community organizations
- No Tracking: No advertising, analytics, or user surveillance
Glade uses a modern stack optimized for geospatial data and federation:
- Framework: Django with Django REST Framework
- Database: PostgreSQL with PostGIS extension for geospatial queries
- Cache: Redis for session management and rate limiting
- Task Queue: Celery for async federation and background tasks
- Federation: Custom ActivityPub implementation
- PostGIS: Geospatial database for location-based features
- ActivityPub: Federated protocol implementation
- HTTP Signatures: Request signing for federation security
- RSA Keypairs: User authentication for federation
backend/
├── accounts/ # User management and authentication
├── posts/ # Post creation and interactions
├── federation/ # ActivityPub federation logic
├── communities/ # Grove (community) management
├── privacy/ # Privacy controls and middleware
├── glade/ # Project settings and configuration
└── manage.py # Django management script
- Python 3.10+
- PostgreSQL 14+ with PostGIS extension
- Redis 6+
- Node.js 16+ (for future frontend)
- Clone the repository
git clone https://github.com/yourusername/glade.git
cd glade- Set up PostgreSQL with PostGIS
# Install PostGIS (Ubuntu/Debian)
sudo apt-get install postgresql-14-postgis-3
# Create database
sudo -u postgres psql
CREATE DATABASE glade;
CREATE USER glade WITH PASSWORD 'your_password';
ALTER DATABASE glade OWNER TO glade;
\c glade
CREATE EXTENSION postgis;
\q- Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies
cd backend
pip install -r requirements.txt- Configure environment
cp .env.example .env
# Edit .env with your settingsExample .env:
DATABASE_URL=postgresql://glade:your_password@localhost:5432/glade
REDIS_URL=redis://localhost:6379/0
SECRET_KEY=your-secret-key-here
DEBUG=True
INSTANCE_DOMAIN=localhost:8000
INSTANCE_NAME=My Glade Instance
FEDERATION_ENABLED=True
- Run migrations
python manage.py migrate- Create superuser
python manage.py createsuperuser- Start services
Terminal 1 - Django server:
python manage.py runserverTerminal 2 - Celery worker:
celery -A glade worker -l infoTerminal 3 - Redis (if not running as service):
redis-serverGlade implements three privacy levels for users:
- Public (1): Profile and content visible to everyone
- Local (2): Visible to local instance and nearby federated instances
- Private (3): Visible only to followers
Posts can have four visibility settings:
- Public: Visible to everyone, federates globally
- Local: Visible to local instance and nearby locations
- Followers: Only visible to followers
- Private: Only visible to author
- User locations are automatically fuzzed within a configurable radius (default ±100m)
- Users control their location privacy radius (1km default, max 50km)
- Approximate locations are used for local discovery without exposing exact coordinates
Groves are geographic communities within Glade representing:
- Neighborhoods
- Cities
- Local interest groups
- Regional communities
Multiple Groves can exist within one Glade instance (representing a state or larger region).
POST /api/auth/register/
POST /api/auth/login/
GET /api/auth/profile/me/
GET /api/posts/ # List posts (filtered by privacy)
POST /api/posts/ # Create post
GET /api/posts/local/ # Get nearby posts
POST /api/posts/{id}/like/ # Like post
DELETE /api/posts/{id}/like/ # Unlike post
GET /api/profile/{username}/
PUT /api/profile/me/
POST /api/follow/{username}/
DELETE /api/follow/{username}/
GET /.well-known/webfinger # WebFinger discovery
GET /.well-known/nodeinfo # NodeInfo discovery
GET /users/{username} # Actor endpoint
POST /users/{username}/inbox # User inbox
POST /inbox # Shared inbox
Key settings in glade/settings/base.py:
# Instance configuration
INSTANCE_DOMAIN = "your-domain.com"
INSTANCE_NAME = "Your Instance Name"
INSTANCE_DESCRIPTION = "A privacy-focused local community"
# Privacy settings
DEFAULT_LOCATION_RADIUS = 1000 # meters
MAX_LOCATION_RADIUS = 50000 # meters
LOCATION_FUZZING_RADIUS = 100 # meters
# Federation
FEDERATION_ENABLED = TrueRequired environment variables:
DATABASE_URL: PostgreSQL connection stringREDIS_URL: Redis connection stringSECRET_KEY: Django secret keyINSTANCE_DOMAIN: Your instance domainFEDERATION_ENABLED: Enable/disable federation
Glade implements ActivityPub for federation with other platforms like Mastodon, Pleroma, and other Glade instances.
- Follow/Accept/Reject: User following
- Create/Update/Delete: Post management
- Like/Undo: Post interactions
- Announce: Sharing/boosting
- User creates post
- If not local-only, post is serialized to ActivityPub Note
- Celery task federates to relevant inboxes (followers, nearby instances)
- Remote servers receive and process activity
- Incoming activities are verified via HTTP signatures
- All federated requests are signed using RSA keypairs
- HTTP Signatures verify sender authenticity
- Instance trust levels control federation behavior
python manage.py testFollow PEP 8 guidelines. Use Black for formatting:
pip install black
black .Create migrations after model changes:
python manage.py makemigrations
python manage.py migrateUse glade/settings/production.py for production:
export DJANGO_SETTINGS_MODULE=glade.settings.productionKey production configurations:
- Set
DEBUG=False - Configure
ALLOWED_HOSTS - Use strong
SECRET_KEY - Enable HTTPS with proper SSL certificates
- Configure email backend
- Set up static file serving
- Configure Celery with production broker
- Web Server: Nginx
- WSGI Server: Gunicorn
- Database: PostgreSQL 14+ with PostGIS
- Cache: Redis
- Task Queue: Celery with Redis broker
- Process Manager: Systemd or Supervisor
Logs are written to:
- Django logs: Standard Django logging
- Celery logs: Task execution logs
- Federation logs: ActivityPub activity logs
- Always use HTTPS in production
- Keep dependencies updated
- Regular security audits
- Monitor failed authentication attempts
- Implement rate limiting
- Regular database backups
- Location data is always fuzzed
- Users control their privacy levels
- No analytics or tracking
- Data minimization principles
- Right to be forgotten (account deletion)
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests for new features
- Ensure all tests pass
- Submit a pull request
- Core user and post functionality
- Basic federation support
- Privacy controls
- Grove (community) implementation
- User proposals and community governance
- Enhanced moderation tools
- Account migration/transfer
- Improved discovery features
- Cryptocurrency features
- AI/generative content
- Gamification
- Native mobile apps (responsive web design only)
- Video/audio content
- Marketplace/e-commerce
Glade is licensed under GPL-2.0
For all support, it is suggested to open github issues.
Built with privacy-first principles for local communities. Inspired by the fediverse and ethical social media movements.
Note: Glade is currently in active development. Some features may not be fully implemented. Contributions and feedback are welcome!