Giter Site home page Giter Site logo

kannan112 / any-fashion-gin-clean-code Goto Github PK

View Code? Open in Web Editor NEW
7.0 1.0 1.0 309.54 MB

My First Project As Ecommerce Backend Api Using Go Programing Language

License: MIT License

Go 95.28% Makefile 0.54% HTML 4.04% Dockerfile 0.14%
aws clean-architecture go golang gorm postgresql razorpay-payment swagger-documentation viper wire googl-auth cicd docker jwt razorpay-payment-gateway stripe-payments

any-fashion-gin-clean-code's Introduction

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 ecommerce-gin-clean-arch 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. [Google Auth]https://github.com/google/google-auth-library-go: A Go library for handling authentication and authorization with Google services.
  8. Twilio: A Go client library for the Twilio API, enabling communication via SMS, voice, and other channels.
  9. Razorpay: A Go client library for the Razorpay API, facilitating payment processing and management.
  10. Stripe: A Go client library for the Stripe API, allowing seamless integration with Stripe's payment platform.
  11. AWS SDK: A comprehensive SDK for integrating Go applications with Amazon Web Services, providing functionalities for interacting with Amazon S3 and other AWS services.

Additionally, the project boasts robust CI/CD capabilities, leveraging GitHub Actions for automated build, test, and deployment processes. The source code is dockerized for seamless containerization, enhancing portability and scalability. Kubernetes (K8s) is utilized for efficient orchestration and management of containerized applications, ensuring optimal performance and scalability. This entire deployment process is demonstrated live on anyfashion.abhinand.live/swagger/index.html, providing transparency and insight into the project's deployment pipeline.

Feel free to reach out if you need further clarification or details!

Setup Instructions

To use and test the ecommerce-gin-clean-arch project, please follow these steps:

Prerequisites

Make sure you have the following installed on your system:

1. Clone the Repository

Clone the ecommerce-gin-clean-arch repository to your local system:

git clone https://github.com/kannan112/any-fashion-gin-clean-code.git
cd any-fashion-gin-clean-code

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:

## Server
PORT="localhost default :8080"
### 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"
### JWT
ADMIN_AUTH_KEY="secret code for signing admin JWT token"
USER_AUTH_KEY="secret code for signing user JWT token"
### Twilio
TWILIO_AUTHTOKEN="your Twilio authentication token"
TWILIO_ACCOUNT_SID="your Twilio account SID"
TWILIO_SERVICES_ID="your Twilio messaging service SID"
### Razorpay
RAZOR_PAY_KEY="your Razorpay API test key"
RAZOR_PAY_SECRET="your Razorpay API test secret key"
### Google Auth
GOAUTH_CLIENT_ID="your Google auth client ID"
GOAUTH_CLIENT_SECRET="your Google auth secret key"
REDIRECT_URL="your registered callback URL for Google Auth"
### Stripe
SECRET_KEY="your stripe secret key"
PUBLISHABLE_KEY="your stripe publishable key"

any-fashion-gin-clean-code's People

Contributors

kannan112 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

kirankumarhm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.