Skip to content

akshayUr04/project-ecommerce

Repository files navigation

Ecommerce Project using Go Programming with Gin Framework

This project is an ecommerce application built using Go programming language and the Gin framework. It follows the clean code architecture, which promotes separation of concerns and maintainability.

Project Overview

The project is designed to provide a performant and feature-rich ecommerce solution. It includes functionalities such as user authentication, product management, shopping cart, order processing, and payment integration.

Used Packages

The project utilizes the following packages:

  1. GIN: A web framework written in Go that combines high performance with an API similar to Martini.
  2. JWT: A Go implementation of JSON Web Tokens for secure authentication and authorization.
  3. GORM with PostgreSQL: A powerful ORM library for Go that simplifies database operations.
  4. Wire: A code generation tool for dependency injection, making it easier to connect components.
  5. Viper: A configuration solution for Go applications, supporting various formats and 12-Factor app principles.
  6. swag with gin-swagger and swaggo files: Converts Go annotations to Swagger Documentation 2.0 for API documentation.
  7. Twilio: A Go client library for the Twilio API, enabling communication via SMS, voice, and other channels.
  8. Razorpay: A Go client library for the Razorpay API, facilitating payment processing and management. Please refer to the respective package documentation for more information on how to use and integrate these packages into your Go application.

Setup Instructions

To use and test project, please follow these steps:

Prerequisites

Make sure you have the following installed on your system:

1. Clone the Repository

Clone the project-ecommerce repository to your local system:

git clone https://github.com/akshayUr04/project-ecommerce.git
cd project-ecommerce

2. Install Dependencies

Install the required dependencies using either the provided Makefile command or Go's built-in module management:

# Using Makefile
make deps
# OR using Go
go mod tidy

3. Configure Environment Variables

details provided at the end of the file

4. Make Swagger Files (For Swagger API Documentation)

make swag

To Run The Application

make run

To See The API Documentation

  1. visit [swagger] http://localhost:8000/swagger/index.html

To Test The Application

1. Generate Mock Files

make mockgen

2. Run The Test Functions

make test

Set up Environment Variables

Set up the necessary environment variables in a .env file at the project's root directory. Below are the variables required:

### PostgreSQL database details
DB_NAME="your database name"
DB_USER="your database user name"
DB_PASSWORD="your database owner password"
DB_PORT="your database running port number"
### Twilio
AUTH_TOKEN="your Twilio authentication token"
ACCOUNT_SID="your Twilio account SID"
SERVICE_SID="your Twilio messaging service SID"
### Razorpay
RAZOR_PAY_KEY="your Razorpay API test key"
RAZOR_PAY_SECRET="your Razorpay API test secret key"

Releases

No releases published

Packages

No packages published

Languages