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.
Table of Contents
- 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.
- 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 coming soon...)
- 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.
-
Clone the repository:
git clone https://github.com/th3y3m/e-commerce-platform.git cd e-commerce-platform
-
Install Go dependencies:
go mod download
-
Set up environment variables by creating a
.env
file in the root directory:touch .env
-
Run the application:
go run main.go
- 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.
This project is licensed under the MIT License. See the LICENSE file for details.
For inquiries or support, reach out via truongtanhuy3006@gmail.com.