A modern, full-stack e-commerce platform built with Next.js, NestJS, and cutting-edge technologies. This project demonstrates a complete microservices architecture with modern UI/UX, real-time features, and comprehensive monitoring.
- NestJS - Progressive Node.js framework
- Prisma - Modern database ORM
- PostgreSQL - Primary database
- Redis - Caching layer
- OpenSearch - Search and analytics
- Kafka (Redpanda) - Event streaming
- Stripe - Payment processing
- gRPC - Microservice communication
- Prometheus - Metrics collection
- Grafana - Monitoring dashboards
- Next.js 14 - React framework with App Router
- TypeScript - Type safety
- TailwindCSS - Utility-first CSS
- shadcn/ui - Modern UI components
- Framer Motion - Smooth animations
- Auth0 - Authentication
- SWR - Data fetching
- Contentful - Content management
- Docker Compose - Local development stack
- Cloudflare Workers - Edge caching
- Kong - API Gateway
- Unleash - Feature flags
- LocalStack - AWS services emulation
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β Next.js App β β Cloudflare β β Kong Gateway β
β (Frontend) ββββββ€ Worker ββββββ€ β
βββββββββββββββββββ βββββββββββββββββββ βββββββββββββββββββ
β
βββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
β β β
ββββββββββΌβββββββββ βββββββββΌββββββββ ββββββββββΌβββββββββ
β NestJS API β β Inventory β β OpenSearch β
β (Backend) β β gRPC Serviceβ β (Search) β
ββββββββββ¬βββββββββ βββββββββββββββββ βββββββββββββββββββ
β
ββββββββββββββββΌβββββββββββββββ
β β β
βββββββββΌββββββββ βββββΌβββββ βββββββββΌββββββββ
β PostgreSQL β β Redis β β Kafka β
β (Database) β β(Cache) β β (Events) β
βββββββββββββββββ ββββββββββ ββββββββββββββββββ
- Node.js 20-22
- pnpm
- Docker & Docker Compose
git clone <repository-url>
cd microsaas-shop
pnpm installcd infra/compose
docker-compose up -dcd ../../apps/api
pnpm prisma:migrate
pnpm seed# Terminal 1 - API
cd apps/api
pnpm dev
# Terminal 2 - Web App
cd apps/web
pnpm dev
# Terminal 3 - Worker (optional)
cd apps/worker
pnpm dev- Web App: http://localhost:3000
- API: http://localhost:3001
- API Gateway: http://localhost:8000
- Grafana: http://localhost:3002
- OpenSearch: http://localhost:9200
- Unleash: http://localhost:4242
microsaas-shop/
βββ apps/
β βββ api/ # NestJS backend
β β βββ src/
β β β βββ products/ # Products module
β β β βββ orders/ # Orders module
β β β βββ search/ # Search module
β β β βββ inventory/ # Inventory gRPC service
β β β βββ health/ # Health checks
β β β βββ metrics/ # Prometheus metrics
β β βββ prisma/ # Database schema & migrations
β βββ web/ # Next.js frontend
β β βββ app/ # App Router pages
β β βββ components/ # React components
β β βββ lib/ # Utilities
β βββ worker/ # Cloudflare Worker
βββ infra/
β βββ compose/ # Docker Compose stack
β βββ terraform/ # Infrastructure as Code
βββ package.json # Root package.json
DATABASE_URL=postgresql://postgres:postgres@localhost:5432/microsaas
REDIS_URL=redis://localhost:6379
OPENSEARCH_URL=http://localhost:9200
KAFKA_BROKER=localhost:19092
STRIPE_SECRET_KEY=sk_test_...
UNLEASH_URL=http://localhost:4242/api
UNLEASH_API_TOKEN=default:dev.token
NODE_ENV=development
PORT=3001
CORS_ORIGIN=http://localhost:3000NEXT_PUBLIC_API_BASE=http://localhost:3001
AUTH0_SECRET=...
AUTH0_BASE_URL=http://localhost:3000
AUTH0_ISSUER_BASE_URL=https://...
AUTH0_CLIENT_ID=...
AUTH0_CLIENT_SECRET=...
CONTENTFUL_SPACE_ID=...
CONTENTFUL_DELIVERY_TOKEN=...
NEXT_PUBLIC_UNLEASH_URL=http://localhost:4243/api
NEXT_PUBLIC_UNLEASH_CLIENT_KEY=frontend.dev.key- β¨ Modern UI - Clean, responsive design with dark/light themes
- π Animations - Smooth transitions with Framer Motion
- π Smart Search - Real-time search with suggestions
- π Shopping Cart - Seamless checkout experience
- π€ Authentication - Secure login with Auth0
- π± Mobile First - Responsive design for all devices
- βΏ Accessible - WCAG AA compliant
- ποΈ Microservices - Modular, scalable architecture
- π Full-Text Search - OpenSearch integration
- π Real-time Metrics - Prometheus monitoring
- π Event Streaming - Kafka for async processing
- π³ Payment Processing - Stripe integration
- π₯ Health Checks - Comprehensive monitoring
- π Security - Input validation, CORS, rate limiting
- π³ Containerized - Docker for consistent environments
- βοΈ Edge Caching - Cloudflare Workers
- πͺ API Gateway - Kong for routing
- ποΈ Feature Flags - Unleash for A/B testing
- π Monitoring - Grafana dashboards
- π§ IaC - Terraform for infrastructure
cd apps/api
pnpm test# Run smoke tests
curl http://localhost:3001/health
curl http://localhost:3001/products
curl "http://localhost:3001/search?q=hoodie"http_requests_total- HTTP request counterhttp_request_duration_seconds- Request duration histogramcache_hits_total- Cache hit countersearch_requests_total- Search request counterkafka_publish_total- Kafka publish counter
Access Grafana at http://localhost:3002 to view:
- API performance metrics
- Database connection status
- Cache hit rates
- Search analytics
- Set up production database
- Configure environment variables
- Set up monitoring and alerting
- Configure CDN and caching
- Set up CI/CD pipeline
- Configure security headers
- Set up backup strategy
# Build images
docker build -t microsaas-api ./apps/api
docker build -t microsaas-web ./apps/web
# Run with production config
docker-compose -f docker-compose.prod.yml up -d- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
This project is licensed under the MIT License.
- Microservices Architecture - Designing and implementing scalable microservices
- Event-Driven Development - Using Kafka for async communication
- Search Implementation - OpenSearch for full-text search capabilities
- Real-time Monitoring - Prometheus and Grafana for observability
- Modern Frontend - Next.js 14 with App Router and modern React patterns
- UI/UX Design - Creating polished, accessible interfaces with shadcn/ui
- Animation Design - Implementing smooth, performant animations
- Type Safety - Comprehensive TypeScript usage across the stack
- Domain-Driven Design - Organizing code around business domains
- CQRS - Separating read and write operations
- Event Sourcing - Using events for state changes
- Circuit Breaker - Implementing resilience patterns
- API Gateway - Centralized routing and cross-cutting concerns
- Containerization - Docker for consistent environments
- Infrastructure as Code - Terraform for reproducible infrastructure
- Monitoring & Observability - Comprehensive metrics and logging
- Feature Flags - A/B testing and gradual rollouts
- Edge Computing - Cloudflare Workers for global performance
- Code Organization - Clean architecture and separation of concerns
- Error Handling - Graceful degradation and user feedback
- Performance - Caching, lazy loading, and optimization
- Security - Input validation, authentication, and authorization
- Accessibility - WCAG compliance and inclusive design
- Testing - Unit, integration, and E2E testing strategies
- Modern hero section with gradient background
- Feature cards with hover animations
- Featured products grid with smooth transitions
- Advanced search with real-time suggestions
- Category filtering and view modes
- Product cards with stock indicators and hover effects
- Intelligent search with filters
- Search suggestions and analytics
- Results with relevance scoring
- Multi-step checkout process
- Order summary and payment integration
- Success/error state handling
- User account management
- Order history and tracking
- Responsive design for all devices
Built with β€οΈ using modern web technologies and best practices.