A comprehensive social media platform with e-commerce capabilities, content monetization, and delivery services.
- Multi-Platform Posts: Facebook-style posts, LinkedIn professional posts, Instagram stories, YouTube videos and shorts
- Connections: Follow, friend, and block system
- Engagement: Like, dislike, comment, share functionality
- Stories: 24-hour expiring content
- Hashtags: Trending topics and content discovery
- Company Profiles: Business accounts with enhanced features
- Job Postings: Recruitment and application system
- Professional Connections: LinkedIn-style networking
- Product Listings: Multi-category product catalog
- Shopping Cart: Full cart management system
- Order Management: Complete order lifecycle
- Real-time Delivery: Fast delivery for food items
- Product Reviews: Customer feedback system
- Creator Earnings: Revenue from views, likes, shares
- Ad Revenue: Advertising revenue sharing
- Post Boosting: Paid promotion system
- Premium Content: Subscription-based content
- Driver Network: Independent contractor drivers
- Vehicle Types: Bicycle, motorcycle, car, truck support
- Service Area: 20km radius from Kathmandu, Maitighar
- Real-time Tracking: GPS-based delivery tracking
- Rating System: Driver and delivery ratings
- Ad-free Experience: No ads for premium users
- Enhanced Analytics: Detailed insights
- Priority Support: Faster customer service
- Extended Monetization: Additional earning opportunities
- Automated Filtering: AI-powered content screening
- Manual Review: Human moderation team
- Community Reporting: User-driven content flagging
- Violation Tracking: Account violation management
social_media/
├── accounts/ # User authentication and profiles
├── posts/ # Social media posts and interactions
├── ecommerce/ # E-commerce functionality
├── delivery/ # Delivery and driver management
├── payments/ # Payment processing and subscriptions
├── moderation/ # Content moderation and reporting
└── social_media/ # Main Django settings
frontend/
├── src/
│ ├── components/ # Reusable UI components
│ ├── pages/ # Page components
│ ├── hooks/ # Custom React hooks
│ ├── services/ # API services
│ ├── store/ # State management (Zustand)
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── public/ # Static assets
└── package.json # Dependencies and scripts
- Framework: Django 4.2.7 + Django REST Framework 3.14.0
- Database: PostgreSQL
- Cache/Queue: Redis + Celery
- Payment: Stripe integration
- Authentication: JWT tokens
- File Storage: Django file handling
- API Documentation: DRF built-in
- Framework: React 18.2 + TypeScript
- Routing: React Router v6
- State Management: Zustand
- HTTP Client: Axios with interceptors
- Styling: Tailwind CSS + Headless UI
- Forms: React Hook Form + Yup validation
- Notifications: React Hot Toast
- Web Server: Gunicorn + Nginx
- Process Manager: Supervisor
- Monitoring: Built-in Django logging
- Security: CORS headers, CSRF protection
- Python 3.9+
- Node.js 16+
- PostgreSQL 12+
- Redis 6+
-
Clone the repository
cd /home/acer/social_media -
Create virtual environment
python -m venv venv source venv/bin/activate # On Windows: venv\\Scripts\\activate
-
Install dependencies
pip install -r requirements.txt
-
Environment configuration
cp .env.example .env # Edit .env with your configuration -
Database setup
python manage.py makemigrations python manage.py migrate python manage.py createsuperuser
-
Start development server
python manage.py runserver
-
Navigate to frontend directory
cd frontend -
Install dependencies
npm install
-
Start development server
npm start
Create a .env file in the root directory:
SECRET_KEY=your-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
DB_NAME=social_media_db
DB_USER=postgres
DB_PASSWORD=password
DB_HOST=localhost
DB_PORT=5432
REDIS_URL=redis://localhost:6379
STRIPE_PUBLISHABLE_KEY=pk_test_your_stripe_key
STRIPE_SECRET_KEY=sk_test_your_stripe_keyCreate a .env.local file in the frontend directory:
REACT_APP_API_URL=http://localhost:8000/apiPOST /api/auth/register/- User registrationPOST /api/auth/login/- User loginGET /api/auth/profile/- Get user profilePATCH /api/auth/profile/- Update user profile
GET /api/posts/- List postsPOST /api/posts/- Create postGET /api/posts/{id}/- Get post detailsPOST /api/posts/{id}/like/- Like/unlike postPOST /api/posts/{id}/share/- Share postGET /api/posts/{id}/comments/- Get post comments
GET /api/ecommerce/products/- List productsGET /api/ecommerce/products/{id}/- Product detailsPOST /api/ecommerce/cart/add/- Add to cartGET /api/ecommerce/cart/- Get cartPOST /api/ecommerce/orders/- Create order
GET /api/payments/plans/- List premium plansPOST /api/payments/subscribe/- Subscribe to premiumGET /api/payments/wallet/- Get wallet balancePOST /api/payments/wallet/add-funds/- Add funds to wallet
const createPost = async (postData: PostForm) => {
const formData = new FormData();
formData.append('title', postData.title);
formData.append('description', postData.description);
formData.append('post_type', postData.post_type);
const response = await postsApi.createPost(formData);
return response.data;
};const addToCart = async (productId: number, quantity: number) => {
const response = await shopApi.addToCart(productId, quantity);
return response.data;
};const subscribeToPremium = async (planId: number) => {
const response = await paymentsApi.subscribePremium(planId);
// Handle Stripe payment intent
return response.data;
};- Input Validation: Comprehensive form validation
- SQL Injection Protection: Django ORM protections
- XSS Prevention: Template auto-escaping
- CSRF Protection: Built-in Django middleware
- Authentication: JWT token-based auth
- Authorization: Role-based permissions
- Content Moderation: Automated and manual review
- Payment Security: Stripe PCI compliance
-
Environment Configuration
- Set
DEBUG=False - Configure proper
ALLOWED_HOSTS - Use production database
- Set up Redis for caching
- Set
-
Static Files
python manage.py collectstatic
-
Database Migration
python manage.py migrate
-
Process Management
- Use Gunicorn for Django
- Configure Nginx for reverse proxy
- Set up Supervisor for process management
-
Frontend Build
npm run build
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit changes (
git commit -m 'Add some AmazingFeature') - Push to branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is proprietary software. All rights reserved.
For support and questions:
- Email: [email protected]
- Documentation: [Link to docs]
- Issues: [GitHub Issues]
- ✅ User authentication and profiles
- ✅ Basic social media features
- ✅ E-commerce foundation
- ✅ Payment integration
- ✅ Content moderation
- 🔄 Real-time notifications
- 🔄 Advanced analytics
- 🔄 Mobile app development
- 🔄 AI-powered recommendations
- 📋 Video calling features
- 📋 Advanced delivery tracking
- 📋 Multi-language support
- 📋 Advanced creator tools
- Response Times: < 200ms for API calls
- Caching: Redis for session and query caching
- Database: Optimized queries with indexes
- CDN: Static asset delivery optimization
- Monitoring: Built-in performance tracking
python manage.py testcd frontend
npm testBuilt with ❤️ for the Nepal social media ecosystem