This is the backend for the Social Media Management System (SMMS), built with Django. It powers a full-stack platform for managing social media accounts, analytics, influencer collaborations, notifications, and integrations.
- User Authentication: Registration, login, email verification, token-based authentication.
- Social Media Management: Account and team management, influencer collaborations.
- Analytics & Reporting: Collect and analyze social media data, generate reports.
- Notifications & Integrations: Email, social integrations (Twitter/X, Slack, etc.).
- Posts Management: Posting, scheduling, and managing social media content.
- Rate Limiting: Efficient Redis-backed throttling for API requests.
- RESTful API: Secure endpoints for all core features.
- Python 3.13
- PostgreSQL
- Redis
Client (Web/Frontend)
│
▼
REST API (Django)
│
├── PostgreSQL (main DB)
├── Redis (cache, rate limits, Celery broker)
├── Supabase (file/media storage)
└── Celery (background tasks)
- Django: Main web framework (apps for auth, posts, analytics, integrations, etc.)
- Celery + Redis: For background/async tasks (notifications, analytics, reporting)
- Supabase: For storing media/files (custom Django storage backend)
- GitHub Actions: CI/CD for automated testing, linting, deployment
-
Create and activate a virtual environment
python -m venv venv source venv/bin/activate # On macOS/Linux venv\Scripts\activate # On Windows
-
Install dependencies
pip install -r requirements.txt
-
Configure environment variables
- Copy
.env.exampleto.envand fill in required values.
- Copy
-
Apply migrations
python manage.py makemigrations python manage.py migrate
-
Create a superuser
python manage.py createsuperuser
-
Run the development server
python manage.py runserver
- Start Celery worker:
celery -A social_media_manager worker --loglevel=info --pool=solo
- Start Celery beat:
celery -A social_media_manager beat --loglevel=info
- Register:
POST /api/auth/register/ - Login:
POST /api/auth/login/ - Verify Email:
GET /api/auth/verify-email/<token>/ - Resend Verification:
POST /api/auth/resend-verification/ - Social Media Integrations:
- Twitter OAuth:
/api/integrations/twitter/authorize/,/api/integrations/twitter/callback/
- Twitter OAuth:
- Rate Limiting:
- Dashboard:
/api/core/rate-limit/dashboard/ - Logs:
/api/core/rate-limit/logs/ - Stats:
/api/core/rate-limit/stats/ - Test:
/api/core/rate-limit/test/
- Dashboard:
- IP Management:
- Whitelist:
/api/core/ip/whitelist/ - Blacklist:
/api/core/ip/blacklist/
- Whitelist:
- Posts:
/api/integrations/twitter/my-posts/
See the Postman collection for examples.
- Formatting:
black . black --check .
- Import sorting:
isort . isort --check-only .
- Linting:
flake8 .
- Django test suite:
python manage.py test - With coverage:
coverage run --source='.' manage.py test coverage report coverage html
- With pytest:
pytest
- GitHub Actions for automated CI/CD:
- Runs tests, linting, security checks, and build verification on push.
- Docker builds and deployment to staging/production.
- Branch strategy:
main: Production-readydevelop: Integrationfeature/*: Feature branches
- Quality gates:
- All tests must pass
- Coverage minimum: 80%
- No security vulnerabilities (checked with safety/bandit)
- Code formatted and linted
- Deployable on Render or other cloud platforms
- Uses AWS RDS for production database
- Redis for cache/tasks (Render or external)
- See
DEPLOYMENT_GUIDE.mdfor step-by-step instructions
- All environment variables set
- Database migrations applied
- Static files served
- Health check endpoint operational
- Admin panel accessible
- API endpoints working
- Social integrations configured
- Email sending operational
- Redis/Celery tasks working
- Error tracking (Sentry) enabled
- Sentry for error tracking (optional)
- Render service metrics
- Health check alerts
- AWS RDS performance monitoring
See .env.example for required and optional variables.
MIT License