A full-stack e-commerce application with an admin dashboard, built using a microservices architecture in a monorepo setup powered by Turborepo.
This project demonstrates how to structure and develop multiple microservices for an e-commerce platform using Next.js, Express.js, Fastify.js, Hono.js, Prisma, MongoDB, Kafka, and Stripe for payments. The repository includes a shared database package, shared types, and role-based authentication middleware.
- Monorepo architecture using Turborepo
- Microservices for:
- Products
- Orders
- Payments
- Authentication
- Role-based authentication across services
- Stripe Checkout integration with backend and webhooks
- Kafka event-driven architecture for asynchronous communication
- Database management with Prisma (PostgreSQL/MySQL) and MongoDB
- Next.js frontend with search filters and product pages
- Admin Dashboard:
- Manage Products, Orders, Users, Categories
- Fetch charts, card lists, and analytics
- Create, update, and delete operations
- Microservice authentication middleware for Express, Fastify, and Hono
- Email notifications using Nodemailer and Kafka events
- Next.js Frontend for e-commerce store
- Product listing, filtering, and search functionality
- Product detail pages with multiple images, sizes, and colors
- Shopping cart with quantity management and remove item option
- Checkout flow with:
- Shipping address form
- Payment method integration (Stripe)
- Order summary and confirmation page
- User authentication with JWT (login/signup)
- Role-based access for admin and regular users
- Responsive design for mobile and desktop
- React Query for efficient data fetching and mutations
- Real-time updates for cart and order status
- User Management
- Create, update, and delete users
- Role-based access control (admin vs regular users)
- View individual user details and orders
- Product Management
- Create, update, and delete products
- Add product categories
- Manage product images, sizes, and colors
- Order Management
- View all orders
- Update order status (pending, shipped, delivered, canceled)
- Filter and search orders
- Analytics & Reports
- Fetch and display charts (sales, orders, users)
- View total revenue, discounts, and shipping fees
- Dashboard summary for quick insights
- Email & Notifications
- Send order confirmation emails
- Integrates with Kafka events for real-time notifications
- React Query Integration
- Efficient data fetching, caching, and mutations
- Real-time updates in dashboard UI
- Manages product CRUD
- Integrated with Prisma PostgreSQL
- Handles orders and status
- Communicates via Kafka
- Integrated with MongoDB
- Stripe integration
- Payment webhooks
- JWT-based authentication
- Role-based access control
- Sends order confirmation and notifications
- Integrated with Kafka events
- Prisma: prisma migrate dev for SQL services
- MongoDB: Use .env for URI connection
- The shared database package is used in Turborepo to maintain schema consistency
- Stripe Checkout for payments
- Stripe webhook handler for payment confirmation
- Products created dynamically using Kafka events
- ┣ 📂 admin__Admin dashboard application
- ┣ 📂 auth-service__Authentication microservice
- ┣ 📂 client__Next.js e-commerce frontend
- ┣ 📂 product-service__Product microservice
- ┣ 📂 order-service__Order microservice
- ┣ 📂 payment-service__Payment microservice
- ┗ 📂 email-service__Email service microservice
- ┣ 📂 eslint-config__Shared ESLint configuration
- ┣ 📂 kafka__Shared Kafka setup for all services
- ┣ 📂 order-db__Shared order database package
- ┣ 📂 product-db__Shared product database package
- ┣ 📂 types__Shared TypeScript types
- ┗ 📂 typescript-config__Shared TypeScript configuration