Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

github.com/fmcarrero/contacts-api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/fmcarrero/contacts-api


Version published
Created
Source

Contacts Management System

Hexagonal Architecture Echo Framework PostgreSQL Docker

Apache 2.0 License CI GO 1.22

This project is a Golang-based application for contacts, utilizing the echo framework and following the Hexagonal Architecture pattern for a clean separation of concerns and modular design.

Project Structure

The application is organized around three main entities: Contact. Each entity is encapsulated within three packages representing the layers of the Hexagonal Architecture:

  • infrastructure: Contains code related to database operations, networking, and interfacing with external systems.
  • application: Hosts the application logic, defining use cases and orchestrating between the infrastructure and domain layers.
  • domain: Defines the business models and core business logic.

The following diagram illustrates the Hexagonal Architecture pattern:

  • hexagonal.webp

Technologies Used

  • Programming Language: GO 1.22
  • Framework: Echo
  • Build Tool: Build
  • Database: PostgreSQL

Error Handling

The application includes robust error handling for managing exceptions gracefully, ensuring reliability and ease of debugging.

Database Migrations

The initial database schema is provided in the migrations folder. These migration files are utilized within the Docker Compose setup to initialize the PostgreSQL database.

Snowflake IDs

We use the Snowflake algorithm to generate unique identifiers (IDs) for distributed computing, providing a unique sequence that is time sortable.

Health Check Endpoint

A /ping endpoint is available and can be used in deployment systems to check the health of the application.

How to Use

To query contacts, use the following endpoint structure:

start container

docker-compose up --build

execute

curl --location 'http://localhost:8085/v1/contacts' \

FAQs

Package last updated on 04 Jun 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc