Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A modern timecard management service built with Go, featuring gRPC and REST APIs, event-driven architecture with Kafka, and comprehensive monitoring. Perfect for enterprise-grade time tracking solutions.

License

Notifications You must be signed in to change notification settings

patricksferraz/timecard-service

Repository files navigation

Timecard Service

Go Report Card License GoDoc

A modern, scalable timecard management service built with Go, featuring gRPC and REST APIs, event-driven architecture, and comprehensive monitoring.

πŸš€ Features

  • Dual API Support: REST and gRPC endpoints for maximum flexibility
  • Event-Driven Architecture: Powered by Apache Kafka for reliable event processing
  • Database Support: PostgreSQL integration with GORM for robust data persistence
  • API Documentation: Swagger/OpenAPI documentation for easy API exploration
  • Monitoring: Elastic APM integration for comprehensive application monitoring
  • Containerized: Docker and Docker Compose support for easy deployment
  • Development Tools: PGAdmin included for database management
  • Kafka Management: Confluent Control Center for Kafka monitoring and management

πŸ› οΈ Tech Stack

  • Language: Go 1.16+
  • Framework: Gin (REST), gRPC
  • Database: PostgreSQL
  • ORM: GORM
  • Message Broker: Apache Kafka
  • Monitoring: Elastic APM
  • Container: Docker
  • Documentation: Swagger/OpenAPI

πŸ“‹ Prerequisites

  • Go 1.16 or higher
  • Docker and Docker Compose
  • Make (for using Makefile commands)

πŸš€ Getting Started

  1. Clone the repository:

    git clone https://github.com/patricksferraz/timecard-service.git
    cd timecard-service
  2. Copy the environment file and configure it:

    cp .env.example .env
  3. Start the services using Docker Compose:

    make up
  4. The service will be available at:

πŸ—οΈ Project Structure

.
β”œβ”€β”€ application/ # Application layer (use cases)
β”œβ”€β”€ cmd/ # Command line interface
β”œβ”€β”€ domain/ # Domain models and interfaces
β”œβ”€β”€ infrastructure/ # Infrastructure implementations
β”œβ”€β”€ proto/ # Protocol buffer definitions
└── utils/ # Utility functions and helpers

πŸ”§ Development

Available Make Commands

# Docker Compose Operations
make up # Start services in detached mode
make down # Stop and remove containers, networks, and volumes
make start # Start existing services
make stop # Stop running services
make ps # List running services
make logs # View service logs
make attach # Attach to a service container (requires SERVICE=service_name)
make build # Build service images
make prune # Remove unused Docker resources
# Testing
make test # Run tests using docker-compose.test.yml
make gtest # Run Go tests with coverage report
# Code Generation
make gen # Generate Go code from Protocol Buffer definitions

Running Tests

You can run tests in two ways:

  1. Using Docker Compose (recommended for CI/CD):

    make test
  2. Running Go tests directly with coverage:

    make gtest

πŸ“š API Documentation

Once the service is running, you can access the Swagger documentation at: http://localhost:8080/swagger/index.html

🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

πŸ“ License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

πŸ‘₯ Authors

  • Patrick Ferraz - Initial work

πŸ™ Acknowledgments

About

A modern timecard management service built with Go, featuring gRPC and REST APIs, event-driven architecture with Kafka, and comprehensive monitoring. Perfect for enterprise-grade time tracking solutions.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /