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
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
- Clone the repository:
git clone https://github.com/patricksferraz/pinned-company.git
cd pinned-company- Copy the environment file and configure it:
cp .env.example .env- Start the application using Docker Compose:
docker-compose up -d- Run database migrations:
make migrate- 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 containersmake ps- Show running containers statusmake logs- Show containers logsmake up- Start containers in detached modemake start- Start stopped containersmake stop- Stop running containersmake down- Stop and remove containers, networks, and volumesmake attach- Attach to a running container (requires SERVICE parameter)make prune- Remove unused Docker datamake test- Run test suite using Dockermake gtest- Run Go tests with coverage reportmake 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
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ฅ Authors
- Patrick Ferraz - Initial work - patricksferraz
๐ Acknowledgments
On this page
Contributors
MIT License
Created April 2, 2022
Updated May 8, 2025