# ousaro/jobtrackerlocal architecture

> Architecture diagram of the GitHub repository ousaro/jobtrackerlocal, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ousaro/jobtrackerlocal
- Repository: https://github.com/ousaro/jobtrackerlocal

## Overview

#### Purpose and Entry Points
JobTracker is a polyglot job-application management platform composed of independently runnable services. The browser entry is the Next.js App Router in `Frontend/app/layout.tsx` and `Frontend/app/page.tsx`; backend HTTP processes start from service-specific bootstrap files such as `Backend/application_service/src/index.js`, `Backend/auth_service/src/main/java/com/jobtracker/auth_service/JobtrackerApplication.java`, and `Backend/fileUpload_service/index.js`.

#### Edge, Authentication, and Discovery
Kong is the public routing and security boundary, configured in `Kong/kong.yml` and `Kong/kong.conf`; it applies RS256 JWT validation and CORS before routing to services. Auth is a Spring Boot/PostgreSQL bounded context: `Backend/auth_service/src/main/java/com/jobtracker/auth_service/controllers/AuthController.java`, `Backend/auth_service/src/main/java/com/jobtracker/auth_service/services/TokenService.java`, and `Backend/auth_service/src/main/java/com/jobtracker/auth_service/configurations/SecurityConfig.java`. Services self-register and expose health endpoints for Consul-driven discovery, e.g. `Backend/user_service/src/Config/registerService.js` and `Backend/analytics_service/src/Controllers/healthController.js`.

#### Frontend Client Boundary
The frontend provides login/signup and authenticated dashboard domains—applications, contacts, interviews, profiles, analytics, and settings—through route files including `Frontend/app/(auth)/login/page.tsx`, `Frontend/app/dashboard/layout.tsx`, and `Frontend/app/dashboard/analytics/page.tsx`. `Frontend/context/AuthContext.tsx` and `Frontend/components/withAuth.tsx` own client auth state/protection; API modules such as `Frontend/api/applicationApi/applicationApi.ts` and `Frontend/utils/axios.ts` isolate calls to gateway-backed services.

#### Write-Side Domain Services
User, application, contact, and interview services own CRUD commands and publish domain events. Node/Express services use MongoDB models/controllers in `Backend/user_service/src/Models/user.js`, `Backend/user_service/src/Controllers/userController.js`, and `Backend/application_service/src/Models/JobApplication.js`. Java/Spring Boot services use Mongo repositories and service layers in `Backend/contact_service/src/main/java/com/jobtracker/contact_service/services/ContactService.java`, `Backend/interview_service/src/main/java/com/jobtracker/interview_service/repositories/InterviewRepository.java`, and `Backend/interview_service/src/main/java/com/jobtracker/interview_service/services/RabbitMQPublisher.java`. User deletion spans user and auth boundaries with compensating behavior rather than a shared transaction.

#### Event and Read-Model Pipeline
RabbitMQ topic events decouple write services from derived views. Publishers are represented by `Backend/application_service/src/Config/publisher.js` and `Backend/user_service/src/Config/publisher.js`; Java producers publish through `Backend/contact_service/src/main/java/com/jobtracker/contact_service/services/RabbitMQPublisher.java`. Analytics consumes application/interview events and persists aggregate counters through `Backend/analytics_service/src/Config/consumer.js` and `Backend/analytics_service/src/Models/AnalyticsModel.js`. Dashboard and notification services are consumer-oriented processes rooted at `Backend/dashboard_service/src/index.js` and `Backend/notification_service/src/index.js`.

#### Search, Files, and Infrastructure
Search is a CQRS read side: `Backend/search_service/src/Config/consumer.js` consumes write-side queues, `Backend/search_service/src/Config/meili.js` connects to Meilisearch, and `Backend/search_service/src/Controllers/searchController.js` serves indexed queries. File uploads are a separate filesystem-backed boundary using `Backend/fileUpload_service/src/controllers/UploadController.js`, `Backend/fileUpload_service/src/constants/UploadFolders.js`, and `Backend/fileUpload_service/uploads/resume/1`. Material infrastructure is defined at the repository root in `docker-compose.yml`: Kong, Consul, RabbitMQ, PostgreSQL, MongoDB, and Meilisearch; services otherwise run independently with Node.js/Express or Java 17/Spring Boot runtimes.

