Skip to content

About

REST API for a Helpdesk application built with Go and the Gin web framework, focused on ticket management and handling.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4 Commits

Folders and files

Repository files navigation

🎫 Helpdesk API

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.

Go Gin REST API

📖 About

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.

✨ Features

  • 🎫 Create support tickets
  • 🔎 Retrieve individual tickets
  • 📋 List tickets
  • 🔄 Change ticket status
  • 🏷️ Ticket priority management
  • ⚠️ Domain-specific error handling
  • 🧩 Repository abstraction
  • 💾 In-memory persistence

🏗️ Architecture

The project follows a domain-oriented architecture, separating the core business logic from external concerns such as HTTP handling and data persistence.

📂 Project Structure

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.

🧠 Domain

Contains the core business concepts and rules of the application.

  • ticket.go — Ticket entity
  • status.go — Ticket status definitions
  • priority.go — Ticket priority definitions
  • errors.go — Domain-specific errors

📚 Repository

Defines the contracts required for ticket persistence. The application depends on the repository abstraction instead of directly depending on a concrete storage implementation.

⚙️ Use Cases

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

🔧 Service

Responsible for coordinating application and domain operations.

🌐 Handler

Responsible for the HTTP layer, including request handling, input processing, application calls, and HTTP responses.

🏭 Infrastructure

Contains concrete implementations of external dependencies. Currently, ticket persistence is handled through an in-memory repository.

🔄 Request Flow

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.

🚀 Getting Started

📋 Prerequisites

Make sure you have Go installed on your machine.

📥 Clone the Repository

git clone https://github.com/gabriiel-silva/helpdesk.git cd helpdesk

📦 Install Dependencies

go mod download

▶️ Run the Application

go run ./cmd/api

The API will be available at:

http://localhost:6969

🔌 API Endpoints

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

🎯 Project Goals

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

🚧 Project Status

🟡 Work in Progress

The project is continuously evolving as new features, improvements, and architectural refinements are implemented.

📄 License

This project is intended for educational and personal use.

Built with ❤️ using Go

About

REST API for a Helpdesk application built with Go and the Gin web framework, focused on ticket management and handling.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages