Skip to content

Girmex/go-ecommerce

Repository files navigation

Go E-Commerce API

A backend e-commerce application built with Go (Golang) using the Fiber web framework and following a modular layered architecture. The project provides RESTful APIs for user management, product catalog management, shopping cart and order processing, payment integration, and notification services.

Status: Currently being migrated to a Microservices Architecture using Hexagonal Architecture, gRPC, and Docker.


Features

  • User registration and management
  • Product catalog management
  • Category management
  • Shopping cart
  • Order and transaction management
  • Stripe payment integration
  • SMS notification support
  • RESTful API
  • Docker Compose support

Tech Stack

  • Go (Golang)
  • Fiber
  • GORM
  • PostgreSQL
  • JWT Authentication
  • Docker
  • Docker Compose
  • Stripe API
  • Twilio SMS (or the SMS provider you actually use)
  • Go Modules

Project Structure

.
├── config/
├── internal/
│   ├── api/
│   │   └── rest/
│   │       ├── handlers/
│   │       ├── httpHandler.go
│   │       └── response.go
│   ├── domain/
│   ├── dto/
│   ├── helper/
│   ├── repository/
│   └── service/
├── pkg/
│   ├── notification/
│   └── payment/
├── docker-compose.yaml
├── go.mod
├── main.go
└── README.md

Architecture

Current architecture:

HTTP Request
      │
REST Handlers
      │
Service Layer
      │
Repository Layer
      │
Database

The project follows a Layered Architecture with clear separation of concerns.


Business Modules

User Module

Responsible for:

  • User registration
  • User management
  • Authentication utilities

Catalog Module

Responsible for:

  • Product management
  • Category management

Transaction Module

Responsible for:

  • Shopping cart
  • Orders
  • Transactions

Payment Module

Responsible for:

  • Stripe payment integration

Notification Module

Responsible for:

  • SMS notifications

Running the Project

Clone the repository

git clone https://github.com/Girmex/go-ecommerce.git

Enter the project

cd go-ecommerce

Download dependencies

go mod download

Run the application

go run main.go

Start Docker services

docker compose up -d

Future Roadmap

This project is being migrated into a production-ready Microservices Architecture.

Planned services include:

  • API Gateway
  • Auth Service
  • User Service
  • Product Service
  • Order Service
  • Payment Service
  • Notification Service

Additional improvements:

  • gRPC communication
  • Hexagonal Architecture
  • Independent databases per service
  • Dockerized deployment
  • Unit testing
  • Integration testing
  • CI/CD pipeline

Learning Objectives

This project demonstrates:

  • Backend development with Go
  • REST API development
  • Layered Architecture
  • Domain-oriented code organization
  • Docker-based development
  • Stripe integration
  • Notification integration

Future versions will demonstrate:

  • Microservices
  • gRPC
  • Hexagonal Architecture
  • API Gateway
  • Distributed systems

Author

Girma Moges

GitHub: https://github.com/Girmex

About

Backend E-Commerce API built with Go, evolving from a modular monolith to a microservices architecture using Hexagonal Architecture, gRPC, Docker, and PostgreSQL.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages