{"id":30772817,"url":"https://github.com/hasnaintypes/shopra-monorepo","last_synced_at":"2026-04-07T21:31:50.744Z","repository":{"id":312592803,"uuid":"1048022878","full_name":"hasnaintypes/shopra-monorepo","owner":"hasnaintypes","description":"Shopra Monorepo – A scalable multi-tenant e-commerce SaaS marketplace with modular Next.js frontends and NestJS microservices. Supports sellers, customers, and admins with real-time features, personalized recommendations, and a modern, event-driven architecture.","archived":false,"fork":false,"pushed_at":"2025-09-19T10:06:31.000Z","size":1709,"stargazers_count":1,"open_issues_count":6,"forks_count":2,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-09-19T12:27:54.126Z","etag":null,"topics":["e-commerce","event-driven","firebase","full-stack","kafka","microservices","mongodb","monorepo","multi-tenant","nestjs","nextjs","pnpm","pnpm-workspace","prisma-orm","redis","saas","shadcn-ui","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/hasnaintypes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-31T18:39:52.000Z","updated_at":"2025-09-19T10:06:37.000Z","dependencies_parsed_at":"2025-08-31T19:30:29.546Z","dependency_job_id":"de22d2a0-9429-4a25-bbde-1c5f3a22f9dd","html_url":"https://github.com/hasnaintypes/shopra-monorepo","commit_stats":null,"previous_names":["hasnaintypes/shopra-monorepo"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hasnaintypes/shopra-monorepo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnaintypes%2Fshopra-monorepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnaintypes%2Fshopra-monorepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnaintypes%2Fshopra-monorepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnaintypes%2Fshopra-monorepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hasnaintypes","download_url":"https://codeload.github.com/hasnaintypes/shopra-monorepo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hasnaintypes%2Fshopra-monorepo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31530641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["e-commerce","event-driven","firebase","full-stack","kafka","microservices","mongodb","monorepo","multi-tenant","nestjs","nextjs","pnpm","pnpm-workspace","prisma-orm","redis","saas","shadcn-ui","typescript"],"created_at":"2025-09-05T01:02:53.768Z","updated_at":"2026-04-07T21:31:50.735Z","avatar_url":"https://github.com/hasnaintypes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Shopra Monorepo\n\n\u003e **Shopra** a multi-tenant SaaS marketplace platform built with a modular **monorepo** architecture.  \n\u003e Developed and maintained by [@hasnaintypes](https://github.com/hasnaintypes).\n\n---\n\n## Project Overview\n\nShopra is a **modern multi-tenant e-commerce SaaS platform** designed to empower independent sellers while offering a seamless shopping experience to end-users. The project adopts a **microservices architecture** with **Next.js frontends** for different stakeholders and **NestJS services** for the backend.\n\nIt enables sellers to create and manage their stores independently, users to shop across a dynamic marketplace, and administrators to monitor and manage the ecosystem efficiently.\n\n---\n\n## Core Features\n\n- **Multi-Tenant SaaS Model**  \n  Independent sellers onboard, list products, manage inventory, and fulfill orders.\n\n- **Personalized Shopping Experience**  \n  Real-time recommendations powered by **TensorFlow**.\n\n- **Real-Time Chat**  \n  WebSocket-based communication between sellers and customers.\n\n- **Event-Driven Microservices**  \n  Asynchronous communication powered by **Kafka**.\n\n- **Scalable Infrastructure**  \n  Built with **NestJS microservices**, **MongoDB**, and **Redis caching**.\n\n- **Role-Based Access Control**  \n  Sellers, users, and admins operate via dedicated frontends with centralized authentication.\n\n---\n\n## Tech Stack\n\n### Frontend\n\n[![Next.js](https://img.shields.io/badge/Next.js-000000?style=flat\u0026logo=next.js\u0026logoColor=white)](https://nextjs.org/)\n[![React](https://img.shields.io/badge/React-20232A?style=flat\u0026logo=react\u0026logoColor=61DAFB)](https://react.dev/)\n[![TailwindCSS](https://img.shields.io/badge/TailwindCSS-06B6D4?style=flat\u0026logo=tailwindcss\u0026logoColor=white)](https://tailwindcss.com/)\n[![Shadcn UI](https://img.shields.io/badge/Shadcn%20UI-000000?style=flat)](https://ui.shadcn.com/)\n\n### Backend\n\n[![NestJS](https://img.shields.io/badge/NestJS-E0234E?style=flat\u0026logo=nestjs\u0026logoColor=white)](https://nestjs.com/)\n[![Kafka](https://img.shields.io/badge/Kafka-231F20?style=flat\u0026logo=apache-kafka\u0026logoColor=white)](https://kafka.apache.org/)\n[![Redis](https://img.shields.io/badge/Redis-DC382D?style=flat\u0026logo=redis\u0026logoColor=white)](https://redis.io/)\n[![MongoDB](https://img.shields.io/badge/MongoDB-47A248?style=flat\u0026logo=mongodb\u0026logoColor=white)](https://www.mongodb.com/)\n[![Prisma](https://img.shields.io/badge/Prisma-2D3748?style=flat\u0026logo=prisma\u0026logoColor=white)](https://www.prisma.io/)\n\n### Infrastructure \u0026 Tooling\n\n[![PNPM](https://img.shields.io/badge/pnpm-000000?style=flat\u0026logo=pnpm\u0026logoColor=yellow)](https://pnpm.io/)\n[![GitHub Actions](https://img.shields.io/badge/GitHub%20Actions-2088FF?style=flat\u0026logo=github-actions\u0026logoColor=white)](https://github.com/features/actions)\n[![Docker](https://img.shields.io/badge/Docker-2496ED?style=flat\u0026logo=docker\u0026logoColor=white)](https://www.docker.com/)\n\n---\n\n## Monorepo Structure\n\nThe repository follows a **pnpm workspace monorepo** structure with separation between apps, backend services, and shared libraries.\n\n```\n\nshopra-monorepo/\n├── apps/\n│   ├── web/              # Next.js app — User/Customer-facing UI\n│   ├── seller-portal/    # Next.js app — Seller dashboard\n│   ├── admin-panel/      # Next.js app — Admin dashboard\n│\n├── services/\n│   ├── api-gateway/      # NestJS API Gateway\n│   ├── svc-auth/         # Authentication \u0026 authorization\n│   ├── svc-product/      # Product management service\n│   ├── svc-order/        # Order processing \u0026 fulfillment\n│   ├── svc-recommendation/ # TensorFlow-powered recommendations\n│   ├── svc-chat/         # Real-time WebSocket chat\n│   ├── svc-user/         # User profile management\n│   ├── svc-notifications/ # Notifications (push/email)\n│\n├── libs/\n│   ├── ui/               # Shared UI components (Shadcn wrappers, design system)\n│   ├── shared-types/     # Common TypeScript types \u0026 interfaces\n│   ├── kafka-client/     # Reusable Kafka producer/consumer\n│   ├── logging-lib/      # Centralized logging utility\n│   ├── prisma-client/    # Centralized Prisma client\n│\n├── .github/              # GitHub workflows (CI/CD)\n├── .husky/               # Git hooks (Prettier, linting, tests)\n├── .vscode/              # Recommended settings \u0026 extensions\n├── package.json\n├── pnpm-workspace.yaml   # PNPM workspace configuration\n├── tsconfig.json\n└── README.md\n\n```\n\n---\n\n## Architectural Principles\n\n- **Domain-Driven Design (DDD)**: Each service encapsulates a specific domain (auth, product, order, etc.).\n- **Microservices**: Services are loosely coupled and communicate via Kafka events.\n- **Event-Driven**: Kafka ensures reliable, asynchronous communication across services.\n- **Separation of Concerns**: Apps (UI), services (backend), and libs (shared code) are modular and independently deployable.\n- **Scalability**: Each service can be scaled independently based on load.\n\n---\n\n## Kafka Event Flows\n\n- **OrderCreated → Product Service**: Update inventory asynchronously.\n- **OrderCreated → Notifications Service**: Send push/email notifications.\n- **ProductViewed / ProductPurchased → Recommendation Service**: Update recommendation models in real-time.\n- **Chat Messages → Notifications Service**: Notify participants of new messages.\n\n---\n\n## Next.js App Structure\n\nEach app (`web`, `seller-portal`, `admin-panel`) follows the App Router with **feature-based modularity**.\n\n```\n\n/apps/web/\n├── src/\n│   ├── app/          # Next.js App Router (public/protected routes)\n│   ├── components/   # Reusable components\n│   ├── lib/          # Client utilities \u0026 hooks\n│   ├── styles/       # Global \u0026 theme styles\n├── public/           # Static assets\n\n```\n\n---\n\n## Setup \u0026 Installation\n\n### 1. Clone the Repository\n\n```bash\ngit clone https://github.com/hasnaintypes/shopra-monorepo.git\ncd shopra-monorepo\n```\n\n### 2. Install Dependencies\n\n```bash\npnpm install\n```\n\n### 3. Environment Variables\n\nCreate `.env` files for apps and services.\nSee **[Environment Setup](#-environment-variables)** for details.\n\n### 4. Run Development Servers\n\n```bash\npnpm dev\n```\n\n---\n\n## Deployment\n\n- **Frontend Apps**: Deployable on Vercel, Netlify, or Docker.\n- **Backend Services**: Deployable on Kubernetes, Docker Swarm, or standalone containers.\n- **CI/CD**: GitHub Actions workflows handle build, linting, testing, and deployment pipelines.\n\n---\n\n## Environment Variables\n\nEach service and app requires environment configuration.\nDefine variables in `.env` files (not included in the repo).\n\n\u003e **Sections to add later:**\n\n- API Gateway\n- Authentication Service\n- Product Service\n- Order Service\n- Recommendation Service\n- Chat Service\n- Notifications Service\n- Frontend Apps (`web`, `seller-portal`, `admin-panel`)\n\n---\n\n## Testing\n\n- **Unit Tests**: Each service has a `test/unit` folder.\n- **E2E Tests**: Located in `test/e2e` inside services.\n- **CI Integration**: Tests run automatically in GitHub Actions.\n\n---\n\n## Roadmap\n\n- [ ] Multi-currency support\n- [ ] Multi-language support\n- [ ] Analytics dashboard for sellers\n- [ ] AI-powered fraud detection\n\n---\n\n## Contributing\n\nContributions are welcome!\n\n1. Fork the repo\n2. Create a feature branch\n3. Submit a Pull Request\n\n---\n\n## License\n\n[MIT](./LICENSE) © [@hasnaintypes](https://github.com/hasnaintypes)\n\n---\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasnaintypes%2Fshopra-monorepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhasnaintypes%2Fshopra-monorepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhasnaintypes%2Fshopra-monorepo/lists"}