Microservices architecture is the dominant pattern for scalable web applications. But designing the service boundaries, communication patterns, and deployment topology correctly is challenging — especially for teams doing it for the first time.
This guide provides a production-tested microservices template that you can use as a starting point for your own architecture.
The Template Architecture
Our microservices template includes 6 core services:
1. API Gateway
- Routes external requests to internal services
- Handles authentication (JWT validation)
- Rate limiting and request throttling
- Request/response transformation
2. User Service
- Registration, authentication, authorization
- Profile management
- Role-based access control
- Password reset, email verification
3. Core Service (your domain)
- Primary business logic
- CRUD operations for domain entities
- Business rules and validation
- State machine management
4. Notification Service
- Email (transactional and marketing)
- Push notifications (mobile)
- In-app notifications
- Webhook delivery
5. File Service
- File upload and storage (S3-compatible)
- Image processing and thumbnails
- Document generation (PDF, CSV)
6. Analytics Service
- Event tracking
- Usage metrics
- Dashboard data aggregation
Communication Patterns
The template uses two communication patterns:
Synchronous (REST/gRPC): For request-response interactions where the caller needs an immediate answer. User authentication, data queries, CRUD operations.
Asynchronous (message queue): For fire-and-forget operations. Email sending, analytics events, webhook delivery, background processing.
Technology Stack
The template supports multiple technology stacks:
| Layer | Options |
|---|---|
| Backend | Flask + SQLAlchemy, Laravel + Eloquent, NestJS + TypeORM |
| Frontend | Next.js + shadcn/ui, Next.js + MUI, Next.js + Ant Design |
| Database | PostgreSQL (primary), Redis (cache + queue) |
| Message Queue | Redis (dev) / RabbitMQ (prod) |
| Deployment | Docker Compose (dev), Kubernetes (prod) |
| CI/CD | GitHub Actions |
| Monitoring | Prometheus + Grafana, Sentry |
Generating the Codebase
In Archiet, you can generate a complete microservices codebase from this template:
- Start the Architecture Wizard
- Describe your system: "A [your domain] SaaS with user management, [your core feature], email notifications, and file uploads"
- The AI extracts entities and maps them to the microservices template
- Generate code — you get a complete, deployable codebase with all 6 services
The generated output includes Docker Compose for local development, Kubernetes manifests for production, and GitHub Actions for CI/CD.
Download the Template
Try Archiet free for 7 days. Generate your microservices architecture and download the full codebase. No credit card required.