code-odessey-hex-arch

module
v0.0.0-...-bc46c97 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 11, 2024 License: MIT

README

GO USER AUTHENTICATION HEXAGONAL ARCHITECTURE EXAMPLE

DISCLAIMER: Code in this repository is intended for educational purpose. This project is using a modular monolithic architecture employing the hexagonal architecture pattern, type-driven development and a production-ready approach to build a user authentication system.

This repository aims to showcase advanced techniques for building close to production-ready application in Golang. Mostly inspired by the realworld-go by AngusGMorrison. The project is primarily a learning exercise for various Golang and DevOPS concepts.

Hexagonal Architecture

This project is an implementation of the Hexagonal Architecture but for an explanation of this architecture and its benefits, you can check out realworld-go, where he references some interest articles on the topic from Netflix and Uber. For a video explanation on the architecture checkout How To Structure Your Go App - Full Course playlist.

How Project is Structured

COMING SOON..

Progress

Here's what's been implemented so far.

Go User Authentication Hexagonal Architecture Example

  • Users
  • Authentication
  • Authorization
  • Sessions
  • Refresh Tokens
  • Password Management
  • Email Verification
  • Account Security Features
  • Role Based Access Control (RBAC)
  • Multi-factor Authentication (2FA)
  • Rate Limiting
  • Audit Logging
  • Account Recovery

Productionization

  • CI pipeline
  • Optimized Docker image
  • First-class error handling
  • Configuration
  • Linting
  • Extensive, concurrent unit test suite
  • Health checks
  • Streamlined local development experience
  • Optimistic concurrency control
  • Concurrent integration tests
  • Structured logging
  • Metrics
  • Tracing
  • API documentation
  • Local Deployment

Acknowledgements

This project was inspired by and borrows concepts from Realworld-go by Angus Morrison. The original code provided valuable insights into structuring a Go application using hexagonal architecture.

Directories

Path Synopsis
cmd
healthcheck command
server command
internal
adapters/outbound/postgres
Package postgres provides an API to a postgres database that aligns with the domain outbount interfaces.
Package postgres provides an API to a postgres database that aligns with the domain outbount interfaces.
adapters/outbound/postgres/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
core/ports/inbound/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
core/ports/outbound/mock
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
pkg
etag
Package etag provides functions for parsing and generating globally unique ETags from a UUID and updated-at timestamp.
Package etag provides functions for parsing and generating globally unique ETags from a UUID and updated-at timestamp.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL