Skip to content

Task Manager application built with Go microservices, gRPC, and a Gin-based API Gateway. Includes JWT authentication, user and task services with PostgreSQL, and full observability with OpenTelemetry and Jaeger. Each service is containerized with Docker and orchestrated using Docker Compose, providing a scalable, modular, and production-ready.

License

Notifications You must be signed in to change notification settings

amirhasanpour/task-manager

Repository files navigation

Task Manager Application with Microservices Architecture

A distributed task management system built using a scalable Go microservices architecture, featuring gRPC for fast inter-service communication, a dedicated API Gateway for HTTP routing, centralized authentication, task/user services, and full observability with OpenTelemetry and Jaeger. All services are containerized with Docker and orchestrated using Docker Compose for local development.


Features and Tools

  • Microservices architecture with independently deployable services for authentication, user management, and task operations
  • High-performance inter-service communication using gRPC with Protocol Buffers for strict type safety
  • RESTful API Gateway built with Gin for request routing, middleware, and unified HTTP access
  • JWT-based authentication using golang-jwt for secure and stateless user sessions
  • PostgreSQL as the primary database for reliable user and task persistence
  • Redis caching support for future token/session optimization and performance improvements
  • Centralized metrics collection and monitoring with Prometheus-compatible instrumentation
  • Distributed tracing and observability powered by OpenTelemetry, exported to Jaeger for full request lifecycle tracking
  • Structured application logging using Zap for high-performance, production-grade log output
  • Containerization of all services using Docker for isolated, reproducible environments
  • Service orchestration with Docker Compose for simplified local development and multi-service management
  • Protocol Buffers for defining service contracts and generating gRPC server/client implementations
  • Swagger documentation support within the API Gateway for interactive REST API exploration
  • Clean architecture patterns with clear separation of handlers, business logic, repositories, and transport layers

How to run?

Using Docker Compose

cd to the project directory and run this command:

docker-compose up --build -d

to stop all services:

docker-compose down

to stop services and remove database volumes:

docker-compose down -v

API Endpoints


Swagger

Before using Swagger UI, please read API Endpoint section. You can visit Swagger UI in this address http://localhost:8080/swagger/index.html#/


Run Tests

Run Unit Tests

cd todo-service
go test ./tests/unit/... -v

Run Handler Tests separately

cd todo-service
go test ./tests/unit -run TestTaskHandlerTestSuite -v

Run Service Tests separately

cd todo-service
go test ./tests/unit -run TestTaskServiceTestSuite -v

Run Interface Tests separately

cd todo-service
go test ./tests/unit -run TestRepositoryInterface -v

Run Integration Tests

# Start test database
docker run -d --name test-postgres \
  -e POSTGRES_USER=postgres \
  -e POSTGRES_PASSWORD=postgres \
  -e POSTGRES_DB=test_tasks \
  -p 5432:5432 \
  postgres:15-alpine

# Wait for database to start
sleep 5

# Run integration tests
RUN_INTEGRATION_TESTS=true go test ./tests/integration -v

# Clean up
docker stop test-postgres && docker rm test-postgres

About

Task Manager application built with Go microservices, gRPC, and a Gin-based API Gateway. Includes JWT authentication, user and task services with PostgreSQL, and full observability with OpenTelemetry and Jaeger. Each service is containerized with Docker and orchestrated using Docker Compose, providing a scalable, modular, and production-ready.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages