GitHunt
PA

patricksferraz/pinned-company

Modern company management system built with Go, featuring clean architecture, RESTful APIs, and event-driven design. Includes Docker, Kubernetes, and Kafka integration for scalable microservices.

Pinned Company

Go Report Card
GoDoc
License: MIT

A modern, scalable company management system built with Go, featuring a clean architecture design and robust infrastructure.

๐Ÿš€ Features

  • RESTful API built with Fiber
  • Clean Architecture implementation
  • PostgreSQL database with GORM ORM
  • Docker and Kubernetes support
  • Swagger API documentation
  • Kafka integration for event-driven architecture
  • Environment-based configuration
  • Database migrations support
  • Comprehensive testing setup

๐Ÿ› ๏ธ Tech Stack

  • Backend: Go 1.18+
  • Framework: Fiber v2
  • Database: PostgreSQL
  • ORM: GORM
  • Container: Docker
  • Orchestration: Kubernetes
  • Message Broker: Kafka
  • API Documentation: Swagger
  • Environment Management: godotenv

๐Ÿ“‹ Prerequisites

  • Go 1.18 or higher
  • Docker and Docker Compose
  • PostgreSQL (if running locally)
  • Make (for using Makefile commands)

๐Ÿš€ Getting Started

  1. Clone the repository:
git clone https://github.com/patricksferraz/pinned-company.git
cd pinned-company
  1. Copy the environment file and configure it:
cp .env.example .env
  1. Start the application using Docker Compose:
docker-compose up -d
  1. Run database migrations:
make migrate
  1. Start the application in development mode:
make run

๐Ÿ—๏ธ Project Structure

.
โ”œโ”€โ”€ app/          # Application layer
โ”œโ”€โ”€ cmd/          # Command line entry points
โ”œโ”€โ”€ domain/       # Domain models and interfaces
โ”œโ”€โ”€ infra/        # Infrastructure implementations
โ”œโ”€โ”€ k8s/          # Kubernetes configurations
โ””โ”€โ”€ utils/        # Utility functions and helpers

๐Ÿ”ง Development

Available Make Commands

  • make build - Build Docker containers
  • make ps - Show running containers status
  • make logs - Show containers logs
  • make up - Start containers in detached mode
  • make start - Start stopped containers
  • make stop - Stop running containers
  • make down - Stop and remove containers, networks, and volumes
  • make attach - Attach to a running container (requires SERVICE parameter)
  • make prune - Remove unused Docker data
  • make test - Run test suite using Docker
  • make gtest - Run Go tests with coverage report
  • make gen - Generate protobuf files

Hot Reload

The project uses Air for hot reloading during development. Configuration can be found in .air.toml.

๐Ÿ“š API Documentation

Once the application is running, you can access the Swagger documentation at:

http://localhost:8080/swagger/index.html

๐Ÿณ Docker Support

The project includes Docker configuration for both development and production environments:

  • Development: Uses Docker Compose with hot-reload support
  • Production: Multi-stage Dockerfile for optimized builds

๐Ÿงช Testing

Run the test suite:

make test

๐Ÿค Contributing

  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 MIT License - see the LICENSE file for details.

๐Ÿ‘ฅ Authors

๐Ÿ™ Acknowledgments