Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

ESousa97/apigotask

apigotask

Minimalist and high-performance task management API built strictly with the Go standard library.

Go Task API Banner

CI/CD Go Report Card Go Reference License: MIT Go Version Last Commit


Go Task API is my third project developed in Go, created with the goal of consolidating knowledge in the language and exploring its fundamental patterns. This repository serves as study material and personal reference, focusing on an implementation strictly based on the standard library (net/http).

The project implements architectural patterns such as Repository and Dependency Injection, ensuring modularity and testability in environments with multiple providers (Memory and PostgreSQL).

What this project teaches

This project was built to absorb essential engineering concepts with Go:

  • Standard Library: Using net/http without external frameworks (Gin, Echo).
  • Dependency Injection: Decoupling layers through interfaces.
  • Dual Persistence: Implementation of repositories in both memory and PostgreSQL.
  • Middlewares: Creation of security (Auth) and resilience (Recovery) layers.
  • DevOps & CI/CD: Orchestration with Docker and automation with GitHub Actions.

Project Showcase

API Interaction (curl)

Create a Task:

curl -i -X POST \
  -H "X-API-Key: secret-key" \
  -H "Content-Type: application/json" \
  -d '{"title": "Documentation Refactor", "description": "Implement high-quality docs", "status": "doing"}' \
  http://localhost:8080/tasks

List All Tasks:

curl -i -H "X-API-Key: secret-key" http://localhost:8080/tasks

Tech Stack

Technology Role
Go 1.22+ Core runtime and standard library (net/http)
PostgreSQL Persistent data storage
Docker Containerization and infrastructure orchestration
GitHub Actions Automated CI/CD pipeline

Prerequisites

  • Go >= 1.22
  • Docker & Docker Compose (for PostgreSQL)
  • Make (optional, but recommended)

Installation and Usage

From Source

# 1. Clone the repository
git clone https://github.com/ESousa97/apigotask.git
cd apigotask

# 2. Start the database
docker-compose up -d

# 3. Build and Run
make run

Makefile Targets

Target Description
make build Compiles the project into bin/apigotask
make run Builds and executes the server
make test Runs all unit and integration tests
make clean Removes build artifacts and binaries
make help Displays all available commands

Architecture

The project follows a modular structure separated by logical responsibilities, ensuring that business rules remain decoupled from infrastructure details.

graph TD
    Client[HTTP Client] --> Mux[net.ServeMux]
    Mux --> Handler[internal/handler]
    Handler --> RepoInterface[internal/repository Interface]
    RepoInterface --> Postgres[internal/repository/PostgreSQL]
    RepoInterface --> Memory[internal/repository/Memory]
    
    subgraph "Domain Layer"
    Task[internal/domain/Task]
    end
Loading

API Reference

Method Endpoint Description Auth Required
GET /tasks List all available tasks Yes
POST /tasks Create a new task entry Yes
GET /tasks/{id} Retrieve a specific task Yes
PUT /tasks/{id} Update an existing task Yes
DELETE /tasks/{id} Remove a task Yes

View full documentation at pkg.go.dev/github.com/ESousa97/apigotask.

Configuration

Variable Description Type Default
APP_PORT Port where the server listens int 8080
DB_URL PostgreSQL connection string string postgres://postgres:password@localhost:5433/taskdb?sslmode=disable

Roadmap

Track the project's evolution stages:

  • Phase 1: Foundation — In-Memory persistence core.
  • Phase 2: Persistence — PostgreSQL integration with Docker.
  • Phase 3: Security — Middleware implementation (Auth & Recovery).
  • Phase 4: Patterns — Repository Pattern & Dependency Injection.
  • Phase 5: Governance — CI/CD, Professional Documentation and Badges.

Contributing

Interested in collaborating? Check our CONTRIBUTING.md for code standards and PR process.

License

This project is licensed under the MIT License — see the LICENSE file for details.

Author

Enoque Sousa

LinkedIn GitHub Portfolio

⬆ Back to top

Made with ❤️ by Enoque Sousa

Project Status: Archived — Study Project

About

56 - Minimalist task management API built with Go's

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors