🚀 A modern, feature-rich social media platform built with Angular and Node.js
SocialHub is a comprehensive social media application that combines traditional social networking features with innovative fundraising capabilities and AI-powered interactions. Built with modern web technologies, it provides users with a seamless experience for connecting, sharing, and supporting meaningful causes.
- 🔐 Secure Authentication - JWT-based authentication system
- 💬 Real-time Messaging - Instant communication with Socket.io
- 📱 Responsive Design - Mobile-first approach
- 🤖 AI Integration - Smart features powered by Groq API
- 💰 Fundraising Platform - Support charitable causes
- 👥 Social Features - Posts, friends, notifications
Main dashboard with posts feed and navigation
Real-time messaging interface with conversation history
Fundraising campaigns with progress tracking
User profile management and customization
Mobile-responsive design for all devices
This project was generated using Angular CLI version 19.2.6.
Before you begin, ensure you have the following installed on your system:
- Node.js (v18.0.0 or higher) - Download here
- npm (v8.0.0 or higher) - Comes with Node.js
- Angular CLI (v19.0.0 or higher) - Install with
npm install -g @angular/cli - MongoDB (v5.0 or higher) - Download here
- Git - For version control
- VS Code - Recommended IDE with Angular extensions
- Postman - For API testing
- MongoDB Compass - GUI for MongoDB
- OS: Windows 10+, macOS 10.15+, or Linux Ubuntu 18.04+
- RAM: 4GB minimum, 8GB recommended
- Storage: 2GB free space
-
Install MongoDB Community Edition
# On macOS with Homebrew brew tap mongodb/brew brew install mongodb-community # On Windows # Download from https://www.mongodb.com/try/download/community # On Ubuntu sudo apt-get install -y mongodb
-
Start MongoDB Service
# On macOS brew services start mongodb/brew/mongodb-community # On Windows net start MongoDB # On Linux sudo systemctl start mongod
-
Create Database
mongosh use aley_social_media db.createCollection("users") db.createCollection("posts") db.createCollection("messages")
-
Set up Environment Variables
# Create .env file in root directory MONGODB_URI=mongodb://localhost:27017/aley_social_media JWT_SECRET=your-super-secret-jwt-key GROQ_API_KEY=your-groq-api-key NODE_ENV=development PORT=3000
To start a local development server, run:
ng serveOnce the server is running, open your browser and navigate to http://localhost:4200/. The application will automatically reload whenever you modify any of the source files.
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
ng generate component component-nameFor a complete list of available schematics (such as components, directives, or pipes), run:
ng generate --helpTo build the project run:
ng buildThis will compile your project and store the build artifacts in the dist/ directory. By default, the production build optimizes your application for performance and speed.
To execute unit tests with the Karma test runner, use the following command:
ng testFor end-to-end (e2e) testing, run:
ng e2eAngular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
Error: MongoNetworkError: failed to connect to server
Solution:
- Ensure MongoDB service is running
- Check if port 27017 is available
- Verify MONGODB_URI in .env file
ng: command not found
Solution:
npm install -g @angular/cli@latestError: listen EADDRINUSE: address already in use :::4200
Solution:
ng serve --port 4201
# or kill the process using the port
lsof -ti:4200 | xargs kill -9Module not found errors
Solution:
rm -rf node_modules package-lock.json
npm install401 Unauthorized errors
Solution:
- Clear browser localStorage
- Log in again to get fresh token
- Check the Issues page
- Contact the development team
- Review the documentation
- ✨ Enhanced AI integration with Groq API
- 🔧 Improved authentication system
- 🎨 Updated UI/UX design
- 🐛 Fixed messaging real-time updates
- 📱 Better mobile responsiveness
- 🚀 Major refactoring to Angular 19
- 💰 Added fundraising campaign features
- 🔒 Enhanced security measures
- 📊 Admin dashboard improvements
- 🌐 Socket.io integration for real-time features
- 👥 Friend system implementation
- 🔍 Advanced search functionality
- 📧 Email notification system
- 🖼️ Image upload capabilities
- 🎯 Performance optimizations
- 🎉 Initial release
- 👤 User authentication
- 📝 Basic posting system
- 💬 Simple messaging
- 📱 Responsive design
- Video Calls - Integrate video calling functionality
- Stories Feature - Instagram-like stories
- Live Streaming - Real-time broadcasting
- Advanced Analytics - User engagement metrics
- Multi-language Support - Internationalization
- Dark Mode - Theme customization
- Push Notifications - Mobile app notifications
- Mobile App - React Native implementation
- Blockchain Integration - Cryptocurrency donations
- AI Moderation - Automated content moderation
- Marketplace - Buy/sell features
- Events System - Create and manage events
- Advanced Search - Elasticsearch integration
- Global social platform for meaningful connections
- Leading fundraising platform for social causes
- AI-powered content discovery and recommendations
- Sustainable and ethical social media alternative
- Load Time: < 2 seconds (average)
- Bundle Size: < 500KB (gzipped)
- Lighthouse Score: 95+ (Performance)
- Core Web Vitals: All metrics in green
- Mobile Performance: 90+ score
- First Contentful Paint: < 1.5s
- Largest Contentful Paint: < 2.5s
- Cumulative Layout Shift: < 0.1
- First Input Delay: < 100ms
- Code Splitting: Lazy-loaded routes
- Tree Shaking: Remove unused code
- Image Optimization: WebP format with fallbacks
- Caching Strategy: Service worker implementation
- CDN Integration: Static asset delivery
- Real User Monitoring: Track actual user experience
- Error Tracking: Comprehensive error logging
- Performance Analytics: Regular performance audits
- Authentication: JWT-based secure authentication
- Authorization: Role-based access control (RBAC)
- Data Encryption: Encrypted data transmission (HTTPS)
- Password Security: bcrypt hashing with salt
- Input Validation: Comprehensive input sanitization
- CORS Protection: Configured cross-origin resource sharing
- Environment Variables: Sensitive data in .env files
- API Rate Limiting: Prevent abuse and DDoS attacks
- SQL Injection Prevention: Parameterized queries
- XSS Protection: Content Security Policy (CSP)
- CSRF Protection: Cross-site request forgery prevention
- GDPR Compliance: User data protection
- Data Minimization: Collect only necessary data
- Right to Deletion: Users can delete their data
- Data Portability: Export user data on request
- Consent Management: Clear privacy policies
- Vulnerability Disclosure: [email protected]
- Bug Bounty Program: Rewards for security findings
- Regular Audits: Quarterly security assessments
- Penetration Testing: Annual security testing
- Health Checks: Automated system health monitoring
- Uptime Monitoring: 99.9% uptime target
- Response Time Tracking: API response time metrics
- Error Rate Monitoring: Track and alert on errors
- Database Performance: MongoDB query optimization
- User Engagement: Track user interaction patterns
- Feature Usage: Monitor feature adoption rates
- Conversion Metrics: Registration and retention rates
- Geographic Distribution: User location analytics
- Device Analytics: Platform usage statistics
- Structured Logging: JSON-formatted logs
- Log Aggregation: Centralized log management
- Error Tracking: Automatic error reporting
- Debug Mode: Enhanced debugging in development
- Audit Logs: Track important user actions
- Live Dashboard: Real-time system metrics
- Alert System: Automated incident notifications
- Performance Alerts: Threshold-based alerting
- Capacity Planning: Resource usage forecasting
- Automated Backups: Daily MongoDB backups
- Backup Retention: 30-day backup retention policy
- Point-in-time Recovery: Restore to specific timestamps
- Cross-region Replication: Geographic backup distribution
- Recovery Time Objective (RTO): < 4 hours
- Recovery Point Objective (RPO): < 1 hour
- Failover Procedures: Automated failover systems
- Data Integrity Checks: Regular backup validation
# Manual database backup
mongodump --uri="mongodb://localhost:27017/aley_social_media" --out=./backup
# Restore from backup
mongorestore --uri="mongodb://localhost:27017/aley_social_media" ./backup/aley_social_media
# Automated backup script
./scripts/backup.sh- User Uploads: Regular backup of user-generated content
- Static Assets: Versioned asset management
- Configuration Files: Environment configuration backup
- Code Repository: Git-based version control
- Current Version: v2.1
- Versioning Scheme: Semantic versioning (SemVer)
- Backward Compatibility: 2 major versions supported
- Deprecation Policy: 6-month deprecation notice
GET /api/v2.1/posts- Enhanced posts with AI featuresPOST /api/v2.1/auth/login- Multi-factor authenticationGET /api/v2.1/fundraising/campaigns- Advanced campaign management
GET /api/v2.0/posts- Basic posts functionalityPOST /api/v2.0/auth/login- Standard authenticationGET /api/v2.0/messages- Real-time messaging
GET /api/v1.0/posts- Legacy posts (deprecated Dec 2024)POST /api/v1.0/auth/login- Basic auth (deprecated Dec 2024)
- v1.0 → v2.0: Update authentication endpoints
- v2.0 → v2.1: Add AI feature integration
- Breaking Changes: Documented in changelog
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ Database │
│ Angular 19 │◄──►│ Node.js │◄──►│ MongoDB │
│ TypeScript │ │ Express.js │ │ Collections │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Socket.io │ │ AI Service │ │ File Storage │
│ Real-time │◄──►│ Groq API │ │ Images/Media │
│ Communication │ │ Python │ │ Assets │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- User Request → Angular Frontend
- HTTP/WebSocket → Node.js Backend
- Authentication → JWT Middleware
- Business Logic → Service Layer
- Data Access → MongoDB Database
- Response → JSON/Socket Event
- Modular Design: Feature-based modules
- Lazy Loading: Route-based code splitting
- Shared Services: Singleton service pattern
- State Management: RxJS observables
- Reactive Forms: Template-driven and reactive forms
- Load Balancer: Nginx reverse proxy
- API Gateway: Centralized API management
- CDN: Static asset delivery
- WebSocket: Real-time communication
- Database Cluster: MongoDB replica set
For more information on using the Angular CLI, including detailed command references, visit the Angular CLI Overview and Command Reference page.
Copyright (c) 2024 SocialHub Team
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- Angular: MIT License
- Node.js: MIT License
- MongoDB: Server Side Public License (SSPL)
- Socket.io: MIT License
- Lead Developer: Nguyễn Thái Sơn (@Tson28)
- Frontend Developer: Winnie Pham (@phamthangph13)
- 📧 Email: [email protected]
- 🐛 Bug Reports: GitHub Issues
- 💡 Feature Requests: GitHub Discussions
- 📱 Social Media: @SocialHubDev
- 💬 Discord: Join our community
- 📚 Documentation: Wiki
- 🎓 Tutorials: YouTube Channel
- 💼 Partnerships: [email protected]
- 🏢 Enterprise: [email protected]
Q: What is SocialHub? A: SocialHub is a modern social media platform that combines traditional social networking with fundraising capabilities and AI-powered features.
Q: Is SocialHub free to use? A: Yes, SocialHub is open-source and free to use. You can deploy your own instance or contribute to the project.
Q: What technologies does SocialHub use? A: SocialHub uses Angular 19 for the frontend, Node.js with Express for the backend, MongoDB for data storage, and Socket.io for real-time features.
Q: How do I set up the development environment? A: Follow the installation guide in this README. Make sure you have Node.js, MongoDB, and Angular CLI installed.
Q: Can I customize the UI? A: Yes! The UI is built with modular components and SCSS. You can easily customize colors, layouts, and styling.
Q: How do I add new features? A: Follow the contributing guidelines. Create a feature branch, implement your feature, write tests, and submit a pull request.
Q: Is there API documentation? A: Yes, API documentation is available in the repository and will be expanded with detailed endpoint documentation.
Q: Can I deploy SocialHub to production? A: Yes, follow the deployment section for production build instructions. Make sure to configure environment variables properly.
Q: Does SocialHub support Docker? A: Yes, Docker support is included. Use the provided Docker commands for containerized deployment.
Q: How do I scale SocialHub? A: SocialHub is designed to be scalable. Use load balancers, database clustering, and CDN for high-traffic scenarios.
- 🙏 Angular Team - For the amazing framework
- 🎯 MongoDB Team - For the robust database solution
- ⚡ Socket.io Team - For real-time communication capabilities
- 🤖 Groq - For AI integration support
- 👨💻 Nguyễn Thái Sơn - Lead Developer & Project Architect
- 👩💻 Winnie Pham - Frontend Developer & UI/UX Designer
- 📚 Open Source Community - For countless libraries and tools
- 🌟 Social Media Platforms - For UX/UI inspiration
- 💡 Charity Organizations - For fundraising feature ideas
- Frontend: Angular, TypeScript, RxJS, Angular Material
- Backend: Node.js, Express.js, Socket.io, JWT
- Database: MongoDB, Mongoose
- AI: Groq API, Python
- Development: Angular CLI, npm, Git
- 🧪 Thanks to all beta testers who helped improve the platform
- 🐛 Bug reporters who made the platform more stable
- 💡 Feature requesters who shaped the roadmap
⭐ Star this repository if you find it helpful!
Made with ❤️ by the SocialHub Team