TalentHire is a backend API for a talent management platform built using a microservices architecture with .NET Core. This backend-only solution implements modern distributed system patterns including event-driven communication via Apache Kafka and provides RESTful APIs for talent recruitment and job application management.
The application follows a microservices architecture pattern with the following components:

- API Gateway (Port 8080) - Central entry point for all client requests
- Identity Service (Port 8082) - User authentication and authorization
- Job Service (Port 8081) - Job posting and management
- Applications Service (Port 8083) - Job application processing
- Apache Kafka - Event streaming platform for inter-service communication
- Apache Zookeeper - Kafka cluster coordination
- PostgreSQL Databases - Data persistence for each service
- Docker & Docker Compose - Containerization and orchestration
- Kafka Producer/Consumer Services - Asynchronous communication between services
- Event-Driven Architecture - Decoupled service interactions
TalentHire/
βββ Services/
β βββ IdentityService/ # User authentication & authorization
β βββ JobService/ # Job posting & management
β βββ ApplicationsService/ # Job application processing
βββ GatewayAPI/ # API Gateway & routing
βββ Shared/
β βββ Kafka/ # Shared Kafka utilities & models
βββ Tests/ # Unit & integration tests
βββ docker-compose.yml # Multi-container orchestration
βββ TalentHire.sln # Visual Studio solution file
Before running the application, ensure you have the following installed:
- Docker Desktop (v4.0 or later)
- Docker Compose (v2.0 or later)
- .NET 8.0 SDK (for local development)
- Git (for version control)
-
Clone the Repository
git clone <repository-url> cd TalentHire
-
Environment Setup
β οΈ IMPORTANT - Security Configuration:Before running the application, you should configure your own credentials:
a) Create Environment File (Recommended):
cp .env.example .env # If available # Or create your own .env file
b) Configure Database Credentials:
# Add to .env file or export as environment variables POSTGRES_USER=your_db_username POSTGRES_PASSWORD=your_secure_passwordc) Configure JWT Settings:
JWT_SECRET_KEY=your_very_secure_jwt_secret_key_at_least_32_characters JWT_ISSUER=your_application_issuer JWT_AUDIENCE=your_application_audience
The application uses environment variables defined in the
docker-compose.ymlfile. Default configurations are set for development environments only. -
Build and Start Services
# Build and start all services docker-compose up --build # Or run in detached mode docker-compose up --build -d
-
Verify Installation
Once all containers are running, verify the services are accessible:
- API Gateway: http://localhost:8080
- Job Service: http://localhost:8081
- Identity Service: http://localhost:8082
- Applications Service: http://localhost:8083
- Kafka: localhost:29092
The services have dependencies and start in the following order:
- Infrastructure: Zookeeper β Kafka β Databases
- Core Services: Identity Service β Job Service β Applications Service
- Gateway: API Gateway (depends on all core services)
For local development without Docker:
-
Start Infrastructure Services
# Start only infrastructure (databases, Kafka) docker-compose up zookeeper kafka job_db identity_db applications_db -
Run Services Locally
# Identity Service cd Services/IdentityService dotnet run # Job Service cd Services/JobService dotnet run # Applications Service cd Services/ApplicationsService dotnet run # API Gateway cd GatewayAPI dotnet run
Each service has its own PostgreSQL database:
- job_db (Port 5432): Job Service database
- identity_db (Port 6303): Identity Service database
- applications_db (Port 6304): Applications Service database
Connection Details:
- Username: Configured via
POSTGRES_USERenvironment variable - Password: Configured via
POSTGRES_PASSWORDenvironment variable - Host:
localhost(or service name in Docker network)
β οΈ Security Note: The default docker-compose.yml contains development credentials. For production, always use secure credentials and consider using Docker secrets or external secret management systems.
Kafka Broker: localhost:29092 (external) / kafka:9092 (internal)
Topics (Auto-created):
- Application events
- Job events
- User events
The project includes comprehensive test suites for each service:
# Run all tests
dotnet test TalentHire.Tests.sln
# Run specific service tests
dotnet test Tests/JobService.Tests/
dotnet test Tests/IdentityService.Tests/
dotnet test Tests/ApplicationsService.Tests/All services implement health check endpoints:
- Job Service: http://localhost:8081/health
- Identity Service: http://localhost:8082/health
- Applications Service: http://localhost:8083/health
# View running containers
docker-compose ps
# View service logs
docker-compose logs [service-name]
docker-compose logs -f api-gateway # Follow logs
# Restart specific service
docker-compose restart [service-name]
# Stop all services
docker-compose down
# Stop and remove volumes (β οΈ Data loss)
docker-compose down -v
# Scale services (if needed)
docker-compose up --scale job-service=2Service Won't Start:
# Check container status
docker-compose ps
# View detailed logs
docker-compose logs [service-name]
# Rebuild specific service
docker-compose build [service-name]
docker-compose up [service-name]Database Connection Issues:
# Check database container
docker-compose logs job_db
# Access database directly
docker-compose exec job_db psql -U postgres -d job_dbKafka Connection Issues:
# Check Kafka logs
docker-compose logs kafka
# Verify Kafka topics
docker-compose exec kafka kafka-topics --list --bootstrap-server localhost:9092Each service exposes the following endpoints:
/health- Health check endpoint/swagger- API documentation (Development only)- Service-specific endpoints as documented in individual Swagger UIs
- Development: Console logging with detailed information
- Production: Structured logging (can be extended with Serilog/NLog)
Key environment variables used across services:
# General
ASPNETCORE_ENVIRONMENT=Development
NODE_ENV=development
# Database Connections
ConnectionStrings__DBConnection=Host=localhost;...
# JWT Configuration
JwtSettings__SecretKey=your-secret-key
JwtSettings__Issuer=your-issuer
JwtSettings__Audience=your-audience
# Kafka Configuration
KAFKA_BOOTSTRAP_SERVERS=localhost:29092Configuration files are located in each service directory:
appsettings.json- Base configurationappsettings.Development.json- Development overridesappsettings.Production.json- Production settings
-
Update Configuration
- Set
ASPNETCORE_ENVIRONMENT=Production - Update database connection strings
- Configure JWT settings with secure keys
- Set
-
Build Production Images
docker-compose -f docker-compose.yml -f docker-compose.prod.yml build
-
Deploy
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
For deployment to cloud platforms:
# Tag images
docker tag talenthire_job-service your-registry/job-service:latest
# Push to registry
docker push your-registry/job-service:latest- Follow C# coding conventions
- Write unit tests for new functionality
- Update documentation for API changes
- Ensure Docker builds succeed
- Test Kafka integration thoroughly
- JWT-based authentication
- Service-to-service communication secured within Docker network
- Database credentials managed via environment variables
- HTTPS enforced in production environments