{"id":23647647,"url":"https://github.com/hassonor/microservices-jobber","last_synced_at":"2026-04-11T01:05:38.248Z","repository":{"id":269051817,"uuid":"906274800","full_name":"hassonor/microservices-jobber","owner":"hassonor","description":"microservices-jobber using: Node, TS, ES, Kibana,Postgresql,mysql,MongoDB, Cloudinary, RabbitMQ","archived":false,"fork":false,"pushed_at":"2024-12-24T17:13:19.000Z","size":321,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-19T21:09:38.619Z","etag":null,"topics":["cloudinary","elasticsearch","hearbeat","kibana","microservices","mongodb","nodejs","postgresql","rabbitmq","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hassonor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-20T14:34:41.000Z","updated_at":"2025-01-24T06:34:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"88bc4ee6-ce82-45fc-8f79-6f60f8e99fe8","html_url":"https://github.com/hassonor/microservices-jobber","commit_stats":null,"previous_names":["hassonor/microservices-jobber"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hassonor/microservices-jobber","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fmicroservices-jobber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fmicroservices-jobber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fmicroservices-jobber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fmicroservices-jobber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hassonor","download_url":"https://codeload.github.com/hassonor/microservices-jobber/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hassonor%2Fmicroservices-jobber/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272659283,"owners_count":24971607,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-29T02:00:10.610Z","response_time":87,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudinary","elasticsearch","hearbeat","kibana","microservices","mongodb","nodejs","postgresql","rabbitmq","typescript"],"created_at":"2024-12-28T14:38:39.726Z","updated_at":"2026-04-11T01:05:38.239Z","avatar_url":"https://github.com/hassonor.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🚀 Microservices Jobber Platform\n\n\u003cdiv align=\"center\"\u003e\n\n![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)\n![Node.js](https://img.shields.io/badge/node-%3E%3D20.x-brightgreen)\n![TypeScript](https://img.shields.io/badge/typescript-%5E5.0.0-blue)\n![Build](https://img.shields.io/badge/build-passing-success)\n\n**A production-ready freelance marketplace built with microservices architecture**\n\n[Features](#-features) • [Quick Start](#-quick-start) • [Architecture](#-architecture) • [Documentation](#-documentation) • [Contributing](#-contributing)\n\n\u003c/div\u003e\n\n---\n\n## 📋 Table of Contents\n\n- [Overview](#-overview)\n- [Features](#-features)\n- [Tech Stack](#-tech-stack)\n- [Architecture](#-architecture)\n- [Quick Start](#-quick-start)\n- [Project Structure](#-project-structure)\n- [Services](#-services)\n- [Development](#-development)\n- [Testing](#-testing)\n- [Deployment](#-deployment)\n- [CI/CD](#-cicd)\n- [Contributing](#-contributing)\n- [License](#-license)\n\n---\n\n## 🌟 Overview\n\n**Microservices Jobber** is a full-featured freelance marketplace platform demonstrating **production-grade microservices architecture**. Built with TypeScript, Node.js, and modern cloud-native technologies, this project serves as both a learning resource and a foundation for building scalable SaaS applications.\n\n### Why This Project?\n\n- ✅ **Production-Ready**: Real-world patterns, error handling, monitoring\n- ✅ **Event-Driven**: RabbitMQ message queuing between services\n- ✅ **Cloud-Native**: Docker, Kubernetes, horizontal scaling\n- ✅ **Full Observability**: Elasticsearch, Kibana, Heartbeat monitoring\n- ✅ **Educational**: Clear code, comprehensive documentation, best practices\n\n---\n\n## ✨ Features\n\n### Core Functionality\n- 🔐 **Authentication \u0026 Authorization**: JWT tokens, refresh tokens, 2FA support\n- 👥 **User Management**: Profiles, roles, permissions, email verification\n- 💼 **Gig Management**: Create, browse, search, filter freelance services\n- 💬 **Real-time Chat**: WebSocket-based messaging between users\n- 📦 **Order Management**: Complete order lifecycle with payment integration\n- ⭐ **Review System**: Ratings, reviews, reputation scores\n- 📧 **Notifications**: Email, in-app, push notifications\n- 🔍 **Full-text Search**: Elasticsearch-powered gig and user search\n\n### Technical Features\n- 🎯 **API Gateway**: Centralized entry point with rate limiting\n- 🔄 **Event-Driven Communication**: Async messaging with RabbitMQ\n- 💾 **Polyglot Persistence**: MongoDB, MySQL, PostgreSQL, Redis\n- 📊 **Monitoring**: Elasticsearch, Kibana, Heartbeat, APM\n- 🚀 **Horizontal Scaling**: Stateless services, Redis sessions\n- 🐳 **Containerized**: Docker Compose for local, Kubernetes for production\n\n---\n\n## 🛠 Tech Stack\n\n### Backend Services (8 Microservices)\n| Service | Technology | Database | Description |\n|---------|-----------|----------|-------------|\n| **Gateway** | Express.js, TypeScript | Redis | API Gateway with rate limiting |\n| **Notification** | Express.js, TypeScript | MongoDB | Email and push notifications |\n| **Auth** | Express.js, TypeScript | PostgreSQL | Authentication \u0026 authorization |\n| **Users** | Express.js, TypeScript | MongoDB | User profiles and management |\n| **Gig** | Express.js, TypeScript | MongoDB | Freelance service listings |\n| **Chat** | Express.js, TypeScript | MongoDB | Real-time messaging |\n| **Order** | Express.js, TypeScript | MySQL | Order processing \u0026 payments |\n| **Review** | Express.js, TypeScript | PostgreSQL | Ratings and reviews |\n\n### Infrastructure\n- **Message Queue**: RabbitMQ\n- **Cache**: Redis 7\n- **Search**: Elasticsearch 8\n- **Monitoring**: Kibana, Heartbeat\n- **Containerization**: Docker, Docker Compose\n- **Orchestration**: Kubernetes (production)\n\n### Shared Libraries\n- **@ohjobber/shared**: Common utilities, types, middlewares\n\n---\n\n## 🏗 Architecture\n\n### High-Level Architecture Diagram\n\n```\n┌─────────────────────────────────────────────────────────────────┐\n│                         Client Layer                             │\n│              (Web App, Mobile App, Third-party)                  │\n└────────────────────────┬────────────────────────────────────────┘\n                         │ HTTPS\n                         ▼\n┌─────────────────────────────────────────────────────────────────┐\n│                       API Gateway                                │\n│  ┌───────────┐  ┌──────────────┐  ┌────────────────────┐       │\n│  │Rate Limit │─▶│Authentication│─▶│Request Routing     │       │\n│  └───────────┘  └──────────────┘  └────────────────────┘       │\n└─────────────────────────┬───────────────────────────────────────┘\n                          │\n          ┌───────────────┼───────────────┬──────────────┐\n          ▼               ▼               ▼              ▼\n    ┌─────────┐     ┌─────────┐    ┌─────────┐   ┌──────────┐\n    │  Auth   │     │  User   │    │   Gig   │   │   Chat   │\n    │ Service │     │ Service │    │ Service │   │  Service │\n    └────┬────┘     └────┬────┘    └────┬────┘   └────┬─────┘\n         │               │              │             │\n    ┌─────────┐     ┌─────────┐    ┌─────────┐   ┌──────────┐\n    │ Order   │     │ Review  │    │  Notif  │   │ Gateway  │\n    │ Service │     │ Service │    │ Service │   │   API    │\n    └────┬────┘     └────┬────┘    └────┬────┘   └──────────┘\n         │               │              │\n         └───────────────┴──────────────┘\n                         │\n              ┌──────────┴──────────┐\n              ▼                     ▼\n        ┌───────────┐        ┌────────────┐\n        │ RabbitMQ  │        │   Redis    │\n        │ (Events)  │        │  (Cache)   │\n        └───────────┘        └────────────┘\n              │\n              ▼\n   ┌─────────────────────────────┐\n   │  Data Layer (Polyglot)      │\n   ├─────────────┬───────────────┤\n   │  MongoDB    │ PostgreSQL    │\n   │  MySQL      │ Elasticsearch │\n   └─────────────┴───────────────┘\n```\n\n### Service Communication Patterns\n\n1. **Synchronous**: HTTP/REST for request-response operations\n2. **Asynchronous**: RabbitMQ events for fire-and-forget operations\n3. **Caching**: Redis for sessions, rate limiting, frequently accessed data\n4. **Search**: Elasticsearch for full-text search with denormalized data\n\n---\n\n## 🚀 Quick Start\n\nGet the entire platform running locally in **10 minutes**:\n\n### Prerequisites\n\n- **Node.js** \u003e= 20.x\n- **Docker** \u0026 **Docker Compose** \u003e= 20.x\n- **Git**\n\n### Installation\n\n```bash\n# 1. Clone the repository\ngit clone https://github.com/hassonor/microservices-jobber.git\ncd microservices-jobber\n\n# 2. Start infrastructure services (takes 5-10 min for Elasticsearch)\ncd volumes\ndocker-compose up -d redis mongodb mysql postgres rabbitmq elasticsearch\n\n# 3. Create Kibana service token\ndocker exec -it \u003celasticsearch-container-id\u003e bash\nbin/elasticsearch-service-tokens create elastic/kibana jobber-kibana\n# Copy the token and add to ELASTICSEARCH_SERVICEACCOUNT_TOKEN in docker-compose.yml\n\n# 4. Start Kibana\ndocker-compose up -d kibana\n\n# 5. Update heartbeat.yml with your IP address\n# Replace \u003cyour-ip-address\u003e in volumes/heartbeat.yml\n\n# 6. Install dependencies for all services\nnpm install --workspaces\n\n# 7. Start services (recommended order)\ncd ../2-notification-service \u0026\u0026 npm run dev \u0026\ncd ../3-auth-service \u0026\u0026 npm run dev \u0026\ncd ../4-users-service \u0026\u0026 npm run dev \u0026\ncd ../5-gig-service \u0026\u0026 npm run dev \u0026\ncd ../6-chat-service \u0026\u0026 npm run dev \u0026\ncd ../7-order-service \u0026\u0026 npm run dev \u0026\ncd ../8-review-service \u0026\u0026 npm run dev \u0026\ncd ../1-gateway-service \u0026\u0026 npm run dev  # Start gateway last\n```\n\n### Access Points\n\n| Service | URL | Description |\n|---------|-----|-------------|\n| **API Gateway** | http://localhost:4000 | Main entry point |\n| **Elasticsearch** | http://localhost:9200 | Search engine |\n| **Kibana** | http://localhost:5601 | Monitoring dashboard |\n| **RabbitMQ** | http://localhost:15672 | Message queue UI (guest/guest) |\n\n---\n\n## 📁 Project Structure\n\n```\nmicroservices-jobber/\n├── 1-gateway-service/         # API Gateway (port 4000)\n│   ├── src/\n│   │   ├── controllers/       # Route handlers\n│   │   ├── middleware/        # Auth, rate limiting, validation\n│   │   ├── routes/            # API routes\n│   │   └── server.ts          # Express app setup\n│   ├── package.json\n│   └── tsconfig.json\n│\n├── 2-notification-service/    # Email \u0026 push notifications\n│   ├── src/\n│   │   ├── queues/            # RabbitMQ consumers\n│   │   ├── templates/         # Email templates\n│   │   └── server.ts\n│   └── package.json\n│\n├── 3-auth-service/            # Authentication (port 4002)\n│   ├── src/\n│   │   ├── controllers/       # Login, signup, refresh\n│   │   ├── models/            # User model\n│   │   ├── services/          # JWT, bcrypt logic\n│   │   └── server.ts\n│   └── package.json\n│\n├── 4-users-service/           # User profiles (port 4003)\n├── 5-gig-service/             # Gig listings (port 4004)\n├── 6-chat-service/            # Messaging (port 4005)\n├── 7-order-service/           # Orders \u0026 payments (port 4006)\n├── 8-review-service/          # Ratings \u0026 reviews (port 4007)\n│\n├── volumes/                   # Docker infrastructure\n│   ├── docker-compose.yaml    # All infrastructure services\n│   └── heartbeat.yml          # Elasticsearch monitoring\n│\n├── .cursorrules              # AI coding assistant configuration\n├── .github/\n│   ├── dependabot.yml        # Automated dependency updates\n│   └── workflows/            # CI/CD pipelines\n└── README.md\n```\n\n---\n\n## 🔧 Services\n\n### 1. Gateway Service (Port 4000)\n**Entry point for all client requests**\n\n- Rate limiting (100 req/15min per IP)\n- Authentication middleware\n- Request validation\n- Service routing\n- CORS configuration\n\n**Key Endpoints**:\n```\nPOST   /api/v1/auth/signup\nPOST   /api/v1/auth/login\nGET    /api/v1/gigs/search\nPOST   /api/v1/orders\n```\n\n### 2. Notification Service\n**Async email and push notifications**\n\n- Email templates (signup, order confirmation, etc.)\n- SendGrid/Mailgun integration\n- RabbitMQ consumer for notification events\n- Notification history tracking\n\n### 3. Auth Service (Port 4002)\n**JWT-based authentication**\n\n- User registration with email verification\n- Login with refresh token rotation\n- Password reset flow\n- 2FA support (optional)\n\n### 4. Users Service (Port 4003)\n**User profile management**\n\n- Profile CRUD operations\n- Seller/buyer profiles\n- Avatar upload (Cloudinary)\n- Activity history\n\n### 5. Gig Service (Port 4004)\n**Freelance service listings**\n\n- Create/update/delete gigs\n- Full-text search (Elasticsearch)\n- Category filtering\n- Image uploads (Cloudinary)\n\n### 6. Chat Service (Port 4005)\n**Real-time messaging**\n\n- WebSocket connections\n- Message persistence (MongoDB)\n- Conversation history\n- Typing indicators\n\n### 7. Order Service (Port 4006)\n**Order processing \u0026 payments**\n\n- Order lifecycle management\n- Stripe/PayPal integration\n- Order status updates via events\n- Refund handling\n\n### 8. Review Service (Port 4007)\n**Ratings and reviews**\n\n- Create/update reviews\n- Seller rating calculation\n- Review moderation\n- Aggregate statistics\n\n---\n\n## 💻 Development\n\n### Environment Setup\n\nEach service requires a `.env` file:\n\n```bash\n# Example for auth-service/.env\nNODE_ENV=development\nPORT=4002\nDATABASE_URL=postgresql://user:pass@localhost:5432/jobber_auth\nJWT_SECRET=your-secret-key-change-in-production\nJWT_EXPIRES_IN=1h\nREFRESH_TOKEN_SECRET=your-refresh-secret\nRABBITMQ_URL=amqp://localhost:5672\nREDIS_URL=redis://localhost:6379\n```\n\n### Running Individual Services\n\n```bash\n# Development mode with hot reload\ncd 3-auth-service\nnpm run dev\n\n# Production mode\nnpm run build\nnpm start\n\n# Lint \u0026 format\nnpm run lint\nnpm run lint:fix\n```\n\n### Code Quality\n\nThis project follows strict TypeScript and ESLint rules:\n\n```bash\n# Run linting\nnpm run lint\n\n# Fix auto-fixable issues\nnpm run lint:fix\n\n# Type checking\nnpm run type-check\n```\n\n### Shared Package\n\nCommon utilities are in `@ohjobber/shared`:\n\n```typescript\nimport { BadRequestError, NotFoundError } from '@ohjobber/shared';\nimport { CustomResponse, IAuthPayload } from '@ohjobber/shared';\n```\n\n---\n\n## 🧪 Testing\n\n### Unit Tests\n\n```bash\n# Run tests for a service\ncd 3-auth-service\nnpm test\n\n# Watch mode\nnpm run test:watch\n\n# Coverage report\nnpm run test:coverage\n```\n\n### Integration Tests\n\n```bash\n# Run integration tests (requires Docker)\nnpm run test:integration\n```\n\n### E2E Tests\n\n```bash\n# Start all services first\nnpm run dev:all\n\n# Run E2E tests\nnpm run test:e2e\n```\n\n---\n\n## 🚢 Deployment\n\n### Docker Compose (Development)\n\n```bash\n# Start all services\ndocker-compose up -d\n\n# View logs\ndocker-compose logs -f gateway\n\n# Stop all services\ndocker-compose down\n```\n\n### Kubernetes (Production)\n\n```bash\n# Apply Kubernetes manifests\nkubectl apply -f k8s/\n\n# Check deployment status\nkubectl get pods\nkubectl get services\n\n# Scale a service\nkubectl scale deployment gig-service --replicas=3\n```\n\n### Environment Variables (Production)\n\nRequired secrets for production:\n\n```bash\nJWT_SECRET=\u003cstrong-random-secret\u003e\nREFRESH_TOKEN_SECRET=\u003cstrong-random-secret\u003e\nDATABASE_URL=\u003cproduction-db-url\u003e\nREDIS_URL=\u003cproduction-redis-url\u003e\nRABBITMQ_URL=\u003cproduction-rabbitmq-url\u003e\nCLOUDINARY_API_KEY=\u003cyour-key\u003e\nCLOUDINARY_API_SECRET=\u003cyour-secret\u003e\nSTRIPE_SECRET_KEY=\u003cyour-key\u003e\nSENDGRID_API_KEY=\u003cyour-key\u003e\n```\n\n---\n\n## 🔄 CI/CD\n\n### GitHub Actions\n\nAutomated workflows for:\n\n- **Linting**: ESLint on every push\n- **Testing**: Unit + integration tests\n- **Security**: Dependabot for vulnerabilities\n- **Build**: Docker image builds\n- **Deploy**: Automatic deployment to staging on PR merge\n\n### Jenkins (Alternative)\n\nJenkins pipeline configuration included in `Jenkinsfile`:\n\n```groovy\npipeline {\n  stages {\n    stage('Test') { ... }\n    stage('Build') { ... }\n    stage('Deploy') { ... }\n  }\n}\n```\n\n---\n\n## 🤝 Contributing\n\nWe welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.\n\n### Quick Contribution Guide\n\n1. **Fork** the repository\n2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)\n3. **Commit** your changes following [Conventional Commits](https://www.conventionalcommits.org/)\n4. **Push** to the branch (`git push origin feature/amazing-feature`)\n5. **Open** a Pull Request\n\n### Code Standards\n\n- Follow the existing `.cursorrules` configuration\n- Write unit tests for new features\n- Update documentation as needed\n- Ensure all tests pass before submitting PR\n\n---\n\n## 📄 License\n\nThis project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.\n\n---\n\n## 🙏 Acknowledgments\n\n- Inspired by production freelance platforms like Upwork and Fiverr\n- Built for educational purposes to demonstrate microservices architecture\n- Special thanks to the open-source community for the amazing tools\n\n---\n\n## 📞 Support\n\n- **Issues**: [GitHub Issues](https://github.com/hassonor/microservices-jobber/issues)\n- **Discussions**: [GitHub Discussions](https://github.com/hassonor/microservices-jobber/discussions)\n\n---\n\n\u003cdiv align=\"center\"\u003e\n\n**Made with ❤️ by [Or Hasson](https://github.com/hassonor)**\n\n⭐ Star this repo if you find it helpful!\n\n\u003c/div\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassonor%2Fmicroservices-jobber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhassonor%2Fmicroservices-jobber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhassonor%2Fmicroservices-jobber/lists"}