-
Notifications
You must be signed in to change notification settings - Fork 1
Tech Stack Report
-
Technical Architecture Report
- Table of Contents
- Introduction
- System Architecture Overview
- 1. Frontend (Next.js)
- 2. API Gateway (Ocelot)
- 3. Service Registry and Discovery (Consul)
- 4. Microservices
- 5. Message Bus (RabbitMQ)
- 6. Logging Service (Seq)
- 7. Monitoring and Observability (OpenTelemetry)
- 8. Databases
- 9. Containerization (Docker)
- 10. CI/CD and Deployment
- 11. Additional Technical Considerations
- Conclusion
- References
This technical report outlines the high-level architecture of our software system, detailing each component, its responsibilities, technologies used, and interactions within the ecosystem. The architecture is designed to ensure scalability, maintainability, security, and optimal performance, leveraging modern frameworks and best practices.
The system comprises a frontend built with Next.js, an API Gateway using Ocelot, a service registry and discovery mechanism with Consul, consolidated microservices handling distinct business capabilities, and supporting infrastructure components such as a message bus, logging service, and monitoring tools. The entire ecosystem is containerized using Docker and managed through CI/CD pipelines for streamlined deployments.
- Framework: Next.js (React)
-
Responsibilities:
- User Interface (UI): Provides an interactive and responsive interface for users.
- Server-Side Rendering (SSR): Enhances performance and SEO by rendering pages on the server.
- Routing: Manages both dynamic and static routes for seamless navigation.
- SEO Optimization: Implements best practices to improve search engine visibility.
- API Integration: Communicates with backend services via RESTful APIs.
- Authentication: Integrates directly with Firebase Authentication for user management and authentication.
-
Deployment: Vercel
-
Features:
- Automatic deployments on every push.
- Preview deployments for pull requests.
- Optimized performance and global CDN distribution.
-
Features:
- Technology: Ocelot running on ASP.NET Core
-
Responsibilities:
- Single Entry Point: Acts as the main access point for all client requests.
- Request Routing: Directs incoming HTTP requests to the appropriate microservices.
- Authentication Validation: Validates JWT tokens issued by Firebase Authentication.
- Rate Limiting: Implements rate limiting to prevent API abuse.
- Retry Policies: Utilizes Polly for implementing retry policies and circuit breakers.
-
Integration:
- Service Discovery: Connects with Consul to dynamically discover service instances.
- Technology: Consul
-
Responsibilities:
- Dynamic Service Registration: Automatically registers microservices as they become available.
- Service Discovery: Enables services to locate each other without hard-coded addresses.
- Health Monitoring: Performs health checks to ensure services are operational.
- Configuration Storage: Maintains key-value pairs for distributed configuration management.
All microservices share a common architectural foundation to ensure consistency, scalability, and maintainability.
- Framework: ASP.NET Core
- Object-Relational Mapping (ORM): Entity Framework Core
- Validation: FluentValidation for enforcing business rules.
- Object Mapping: AutoMapper for transforming data between layers.
- Mediator Pattern: MediatR to decouple request handling.
- Logging: Serilog for structured logging with Seq integration.
- Metrics and Tracing: OpenTelemetry for observability.
- Service Registration: Integrated with Consul for dynamic discovery.
- Database: PostgreSQL
- Caching: Redis for distributed caching
-
Users & Jobs Service
-
Functions:
- User registration, authentication, and profile management
- Role-based access control (RBAC)
- Job posting and management
- Job search with advanced filters
- Application tracking
- Database: PostgreSQL
-
Functions:
-
Communication Service
-
Functions:
- Real-time messaging using WebSockets
- Push notifications for mobile and desktop
- Email notifications
- Message and notification history management
- Database: PostgreSQL
-
Additional Technologies:
- SignalR for real-time communication
- Firebase Cloud Messaging for push notifications
-
Functions:
-
AI Service
-
Functions:
- AI-based CV and profile suggestions
- Content moderation for job postings and user-generated content
- Skill recommendation based on market trends
- Database: PostgreSQL
-
Additional Technologies:
- Integration with OpenAI API or similar language models
- ML.NET for custom machine learning models
-
Functions:
- Technology: RabbitMQ
- Function: Facilitates asynchronous communication between microservices through message queues, enabling loose coupling, improved scalability, and enhanced fault tolerance.
- Technology: Seq
- Function: Centralizes and visualizes structured logs from all microservices, allowing for real-time log analysis, troubleshooting, and monitoring.
- Technology: OpenTelemetry
-
Functions:
- Metrics Collection: Gathers performance metrics from various components.
- Distributed Tracing: Tracks the flow of requests across microservices to identify bottlenecks and performance issues.
- Data Export: Sends collected data to observability backends for analysis and visualization.
- Integration: Grafana and Prometheus for metrics visualization and alerting.
-
PostgreSQL:
- Usage: Primary database for all microservices.
- Advantages: Robust support for complex queries, transactions, and data integrity.
-
Redis:
- Usage: Distributed caching to improve performance and reduce database load.
- Functions: Session storage, request caching, and distributed locking.
- Technology: Docker
- Function: Packages microservices and infrastructure components into containers, ensuring consistency across development, testing, and production environments. Facilitates scalable and efficient deployments.
- Orchestration: Kubernetes for container orchestration and management in production.
-
Continuous Integration/Continuous Deployment (CI/CD):
- Tool: GitHub Actions
-
Functions:
- Automates build, test, and deployment pipelines.
- Ensures code quality through automated testing and static code analysis.
- Enables rapid and reliable deployments.
- Deployment Targets:
-
Entity Framework Core:
- Utilized as the ORM for interacting with PostgreSQL databases.
- Implements the repository and unit of work patterns for data access abstraction.
- Manages database migrations to maintain schema versioning and consistency.
-
Database Optimization:
- Implements indexes tailored to each microservice's query patterns.
- Employs query optimization techniques to enhance performance.
- Utilizes database partitioning for large-scale data management.
-
Asynchronous Communication:
- Managed by RabbitMQ, allowing microservices to communicate via message queues without tight coupling.
- Implements the outbox pattern for ensuring message delivery and maintaining data consistency across services.
-
Synchronous Communication:
- Handled through HTTP calls facilitated by the Ocelot API Gateway, enabling real-time interactions.
- Implements retry policies and circuit breakers using Polly to enhance resilience.
-
Authentication:
- Managed via Firebase Authentication, issuing and validating JWT tokens to secure API endpoints.
- Implements refresh token rotation for enhanced security.
-
Data Protection:
- All communications are secured using HTTPS/TLS to ensure data confidentiality and integrity.
- Sensitive data within databases is encrypted at rest and in transit.
- Implements data masking for sensitive information in logs and error messages.
-
API Security:
- Implements rate limiting and throttling to prevent abuse.
- Uses OAuth 2.0 and OpenID Connect for secure authorization flows.
-
Horizontal Scaling:
- Microservices are designed to be stateless, facilitating horizontal scaling by adding or removing instances based on demand.
- Utilizes Kubernetes horizontal pod autoscaler for automatic scaling based on CPU and memory metrics.
-
Database Scaling:
- Implements read replicas for PostgreSQL to distribute read traffic.
- Utilizes database sharding for high-volume data services.
-
OpenAPI (Swagger):
- Each microservice utilizes OpenAPI to generate interactive and up-to-date API documentation.
- Implements API versioning to manage changes and ensure backward compatibility.
-
Centralized Error Handling:
- Implements a global exception handling middleware in each microservice.
- Utilizes Polly for implementing retry policies, circuit breakers, and bulkheads.
-
Caching Strategy:
- Implements a multi-level caching strategy using Redis and in-memory caching.
- Utilizes cache-aside and write-through patterns for data consistency.
-
Asynchronous Processing:
- Leverages asynchronous programming models in ASP.NET Core for improved throughput.
The updated architecture leverages modern technologies and best practices to build a scalable, maintainable, and secure system. By consolidating microservices and improving the overall structure, we've enhanced system efficiency while maintaining modularity. The direct integration of Firebase Authentication with the frontend simplifies the authentication flow. The implementation of advanced caching strategies, robust security measures, and comprehensive monitoring ensures the system remains performant, secure, and observable as it scales to meet future demands.
- Next.js Documentation
- Ocelot Documentation
- Consul Documentation
- Firebase Authentication
- Redis Documentation
- RabbitMQ Documentation
- Seq Documentation
- OpenTelemetry Documentation
- Docker Documentation
- GitHub Actions Documentation
- Render Documentation
- Vercel Documentation
- Polly Documentation
- Redis Documentation
- Linkerd Documentation