Architecture Technology Stack - onouyek/MailApe GitHub Wiki
Technology Stack
Comprehensive overview of languages, frameworks, and tools used in MailApe.
Backend Technologies
Web Framework
- Django 3.x: Primary web framework
- Model-View-Template (MVT) architecture
- Built-in admin interface
- ORM for database interactions
- Form handling and validation
Source: requirements.common.txt#L1
Database
-
PostgreSQL: Primary database
- ACID compliance
- Advanced indexing
- JSON support
- Robust for production use
-
Database Driver:
psycopg2-binary
- PostgreSQL adapter for Python
- Binary package for easy installation
Source: requirements.common.txt#L2 and common_settings.py#L82
Task Queue System
-
Celery: Distributed task queue
- Asynchronous task processing
- Background email sending
- Retry mechanisms for failed tasks
- Version: <5.0 for compatibility
-
Redis: Message broker
- In-memory data store
- High performance
- Pub/Sub capabilities
- Version: <2.11
-
django-celery-results: Result backend
- Stores task results in Django database
- Version: <2.0
Source: requirements.common.txt#L5-7
API Framework
- Django REST Framework: API development
- Serialization
- Authentication and permissions
- Rate limiting and throttling
- Browsable API interface
- Version: <3.11
Source: requirements.common.txt#L9 and common_settings.py#L125-132
Frontend Technologies
Template Engine
- Django Templates: Server-side rendering
- Template inheritance
- Built-in template tags and filters
- Context processors for global data
Source: common_settings.py#L60-74
UI Framework
-
Bootstrap 4: CSS framework (via Crispy Forms)
- Responsive design
- Pre-built components
- Grid system
-
Django Crispy Forms: Form rendering
- Bootstrap 4 integration
- Programmatic form layout
- Version: 1.9.1
Source: requirements.common.txt#L4 and common_settings.py#L117
Content Processing
- Django Markdownify: Markdown support
- Safe HTML rendering
- Markdown to HTML conversion
- Version: 0.3.0
Source: requirements.common.txt#L3
Development Tools
Testing
-
factory_boy: Test data generation
- Model factories for testing
- Fixtures and test data
- Version: <3.0
-
coverage: Code coverage analysis
- Test coverage reporting
- Available in development requirements
Source: requirements.common.txt#L8 and requirements.dev.txt#L3
Development Dependencies
- celery[redis]: Enhanced Celery with Redis support
- Additional Redis dependencies
- Development-specific features
Source: requirements.dev.txt#L2
Infrastructure Technologies
Cloud Platform
- Amazon Web Services (AWS): Primary cloud platform
- Scalable infrastructure
- Managed services
- Global availability
Database Hosting
- AWS RDS: Managed PostgreSQL
- Automated backups
- Multi-AZ deployment
- Instance class:
db.t2.micro
- Storage: 20GB allocated
Source: infrastructure.yaml#L42-52
Message Queue
- AWS SQS: Production message queue
- Queue name:
mailape-celery
- Managed service
- Scalable message handling
- Queue name:
Source: infrastructure.yaml#L53-56
Application Hosting
- AWS EC2: Application servers
- Virtual machines for Django application
- Auto-scaling capabilities
- Load balancing support
Web Server
- Apache HTTP Server: Web server
- Configuration provided
- mod_wsgi for Django
- Static file serving
Source: apache/mailape.apache.conf
Process Management
- systemd: Service management
- Celery worker services
- Automatic restart
- Logging integration
Source: ubuntu/celery.service
Deployment Tools
Infrastructure as Code
- AWS CloudFormation: Infrastructure provisioning
- Declarative templates
- Stack management
- Resource dependencies
Source: cloudformation/
Image Building
- Packer: Machine image creation
- Automated image building
- AWS AMI generation
- Consistent deployments
Source: packer/web_worker.json
Configuration Management
- Shell Scripts: System configuration
- Package installation
- Service setup
- Environment configuration
Source: scripts/
Security Technologies
Authentication
- Django Authentication: Built-in auth system
- User management
- Session handling
- Password validation
CSRF Protection
- Django CSRF: Cross-site request forgery protection
- Token-based protection
- Middleware integration
Rate Limiting
- DRF Throttling: API rate limiting
- User-based throttling (60/min)
- Anonymous throttling (30/min)
Source: common_settings.py#L127-131
Logging and Monitoring
Logging Framework
- Python Logging: Built-in logging
- Configurable log levels
- Multiple handlers
- Environment-based configuration
Source: common_settings.py#L134-152
Version Constraints
The project uses specific version constraints for stability:
- Major Version Pins: Django, Celery
- Minor Version Pins: Specific packages like django-markdownify
- Upper Bounds: Most packages have upper version limits
This approach ensures:
- Compatibility between packages
- Predictable behavior
- Security through controlled updates
Source: requirements.common.txt
Next Steps
- System Design - Overall architecture patterns
- Module Structure - Code organization
- Data Flow - How data moves through the system