Code Monkey home page Code Monkey logo

furkan-gulsen / checkout-system Goto Github PK

View Code? Open in Web Editor NEW
5.0 1.0 1.0 808 KB

The project is a mini e-commerce checkout developed with Go, incorporating features such as cart management, various product types, and promotions. It utilizes technologies like Go, Docker, Grafana, and Prometheus.

License: MIT License

Makefile 0.55% Go 99.02% Dockerfile 0.43%
checkout-system docker go go-prometheus golang prometheus go-checkout-system golang-checkout-system shopping-checkout-application

checkout-system's Introduction

Shopping Checkout Application

Technologies Used

  • Go
  • Docker
  • Grafana
  • Prometheus
  • Swagger
  • MongoDB

Functional Requirements

  1. Cart Management: Handle up to 10 unique items (excluding VasItems) and a total of 30 products. The total cart amount should not exceed 500,000 TL.
  2. Item Varieties: Support for different item types like VasItem, DefaultItem, DigitalItem, with specific constraints on quantity and identification.
  3. Digital Items: Restriction on the quantity and specific categorization (CategoryID 7889).
  4. Default Items: Common e-commerce products with pricing rules in relation to VasItems.
  5. VasItems: Represent value-added services, constrained by category and seller ID.
  6. Promotions: Implementation of various discount strategies like SameSellerPromotion, CategoryPromotion, and TotalPricePromotion.

Non-Functional Requirements

  1. Reliability: Robust error handling and consistent performance.
  2. Usability: Simple and intuitive http-request-based interaction.
  3. Maintainability: Code should adhere to SOLID principles, Domain Driven Design and be easy to modify or extend.
  4. Performance: Optimized for fast processing of cart operations.

Prerequisites

  • Go environment setup for development.
  • Docker installed for containerization (optional).
  • Grafana and Prometheus for monitoring and analytics (optional).

UML Class Diagram

UML Class Diagram

Usage

Running the Application

  • Direct Execution:

    • After building, you can run the application using:
      make run
      
    • This will start the application using the compiled binary.
  • Development Mode:

    • For development purposes, you can run the application directly with Go using:
      make dev
      
    • This allows you to run the application without compiling it first.
  • Docker:

    • To run the application in a Docker container, use:
      make up
      
    • This will build and run the application in a Docker container as defined in your docker-compose file.
    • To stop and remove the container, use:
      make down
      

Swagger Documentation

  • To generate Swagger documentation, run:
    make swag
    
  • This will create Swagger documentation based on your code annotations.

Testing

Running Tests

  • Persistence Tests:

    • To run persistence layer tests, execute:
      make persistance-tests
      
    • This will run tests located in the ./internal/infrastructure/persistence directory.
  • Application Tests:

    • For application layer tests, execute:
      make application-tests
      
    • This will run tests in the ./internal/application directory.

Swagger Page

Swagger

Grafana Page

Grafana

checkout-system's People

Contributors

furkan-gulsen avatar

Stargazers

 avatar Nejdet Kadir Bektaş avatar Zidan Omar Hamid avatar Mert Şişmanoğlu avatar Mehmet Doğru avatar

Watchers

 avatar

Forkers

mertssmnoglu

checkout-system's Issues

`nil dereference in dynamic method call` warnings on error handling

nil dereference in dynamic method call warnings on error handling

When I open the repo with VSCode it shows nil dereference in dynamic method call warnings under internal/interfaces/api/

Files and lines

cart_handler.go

category_handler.go

promotion_handler.go

Suggestion

Using specificError.Error() instead of err.Error() in mentioned files and lines.

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.