Skip to content

An e-commerce platform API built using Go, leveraging a range of powerful libraries and services.

License

Notifications You must be signed in to change notification settings

th3y3m/e-commerce-platform

Repository files navigation

CodeQL E-Commerce Platform (CI applid) MIT License

Welcome to E-Commerce Platform in Go

This project is an e-commerce platform built using Go, leveraging a range of powerful libraries and services to handle various aspects of the application, including user authentication, payment processing, product management, and more.

Go GORM Gin PostgreSQL Google Cloud JWT Casbin Goth Redis RabbitMQ


Table of Contents
  1. Features
  2. Technologies Used
  3. Screenshots
  4. Contact Us

🚀 Features

  • User Authentication: Supports Google and Facebook authentication via goth, alongside email and JWT authentication.
  • Storage: Uses Google Cloud Storage for storing product images and other media files.
  • RBAC Authorization: Implements Role-Based Access Control (RBAC) using casbin to manage user permissions efficiently.
  • Task Scheduling: Utilizes gocron for scheduling and managing periodic tasks such as promotions, product updates, etc.
  • Database Management: Powered by GORM with PostgreSQL as the primary database for storing user data, products, and orders.
  • Session Management: Uses gin-contrib/sessions for secure session handling.
  • Custom Product UUIDs: Generates unique identifiers for products using google/uuid.
  • Configuration Management: Environment variables are managed using godotenv for easier configuration.
  • Caching: Implements Redis for caching frequently accessed data.
  • Message Queue: Uses RabbitMQ for handling asynchronous communication between services.

🛠️ Technologies Used

  • Backend Framework: gin (A lightweight web framework in Go).
  • Database: PostgreSQL with gorm for ORM.
  • Authentication: goth for Google and Facebook OAuth, jwt-go for JWT tokens.
  • Storage: Google Cloud Storage for media assets.
  • Scheduling: gocron for background tasks.
  • RBAC Authorization: casbin for role-based access control.
  • Unique Identifiers: google/uuid for generating UUIDs.
  • Caching: redis for caching.
  • Message Queue: RabbitMQ for message queue management.
  • Unit Test: testify for Unit Test.

📸 Screenshots

(Screenshots coming soon...)

Requirements

  • Go 1.23.0 or above.
  • PostgreSQL database.
  • Google Cloud credentials for Cloud Storage.
  • OAuth credentials for Google and Facebook authentication.
  • Redis server for caching.
  • RabbitMQ server for message queues.

Installation

  1. Clone the repository:

    git clone https://github.com/th3y3m/e-commerce-platform.git
    cd e-commerce-platform
  2. Install Go dependencies:

    go mod download
  3. Set up environment variables by creating a .env file in the root directory:

    touch .env
  4. Run the application:

    go run main.go

Modules & Libraries

  • Gin: Web framework for building the HTTP server and RESTful APIs.
  • GORM: ORM library for database management.
  • Casbin: Authorization library for role-based access control (RBAC).
  • JWT-Go: For creating and verifying JWT tokens.
  • Google Cloud Storage: For storing media files.
  • GoCron: For scheduling tasks.
  • Goth: For Google and Facebook OAuth.
  • Redis: For caching frequently used data.
  • RabbitMQ: For message queue management.
  • Godotenv: For environment variable management.
  • UUID: For generating unique product and order IDs.

License

This project is licensed under the MIT License. See the LICENSE file for details.

📬 Contact Us

For inquiries or support, reach out via truongtanhuy3006@gmail.com.


© 2024 th3y3m

About

An e-commerce platform API built using Go, leveraging a range of powerful libraries and services.

Topics

Resources

License

Security policy

Stars

Watchers

Forks