8000 GitHub - QuocAnh189/Mini_Ecommerce_Clean: E-Commerce mini system via Golang and React with Clean Architechture
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

QuocAnh189/Mini_Ecommerce_Clean

Repository files navigation

Go-Ecommerce-Clean Architecture

Go-Ecommerce-Clean Architecture

⭐⭐⭐ Give Me Star

If this project is helpful to you, please consider giving it a star on GitHub. Contact with me if you have a question.

Overview

The purpose of the template is to show:

  • how to organize a project and prevent it from turning into spaghetti code
  • where to store business logic so that it remains independent, clean, and extensible
  • how not to lose control when a project grows

Using the principles of Robert Martin (aka Uncle Bob).

Demo (Youtube)

Watch the demo

Clean Architecture

Clean

Database

Database

Clean Module

User_Module

UserModel

Product_Module

ProductModule

Order_Module

OrderModule

Cart_Module

OrderModule

Use Case

UseCase

Tech Stack

TechStack

Project Structure

Project_Structure

cmd/app

Entry point of the application. Responsible for initializing the configuration, setting up the logger, and starting the application.

configs

Contains configuration files for different environments, such as database connections, API keys, and other application settings.

db

Holds database-related files, including database setup and option function.

frontend

Setup client for demo project.

docs

Contains documentation files, API specifications, and related documentation resources.

internals

This directory houses the core business logic of the application, divided into multiples modules

nginx

Stores configuration files for Nginx

pkgs

Contains reusable packages and utilities that can be shared across different parts of the project.

utils

Includes utility functions and helper methods used throughout the project.

grafana

Contains configuration files and dashboards for monitoring application metrics using Grafana.

prometheus

Holds configuration files for Prometheus, which collects and stores metrics from the application for monitoring and alerting.

How to run application with Docker (Recommend)

  1. Clone the repo and cd into it
  2. Set mode LF (not CRLF) for entrypoint.sh file
  3. Copy .example.env (not app.example.env) file to .env file and update your env variables
  4. Run docker-compose up --build -d local dev environment
  5. Setup minio container.
  • Run docker exec -it <container_id of ecommerce.minio> sh.
  • Run mc alias set myminio http://ecommerce.minio:9000 minioadmin minioadmin123.
  • Run mc anonymous set public myminio/ecommerce.
  1. Test api with BASE_URL is http://localhost:8080/api/v1 or http://app.lvh.me/api/v1
  2. If you want to demo with Frontend on React, visit http://localhost:8005 on browser.

Reference projects

Useful links

Author Contact

Contact me with any questions!

Email: anquoc18092003@gmail.com Facebook: https://www.facebook.com/tranphuocanhquoc2003

Thank You so much for your time !!!

Releases

No releases published

Packages

No packages published
0