Infomundi is a Flask-based news aggregation and social platform that collects stories from RSS feeds worldwide, processes them with AI-powered summarization, and provides a social layer for users to engage with global news. The platform organizes content by geographic regions and categories, making it easy to discover news from any part of the world.
- π° Global News Aggregation: Automatically fetches and processes news from RSS feeds across multiple countries and categories
- π€ AI-Powered Summaries: OpenAI integration for intelligent story summarization
- π Geographic Organization: Browse news by region, country, and category
- π₯ Social Features: User profiles, friendships, comments, reactions, and notifications
- π¬ Real-Time Chat: WebSocket-powered chat system for live discussions
- π Security-First: AES-GCM email encryption, Argon2id password hashing, CSRF protection, rate limiting
- π 2FA Support: Both TOTP (authenticator apps) and email-based two-factor authentication
- π Analytics: Site statistics, story views, trending content
- π¨ Customizable Profiles: Avatars, banners, wallpapers, and profile descriptions
- π Keyword Extraction: YAKE algorithm for automatic story tagging
- βοΈ Cloud Storage: Cloudflare R2 integration with local development fallback
- π Performance: Redis caching, optimized database queries, AVIF image format
- Framework: Flask 3.1 with Blueprints architecture
- Database: MySQL 8.0 with SQLAlchemy ORM
- Cache: Redis 7
- Real-time: Flask-SocketIO with eventlet workers
- AI: OpenAI API for summarization
- Security: Flask-WTF (CSRF), Flask-Limiter (rate limiting), Cloudflare Turnstile
- Templates: Jinja2
- Styles: Bootstrap 5, custom CSS
- Assets: Flask-Assets with minification
- Icons: Font Awesome
- Maps: Interactive region visualization
- Deployment: Docker Compose, Gunicorn
- Storage: Cloudflare R2 (S3-compatible)
- Email: SMTP with MailHog for local development
- Monitoring: Webhook alerts for errors
Get Infomundi running locally in 5 minutes!
- Docker and Docker Compose
- Git
- 4GB RAM available for Docker
# Clone the repository
git clone https://github.com/Infomundi-Project/website.git
cd website
# Initialize submodules (contains geographic data)
git submodule update --init --recursive
# Create environment file
cp .env.example .env
# Generate secure keys (Linux/macOS)
sed -i "s/your-secret-key-here.*/$(openssl rand -hex 32)/" .env
sed -i "s/your-encryption-key-here.*/$(openssl rand -hex 32)/" .env
sed -i "s/your-hmac-key-here.*/$(openssl rand -hex 32)/" .env
# Start all services
docker compose up -d
# Wait ~30 seconds for MySQL to initialize
# Seed database with publishers and categories
docker compose exec infomundi-app python -m utils.extra.insert_feeds_to_database
# Fetch news stories
docker compose exec infomundi-app python -m utils.search_news
# Download story images
docker compose exec infomundi-app python -m utils.search_news_images
# Generate statistics
docker compose exec infomundi-app python -m utils.extra.get_statistics- Website: http://localhost:5000
- Email Testing: http://localhost:8025 (MailHog)
For detailed setup instructions, see QUICKSTART.md.
website/
βββ app.py # Flask application initialization
βββ views.py # Main routes (homepage, news, profiles)
βββ auth.py # Authentication routes
βββ api.py # RESTful API endpoints
βββ wsgi.py # WSGI entry point
β
βββ website_scripts/ # Core business logic
β βββ models.py # SQLAlchemy models
β βββ config.py # Environment configuration
β βββ extensions.py # Flask extensions
β βββ security_util.py # Encryption & security
β βββ auth_util.py # Authentication flows
β βββ input_sanitization.py # Input validation
β βββ ... # Other utilities
β
βββ utils/ # Background job scripts
β βββ search_news.py # RSS feed fetcher
β βββ search_news_images.py # Image downloader
β βββ extra/ # Data seeding & maintenance
β
βββ templates/ # Jinja2 HTML templates
βββ static/ # CSS, JS, fonts, images
βββ sql/ # Database schema
βββ assets/ # Git submodule with seed data
βββ tests/ # Test suite
# View application logs
docker compose logs -f infomundi-app
# Run tests
docker compose exec infomundi-app pytest tests/
# Access Python shell
docker compose exec infomundi-app python
# Access MySQL
docker compose exec infomundi-mysql mysql -u infomundi -p
# Access Redis CLI
docker compose exec infomundi-redis redis-cli -a dev_redis_pass
# Restart app after code changes
docker compose up -d --force-recreate --no-deps infomundi-app
# Stop all services
docker compose stop
# Clean restart (removes all data)
docker compose down -vIn production, these should run periodically (e.g., via cron):
# Fetch latest news
docker compose exec infomundi-app python -m utils.search_news
# Download images for new stories
docker compose exec infomundi-app python -m utils.search_news_images
# Update site statistics
docker compose exec infomundi-app python -m utils.extra.get_statistics
# Fetch publisher favicons
docker compose exec infomundi-app python -m utils.extra.fetch_faviconsKey configuration in .env:
| Variable | Description | Required |
|---|---|---|
SECRET_KEY |
Flask session encryption | Yes |
ENCRYPTION_KEY |
AES-GCM encryption key | Yes |
HMAC_KEY |
Email fingerprint HMAC key | Yes |
BASE_URL |
Site URL (no trailing slash) | Yes |
MYSQL_* |
Database credentials | Yes |
REDIS_PASSWORD |
Redis password | Yes |
OPENAI_API_KEY |
OpenAI API key for summaries | No |
R2_* |
Cloudflare R2 storage credentials | No |
TURNSTILE_* |
Cloudflare Turnstile CAPTCHA keys | No |
GOOGLE_CLIENT_* |
Google OAuth credentials | No |
See .env.example for all options.
The application uses a relational schema with the following key tables:
- users: User accounts with encrypted emails and Argon2id password hashing
- stories: News articles with AI summaries and keyword tags
- publishers: RSS feed sources organized by category
- categories: Story classification by country and topic
- comments: Threaded discussion system
- friendships: Social connections between users
- notifications: User activity alerts
- story_reactions / comment_reactions: Like/dislike tracking
Geographic reference data (regions, countries, states, cities) is loaded from the assets/ submodule.
Infomundi implements defense-in-depth security:
- Email Privacy: Emails encrypted with AES-GCM, searchable via HMAC fingerprints
- Password Security: Argon2id hashing with high cost parameters
- CSRF Protection: Flask-WTF tokens on all forms
- Rate Limiting: Flask-Limiter on authentication and API endpoints
- Input Validation: Comprehensive sanitization with bleach
- Session Management: Secure cookies with version invalidation
- 2FA Options: TOTP (RFC 6238) and email-based verification
- CAPTCHA: Cloudflare Turnstile with custom fallback
# Run all tests
docker compose exec infomundi-app pytest tests/
# Run specific test file
docker compose exec infomundi-app pytest tests/sanitization_test.py
# Run with verbose output
docker compose exec infomundi-app pytest -v tests/
# Run with coverage
docker compose exec infomundi-app pytest --cov=website_scripts tests/We welcome contributions! Here's how to get started:
- Fork the repository
- Create a feature branch:
git checkout -b feature/amazing-feature - Make your changes: Follow the existing code style
- Test thoroughly: Ensure tests pass
- Commit your changes: Use clear commit messages
- Push to your fork:
git push origin feature/amazing-feature - Open a Pull Request: Describe your changes
- Follow PEP 8 for Python code style
- Use meaningful variable and function names
- Add docstrings to functions and classes
- Validate all user input with
input_sanitizationmodule - Use Flask-Limiter on new endpoints
- Add tests for new features
- Update documentation as needed
For AI assistance during development, see CLAUDE.md for architectural guidance.
The included docker-compose.yml is for local development only. For production deployment:
- Set secure environment variables (strong random keys)
- Configure Cloudflare R2 for media storage
- Set up SMTP for email delivery
- Enable HTTPS (required for secure cookies)
- Set up cron jobs for background tasks
- Configure monitoring via webhook alerts
- Use a reverse proxy (nginx/Cloudflare) for rate limiting and DDoS protection
This project is licensed under the MIT License - see the LICENSE file for details.
- Flask: Micro web framework
- OpenAI: AI-powered summarization
- Cloudflare: CDN, storage, and CAPTCHA services
- YAKE: Keyword extraction algorithm
- All the open-source contributors who made this possible
- Documentation: QUICKSTART.md | CLAUDE.md
- Repository: github.com/Infomundi-Project/website
- Issues: Report a bug or request a feature
Made with β€οΈ by the Infomundi team
