How baejihyun97/fire-response-system works
Project type and purpose
• This is a full-stack, event-driven microservices system for a “Fire Response System.”
• It consists of six backend services (reportmanagement, videoproccessing, eventmanagement, aianalysis, feedservice, notification), a Spring Cloud API Gateway, a Vue.js frontend, and a Kafka message bus.
File structure
• Top-level directories for each microservice, each with its own pom.xml, Dockerfile, Kubernetes manifests, src/main/java/fireresponsesystem/domain (domain entities & events), and infra (REST controllers, policy handlers, HATEOAS processors).
• A gateway module using Spring Cloud Gateway.
• A frontend Vue project (src/components, router.js, App.vue).
• An infra folder for Kafka compose and shared Docker Compose definitions.
• Kubernetes templates at the repo root and per-service.
README for additional insights
• Services communicate via Kafka topics—each service publishes and subscribes to domain events.
• The gateway aggregates all HTTP endpoints on port 8088.
• Frontend communicates only with the gateway.
• Deployable via Docker Compose or Kubernetes (EKS, AWS CLI tooling suggested).
Main components & their interactions
a. Frontend (Vue.js SPA)
• Runs on localhost:8088 (served by the gateway).
• Executes UI commands (e.g., ReceiveReportCommand, TriggerVideoAnalysisCommand).
b. API Gateway (Spring Cloud Gateway)
• Single HTTP entry point.
• Routes REST calls to individual microservices on internal ports.
c. Backend Microservices (Spring Boot each)
• reportmanagement: accepts new reports → emits ReportReceived event.
• videoproccessing: listens for ReportReceived → processes video → emits VideoAnalyzed or VideoAnalysisFailed.
• eventmanagement: listens for VideoAnalyzed → creates/updates events → emits IdentifiedAsFireEvent or IdentifiedAsNonFireEvent.
• aianalysis: listens for IdentifiedAsFireEvent → calls AI module → emits AiAnalyzed.
• feedservice: listens for AiAnalyzed & other domain events → publishes posts → emits PostPublished.
• notification: listens for all “important” events → sends notifications → persists Notification.
d. Kafka (message broker)
• Central event bus.
• Each service has producer & consumer clients configured via application.yml.
e. Each service’s Database (implicit in domain repositories)
• Stores its own entities.
• Boundaries maintained (no shared schema).
f. Container & Orchestration
• Docker for containerization (per-service Dockerfile).
• Kubernetes manifests for deployment.
• Shared Docker Compose in infra/docker-compose.yml for local Kafka and service composition.
Architectural patterns & design principles
• Microservices with bounded contexts (each module owns its domain model & repository).
• Event-driven architecture via Kafka topics.
• API Gateway pattern for unified HTTP façade.
• HATEOAS-driven REST with Spring Data REST processors.
• Domain-driven design: domain events, commands, repositories.
• Containerization and 12-factor app readiness.