Go · Backend · CI/CD · October 2024 - December 2024

E-Commerce REST API

A Go/Gin REST API replacing manual order-processing workflows with automated Jenkins CI/CD pipelines, Dockerized deployment on Linux, and NGINX reverse proxy. Reproducible builds from commit to production.

Go Gin Jenkins Docker NGINX PostgreSQL Linux
E-Commerce REST API

Overview

This project replaces a manual, error-prone order workflow with a production-grade REST API. The backend is built in Go using the Gin framework — chosen for its performance characteristics and minimal overhead — and persists data to PostgreSQL.

The key engineering focus was the deployment pipeline. Every commit to main triggers a Jenkins CI/CD pipeline that runs tests, builds a Docker image, and deploys the container behind NGINX on a Linux server. The result is reproducible releases with zero manual deployment steps.

Architecture

⚙️
API Layer
  • Go + Gin router with grouped endpoints
  • JSON request/response with validation
  • Middleware: logging, error handling, auth
  • Structured error responses
🗄️
Data Layer
  • PostgreSQL with schema migrations
  • Connection pooling
  • Parameterized queries (no ORM)
  • Transaction support for order ops
🔄
CI/CD Pipeline
  • Jenkins pipeline triggered on push
  • Automated test stage
  • Docker build + tag by commit SHA
  • Automated deploy to Linux server
🌐
Deployment
  • Docker container on Ubuntu
  • NGINX reverse proxy + TLS termination
  • Environment variables via Docker secrets
  • Container restart policy for uptime

Features

🛒
Order management API
CRUD endpoints for products, orders, and customers with proper HTTP semantics and status codes.
🔄
Automated CI/CD
Jenkins pipeline from commit to live container — tests, build, deploy. No manual SSH required.
📦
Containerized builds
Docker image built with multi-stage build to minimize final image size. Reproducible across environments.
🔒
Auth middleware
JWT-based authentication middleware on protected routes with token validation.
📊
Structured logging
Request/response logging with duration, status code, and error context for observability.

Deployment Workflow

Push to main
Developer pushes code. Jenkins webhook fires immediately.
Test stage
Jenkins runs go test ./.... Pipeline halts on failure — nothing broken ships.
Docker build
Multi-stage Dockerfile builds a minimal production image, tagged with the commit SHA.
Deploy
Jenkins SSHes to the Linux server, pulls the new image, and restarts the container. Zero manual steps.
NGINX routes traffic
NGINX reverse proxies incoming requests to the container. TLS handled at the proxy layer.

Tech Stack

🐹
GoAPI language
GinHTTP framework
🐘
PostgreSQLDatabase
🔄
JenkinsCI/CD
📦
DockerContainerization
🌐
NGINXReverse proxy
🐧
Linux (Ubuntu)Host OS