Main entry points: [`Kong/kong.yml`](https://github.com/ousaro/jobtrackerlocal/blob/main/Kong/kong.yml) (Kong gateway), [`docker-compose.yml`](https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml) (Domain event bus), [`Backend/user_service/src/Controllers/userController.js`](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/user_service/src/Controllers/userController.js) (User service), [`Backend/auth_service/src/main/java/com/jobtracker/auth_service/controllers/AuthController.java`](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/auth_service/src/main/java/com/jobtracker/auth_service/controllers/AuthController.java) (Auth service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Client &amp; Edge"]
  node_frontend["Next.js frontend<br/>App Router<br/>[layout.tsx]"]
  node_client_auth["Client auth boundary<br/>React auth<br/>[AuthContext.tsx]"]
  node_gateway{{"Kong gateway<br/>API gateway<br/>[kong.yml]"}}
end

subgraph group_write["Write Services"]
  node_auth["Auth service<br/>Spring Boot"]
  node_user["User service<br/>Node/Express<br/>[userController.js]"]
  node_application["Application service<br/>Node/Express<br/>[index.js]"]
  node_contact["Contact service<br/>Spring Boot"]
  node_interview["Interview service<br/>Spring Boot"]
  node_uploads["File upload service<br/>Node/Express"]
end

subgraph group_read["Event Consumers &amp; Reads"]
  node_analytics["Analytics service<br/>Event consumer<br/>[consumer.js]"]
  node_dashboard["Dashboard service<br/>Event consumer<br/>[index.js]"]
  node_notifications["Notification service<br/>Event consumer<br/>[index.js]"]
  node_search["Search service<br/>CQRS read side<br/>[consumer.js]"]
end

subgraph group_infra["Shared Infrastructure"]
  node_auth_db[("Auth database<br/>PostgreSQL<br/>[docker-compose.yml]")]
  node_domain_db[("Domain data<br/>MongoDB<br/>[docker-compose.yml]")]
  node_rabbitmq["Domain event bus<br/>RabbitMQ topics<br/>[docker-compose.yml]"]
  node_meilisearch[("Search index<br/>Meilisearch<br/>[docker-compose.yml]")]
  node_consul{{"Service discovery<br/>Consul<br/>[docker-compose.yml]"}}
end

node_frontend -->|"auth state"| node_client_auth
node_frontend -->|"API requests"| node_gateway
node_client_auth -->|"login/signup"| node_auth
node_gateway -->|"routes authenticated calls"| node_auth
node_gateway -->|"routes"| node_user
node_gateway -->|"routes"| node_application
node_gateway -->|"routes"| node_contact
node_gateway -->|"routes"| node_interview
node_gateway -->|"search queries"| node_search
node_gateway -->|"file uploads"| node_uploads
node_auth -->|"accounts and tokens"| node_auth_db
node_user -->|"user documents"| node_domain_db
node_application -->|"application documents"| node_domain_db
node_contact -->|"contact documents"| node_domain_db
node_interview -->|"interview documents"| node_domain_db
node_user -.->|"deletion compensation"| node_auth
node_user -->|"publishes events"| node_rabbitmq
node_application -->|"publishes events"| node_rabbitmq
node_contact -->|"publishes events"| node_rabbitmq
node_interview -->|"publishes events"| node_rabbitmq
node_rabbitmq -->|"application/interview events"| node_analytics
node_rabbitmq -->|"derived view events"| node_dashboard
node_rabbitmq -->|"notification events"| node_notifications
node_rabbitmq -->|"indexing events"| node_search
node_search -->|"indexes and queries"| node_meilisearch
node_user -.->|"registers and health checks"| node_consul
node_analytics -.->|"health endpoint"| node_consul

click node_frontend "https://github.com/ousaro/jobtrackerlocal/blob/main/Frontend/app/layout.tsx"
click node_client_auth "https://github.com/ousaro/jobtrackerlocal/blob/main/Frontend/context/AuthContext.tsx"
click node_gateway "https://github.com/ousaro/jobtrackerlocal/blob/main/Kong/kong.yml"
click node_auth "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/auth_service/src/main/java/com/jobtracker/auth_service/controllers/AuthController.java"
click node_auth_db "https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml"
click node_user "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/user_service/src/Controllers/userController.js"
click node_application "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/application_service/src/index.js"
click node_contact "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/contact_service/src/main/java/com/jobtracker/contact_service/services/ContactService.java"
click node_interview "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/interview_service/src/main/java/com/jobtracker/interview_service/services/RabbitMQPublisher.java"
click node_domain_db "https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml"
click node_rabbitmq "https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml"
click node_analytics "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/analytics_service/src/Config/consumer.js"
click node_dashboard "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/dashboard_service/src/index.js"
click node_notifications "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/notification_service/src/index.js"
click node_search "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/search_service/src/Config/consumer.js"
click node_meilisearch "https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml"
click node_uploads "https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/fileUpload_service/src/controllers/UploadController.js"
click node_consul "https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_frontend,node_client_auth,node_gateway toneBlue
class node_auth,node_user,node_application,node_contact,node_interview,node_uploads toneAmber
class node_analytics,node_dashboard,node_notifications,node_search toneMint
class node_auth_db,node_domain_db,node_rabbitmq,node_meilisearch,node_consul toneRose
```

## Components

### Client & Edge

- [Next.js frontend](https://github.com/ousaro/jobtrackerlocal/blob/main/Frontend/app/layout.tsx): App Router · Browser login and dashboard experience. · `Frontend/app/layout.tsx`
- [Client auth boundary](https://github.com/ousaro/jobtrackerlocal/blob/main/Frontend/context/AuthContext.tsx): React auth · `Frontend/context/AuthContext.tsx`
- [Kong gateway](https://github.com/ousaro/jobtrackerlocal/blob/main/Kong/kong.yml): API gateway · Public JWT and CORS enforcement boundary. · `Kong/kong.yml`

### Write Services

- [Auth service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/auth_service/src/main/java/com/jobtracker/auth_service/controllers/AuthController.java): Spring Boot · `Backend/auth_service/src/main/java/com/jobtracker/auth_service/controllers/AuthController.java`
- [User service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/user_service/src/Controllers/userController.js): Node/Express · `Backend/user_service/src/Controllers/userController.js`
- [Application service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/application_service/src/index.js): Node/Express · `Backend/application_service/src/index.js`
- [Contact service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/contact_service/src/main/java/com/jobtracker/contact_service/services/ContactService.java): Spring Boot · `Backend/contact_service/src/main/java/com/jobtracker/contact_service/services/ContactService.java`
- [Interview service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/interview_service/src/main/java/com/jobtracker/interview_service/services/RabbitMQPublisher.java): Spring Boot · `Backend/interview_service/src/main/java/com/jobtracker/interview_service/services/RabbitMQPublisher.java`
- [File upload service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/fileUpload_service/src/controllers/UploadController.js): Node/Express · Filesystem-backed resume uploads. · `Backend/fileUpload_service/src/controllers/UploadController.js`

### Event Consumers & Reads

- [Analytics service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/analytics_service/src/Config/consumer.js): Event consumer · Builds aggregate dashboard counters. · `Backend/analytics_service/src/Config/consumer.js`
- [Dashboard service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/dashboard_service/src/index.js): Event consumer · `Backend/dashboard_service/src/index.js`
- [Notification service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/notification_service/src/index.js): Event consumer · `Backend/notification_service/src/index.js`
- [Search service](https://github.com/ousaro/jobtrackerlocal/blob/main/Backend/search_service/src/Config/consumer.js): CQRS read side · Indexes write-side events and serves search queries. · `Backend/search_service/src/Config/consumer.js`

### Shared Infrastructure

- [Auth database](https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml): PostgreSQL · `docker-compose.yml`
- [Domain data](https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml): MongoDB · Service-owned document persistence. · `docker-compose.yml`
- [Domain event bus](https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml): RabbitMQ topics · `docker-compose.yml`
- [Search index](https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml): Meilisearch · `docker-compose.yml`
- [Service discovery](https://github.com/ousaro/jobtrackerlocal/blob/main/docker-compose.yml): Consul · Registration and health-based discovery. · `docker-compose.yml`

## Connections

- Next.js frontend → Client auth boundary: auth state
- Next.js frontend → Kong gateway: API requests
- Client auth boundary → Auth service: login/signup
- Kong gateway → Auth service: routes authenticated calls
- Kong gateway → User service: routes
- Kong gateway → Application service: routes
- Kong gateway → Contact service: routes
- Kong gateway → Interview service: routes
- Kong gateway → Search service: search queries
- Kong gateway → File upload service: file uploads
- Auth service → Auth database: accounts and tokens
- User service → Domain data: user documents
- Application service → Domain data: application documents
- Contact service → Domain data: contact documents
- Interview service → Domain data: interview documents
- User service → Auth service: deletion compensation
- User service → Domain event bus: publishes events
- Application service → Domain event bus: publishes events
- Contact service → Domain event bus: publishes events
- Interview service → Domain event bus: publishes events
- Domain event bus → Analytics service: application/interview events
- Domain event bus → Dashboard service: derived view events
- Domain event bus → Notification service: notification events
- Domain event bus → Search service: indexing events
- Search service → Search index: indexes and queries
- User service → Service discovery: registers and health checks
- Analytics service → Service discovery: health endpoint
