REST API for Helpdesk ticket management built with Go and Gin.
A backend project focused on ticket management, domain-oriented architecture, and separation of application responsibilities.
Helpdesk API is a REST API developed with Go and the Gin web framework. The application focuses on the management and lifecycle of support tickets.
The project is structured around the Ticket domain, keeping business rules, use cases, HTTP handling, and infrastructure responsibilities separated.
- 🎫 Create support tickets
- 🔎 Retrieve individual tickets
- 📋 List tickets
- 🔄 Change ticket status
- 🏷️ Ticket priority management
⚠️ Domain-specific error handling- 🧩 Repository abstraction
- 💾 In-memory persistence
The project follows a domain-oriented architecture, separating the core business logic from external concerns such as HTTP handling and data persistence.
View project structure
| Directory | Responsibility |
cmd/api | Application entry point and API initialization. |
internal/ticket/domain | Core ticket entities, statuses, priorities, and domain errors. |
internal/ticket/repository | Repository contracts for ticket persistence. |
internal/ticket/usecase | Application use cases and business operations. |
internal/ticket/service | Coordination between application and domain operations. |
internal/ticket/handler | HTTP request handling and response formatting. |
internal/shared | Shared HTTP utilities and error handling. |
infrastructure/repository/memory | In-memory implementation of the ticket repository. |
Contains the core business concepts and rules of the application.
ticket.go— Ticket entitystatus.go— Ticket status definitionspriority.go— Ticket priority definitionserrors.go— Domain-specific errors
Defines the contracts required for ticket persistence. The application depends on the repository abstraction instead of directly depending on a concrete storage implementation.
Contains the application's main business operations, with each operation isolated into its own use case.
- Create Ticket
- Get Ticket
- List Tickets
- Change Ticket Status
Responsible for coordinating application and domain operations.
Responsible for the HTTP layer, including request handling, input processing, application calls, and HTTP responses.
Contains concrete implementations of external dependencies. Currently, ticket persistence is handled through an in-memory repository.
A request moves through the application layers while keeping business logic isolated from the HTTP and persistence layers.
| 🌐 HTTP Request Incoming API request | ➜ | 🎯 Handler HTTP layer | ➜ | ⚙️ Use Case Application logic |
| ⬇️ | ||||
| 🗄️ Repository Persistence contract | ← | 🔧 Service Domain coordination | ← | 💾 Infrastructure In-memory storage |
Request → Handler → Use Case → Service → Repository → Infrastructure
Each layer has a specific responsibility, keeping the application easier to maintain, test, and evolve.
Make sure you have Go installed on your machine.
git clone https://github.com/gabriiel-silva/helpdesk.git cd helpdeskgo mod downloadgo run ./cmd/apiThe API will be available at:
http://localhost:6969| Method | Endpoint | Description |
|---|---|---|
POST | /tickets | Create a new ticket |
GET | /tickets | List all tickets |
GET | /tickets/:id | Get a specific ticket |
PATCH | /tickets/:id/status | Change ticket status |
This project was created to practice and explore:
- Go backend development
- REST API design
- Gin web framework
- Domain-oriented architecture
- Separation of responsibilities
- Dependency inversion
- Repository pattern
- Use case-driven development
- HTTP request handling
The project is continuously evolving as new features, improvements, and architectural refinements are implemented.
This project is intended for educational and personal use.
Built with ❤️ using Go