Production-grade social media platform built with microservices architecture. Real-time communication, AI automation, and modern UX.
Live Demo β’ Documentation β’ Report Bug β’ Request Feature
- Overview
- Architecture
- Tech Stack
- Project Structure
- Core Features
- Getting Started
- API Reference
- Development
- Deployment
- Contributing
- Roadmap
- License
HooksDream is a full-stack social media platform demonstrating production-grade software engineering practices. Built with a microservices architecture separating concerns across Node.js (core API), React (frontend), and Python (AI/automation) services.
Key Characteristics:
- Microservices architecture with clear service boundaries
- Real-time bidirectional communication via WebSockets
- JWT-based authentication with OTP verification
- Media processing pipeline with Cloudinary + Sharp
- AI-powered automation layer (Python/FastAPI)
- PWA-enabled with offline support
- Internationalization (i18n) ready
- Comprehensive error handling and rate limiting
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Client Layer β
β React 18 + TypeScript + Vite + Tailwind CSS + PWA β
βββββββββββββββββββββββββ¬ββββββββββββββββββββββββββββββββββββββ
β
βββββββββββββββββΌββββββββββββββββ
β β β
ββββββΌβββββ ββββββΌβββββ ββββββΌβββββ
β REST β β WebSocketβ β Push β
β API β β Socket β βNotify β
ββββββ¬βββββ ββββββ¬βββββ βββββββββββ
β β
ββββββΌβββββββββββββββΌβββββ
β API Gateway Layer β
β (Rate Limit + Auth) β
βββββββββββββ¬βββββββββββββ
β
βββββββββ΄ββββββββ
β β
ββββββΌβββββ ββββββΌβββββββββββ
β Node.js β β Python β
β Backend βββββΊβ Backend β
β Express β β FastAPI β
β + MongoDBβ β (AI/Bot) β
βββββββββββ βββββββββββββββββ
β
ββββββΌβββββββββ
β Cloudinary β
β (Media CDN) β
βββββββββββββββ
Design Principles:
- Separation of Concerns: Each service handles a specific domain
- Stateless Services: Horizontal scaling ready
- Event-Driven: Real-time updates via Socket.IO
- Async Processing: Background jobs for media and notifications
| Technology | Purpose | Version |
|---|---|---|
| React | UI Framework | 18.x |
| TypeScript | Type Safety | 5.8 |
| Vite | Build Tool | Latest |
| Tailwind CSS | Styling | Latest |
| shadcn/ui | Component Library | Latest |
| TanStack Query | Data Fetching & Cache | Latest |
| Zustand | State Management | Latest |
| Socket.IO Client | Real-time Communication | Latest |
| React Hook Form + Zod | Form Management & Validation | Latest |
| i18next | Internationalization | Latest |
| Framer Motion | Animations | Latest |
| Vite PWA Plugin | Progressive Web App | Latest |
| Technology | Purpose | Version |
|---|---|---|
| Express.js | Web Framework | 4.x |
| MongoDB + Mongoose | Database & ODM | Latest |
| Socket.IO | Real-time Communication | Latest |
| JWT (jsonwebtoken) | Authentication | Latest |
| Cloudinary + Multer + Sharp | Media Upload & Processing | Latest |
| Node-cron | Scheduled Tasks | Latest |
| Web Push | Push Notifications | Latest |
| Express Rate Limit | API Protection | Latest |
| Cheerio | Web Scraping | Latest |
| Technology | Purpose | Version |
|---|---|---|
| FastAPI | API Framework | Latest |
| AsyncIO | Async Task Scheduling | Latest |
| Unsplash API | Image Sourcing | - |
| Bot Service | Social Media Automation | - |
| Technology | Purpose |
|---|---|
| Docker | Containerization |
| MongoDB Atlas | Managed Database |
| Render | Backend Hosting |
| Vercel | Frontend Hosting |
| Cloudinary | Media CDN & Processing |
HooksDream/
βββ backend/ # Node.js API Service
β βββ server.js # Entry point, server initialization
β βββ routes/ # REST API routes
β β βββ auth.js # Authentication (register, login, OTP)
β β βββ users.js # User management
β β βββ posts.js # Post CRUD operations
β β βββ comments.js # Comment system
β β βββ follow.js # Follow/unfollow logic
β β βββ chat.js # Messaging endpoints
β β βββ notifications.js # Notification system
β β βββ search.js # Search functionality
β β βββ storyRoutes.js # Stories (ephemeral content)
β β βββ friendDiscovery.js # Friend recommendations
β β βββ botRoutes.js # Bot integration
β βββ controllers/ # Business logic layer
β βββ models/ # Mongoose schemas
β βββ middleware/ # Auth, validation, rate limiting
β βββ services/ # Background services
β βββ socket/ # Socket.IO handlers
β βββ utils/ # Helper functions
β
βββ frontend/ # React Application
β βββ src/
β β βββ pages/ # Route-level components
β β β βββ FeedPage.tsx
β β β βββ CreatePostPage.tsx
β β β βββ PostDetailPage.tsx
β β β βββ ProfilePage.tsx
β β β βββ EditProfilePage.tsx
β β β βββ StoriesPage.tsx
β β β βββ MessagesPage.tsx
β β β βββ NotificationsPage.tsx
β β β βββ SearchPage.tsx
β β β βββ FriendPageRQ.tsx
β β β βββ MobileFriendPage.tsx
β β β βββ TermsOfUse.tsx
β β βββ components/ # Reusable UI components
β β β βββ auth/ # Login, Register, OTP
β β β βββ chat/ # Chat interface
β β β βββ comment/ # Comments
β β β βββ createpost/ # Post creation
β β β βββ feed/ # Feed components
β β β βββ layout/ # Layout shell
β β β βββ modals/ # Modal dialogs
β β β βββ navigation/ # Navigation bar
β β β βββ notifications/ # Notification components
β β β βββ posts/ # Post components
β β β βββ profile/ # Profile components
β β β βββ search/ # Search components
β β β βββ story/ # Story components
β β β βββ ui/ # shadcn/ui primitives
β β βββ contexts/ # React Context providers
β β βββ hooks/ # Custom React hooks
β β βββ services/ # API service layer
β β βββ store/ # Zustand stores
β β βββ locales/ # i18n translations
β β βββ utils/ # Utility functions
β βββ package.json
β βββ vite.config.ts
β βββ tailwind.config.js
β βββ tsconfig.json
β
βββ pyBackend/ # Python AI/Automation Service
β βββ main.py # FastAPI application entry
β βββ config.py # Configuration management
β βββ requirements.txt # Python dependencies
β βββ Dockerfile # Container config
β βββ docker-compose.yml # Service orchestration
β βββ routers/
β β βββ bot_router.py # Bot API endpoints
β βββ services/
β β βββ unsplash_service.py # Unsplash API integration
β β βββ bot_service.py # Marcin bot automation
β βββ data/ # Data storage
β
βββ docs/ # Documentation
β βββ CONTRIBUTING.md
β βββ DEPLOYMENT.md
β βββ SECURITY.md
β
βββ Screenshots/ # UI screenshots
βββ docker-compose.yml # Multi-service orchestration
βββ LICENSE # MIT License
βββ README.md # This file
- Authentication & Authorization β JWT-based auth with OTP verification flow
- Posts β Full CRUD with likes, comments, and sharing
- Stories β Ephemeral content (24h TTL) with auto-archiving
- User Profiles β Editable profiles with avatar and cover images
- Social Graph β Follow system with friend request workflow
- Real-time Chat β Instant messaging via Socket.IO with typing indicators
- Notifications β Real-time alerts for engagement events
- Search β Full-text search across users and posts
- Discovery β Algorithmic friend suggestions
- Media Pipeline β Image/video upload with Cloudinary CDN + Sharp processing
- Push Notifications β Web Push API integration
- Internationalization β Multi-language support via i18next
- PWA β Installable with offline capabilities
- Responsive Design β Mobile-first, optimized for all viewports
- Rate Limiting β API protection against abuse
- Real-time Updates β Live feed updates via WebSockets
- Marcin Bot β Automated social interactions (likes, follows, comments)
- Unsplash Integration β Curated high-quality image sourcing
- Scheduled Tasks β Automated posting and interactions
- Keep-alive Service β Prevents cold starts on Render
- Node.js >= 20.x
- Python >= 3.9
- MongoDB (local or Atlas)
- Cloudinary account
- Unsplash API key (optional)
1. Clone the repository
git clone https://github.com/AbdolHamidDev/HooksDream.git
cd HooksDream2. Start with Docker (Recommended) π
# Start all services (MongoDB + Backend + Frontend)
docker compose up -d
# View logs
docker compose logs -f
# Access the app
# Frontend: http://localhost:5173
# Backend: http://localhost:5000
# MongoDB: mongodb://localhost:27017See DOCKER_DEV.md for detailed Docker setup and troubleshooting.
3. Or run locally with npm:
# Install all dependencies
npm run install:all
# Start both backend and frontend
npm run dev4. Or manual setup:
cd backend
npm install
# Configure environment
cp .env.example .env
# Edit .env with your MongoDB URI, JWT secret, and Cloudinary credentials
# Start development server
npm run devcd frontend
npm install
# Configure environment
cp .env.example .env
# Set VITE_API_URL and VITE_SOCKET_URL
# Start development server
npm run devcd pyBackend
python -m venv venv
# Activate virtual environment
# Windows:
venv\Scripts\activate
# macOS/Linux:
source venv/bin/activate
pip install -r requirements.txt
# Configure environment
cp .env.example .env
# Start server
python run.py
# or
uvicorn main:app --reload| Method | Endpoint | Description |
|---|---|---|
| POST | /api/auth/register |
User registration |
| POST | /api/auth/login |
User login |
| POST | /api/auth/verify-otp |
OTP verification |
| GET | /api/auth/me |
Get current user |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/users/:id |
Get user profile |
| PUT | /api/users/:id |
Update user profile |
| GET | /api/users/:id/posts |
Get user posts |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/posts |
Get feed |
| POST | /api/posts |
Create post |
| PUT | /api/posts/:id |
Update post |
| DELETE | /api/posts/:id |
Delete post |
| POST | /api/posts/:id/like |
Like/unlike post |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/comments/:postId |
Get comments |
| POST | /api/comments |
Add comment |
| DELETE | /api/comments/:id |
Delete comment |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/chat/conversations |
Get conversations |
| GET | /api/chat/messages/:userId |
Get messages |
| POST | /api/chat/send |
Send message |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/stories |
Get active stories |
| POST | /api/stories |
Create story |
| DELETE | /api/stories/:id |
Delete story |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/notifications |
Get notifications |
| PUT | /api/notifications/:id/read |
Mark as read |
| Method | Endpoint | Description |
|---|---|---|
| GET | /api/search/users |
Search users |
| GET | /api/search/posts |
Search posts |
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/bot/automate |
Run automation |
| GET | /api/bot/status |
Bot status |
| POST | /api/bot/schedule |
Schedule task |
joinβ Join chat roomsendMessageβ Send messagetypingβ Typing indicatormarkAsReadβ Mark messages as read
newMessageβ New message receiveduserTypingβ User typing statusnewNotificationβ New notificationonlineUsersβ Online users list
Backend:
npm start # Production server
npm run dev # Development with nodemon
npm test # Run test suiteFrontend:
npm run dev # Development server (Vite)
npm run build # Production build
npm run preview # Preview production build
npm run lint # ESLint checkPython Backend:
python run.py # Production server
uvicorn main:app --reload # Development with auto-reload| Variable | Description | Required |
|---|---|---|
MONGODB_URI |
MongoDB connection string | Yes |
JWT_SECRET |
JWT signing secret | Yes |
CLOUDINARY_URL |
Cloudinary configuration | Yes |
PORT |
Server port | No (default: 5000) |
NODE_ENV |
Environment | No |
| Variable | Description | Required |
|---|---|---|
VITE_API_URL |
Backend API URL | Yes |
VITE_SOCKET_URL |
Socket.IO server URL | Yes |
| Variable | Description | Required |
|---|---|---|
NODE_BACKEND_URL |
Node.js backend URL | Yes |
UNSPLASH_ACCESS_KEY |
Unsplash API key | No |
BOT_ENABLED |
Enable/disable bot | No |
ENVIRONMENT |
Environment | No |
- Node.js Backend: Deploy from
backend/directory - Python Backend: Deploy from
pyBackend/directory - Use provided
Dockerfileor Render Nixpacks
- Build command:
npm run build - Output directory:
dist - Configure environment variables for production API URLs
- Create cluster and update
MONGODB_URIin backend environment - Enable IP whitelist for production
Contributions are welcome. Please follow these guidelines:
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -m 'feat: add feature') - Push to the branch (
git push origin feature/your-feature) - Open a Pull Request
Guidelines:
- Follow existing code style and conventions
- Write clear, descriptive commit messages (Conventional Commits)
- Update documentation for new features
- Add tests for critical functionality
- Ensure all checks pass before submitting
See CONTRIBUTING.md for detailed guidelines.
- Core social media features (posts, comments, likes)
- Real-time chat and notifications
- Stories functionality with auto-archive
- Python backend for AI automation
- PWA support
- Docker containerization
- Dark mode
- Video calls (WebRTC)
- Group chat
- Post scheduling
- Advanced analytics dashboard
- Content moderation AI
- Mobile apps (React Native)
- GraphQL API layer
- Comprehensive test coverage
This project is licensed under the MIT License. See LICENSE for details.
If you find this project useful, please consider:
- β Starring the repository
- π΄ Forking and contributing
- π Reporting bugs via Issues
- π¬ Sharing with the community
Built with β€οΈ by AbdolHamidDev
GitHub β’ Live Demo β’ β Buy Me a Coffee