Git Product home page Git Product logo

go-orders-service's Introduction

Orders Service

Prerequisites

Before running this project, ensure that the following dependencies are installed:

Setup and Running the Project

  1. Environment Configuration:

    • The project already includes a .env file with the default env modify then if they dont work for you
  2. Start Docker Services:

    • Ensure all required Docker services are up and running by executing:
      docker compose up -d
  3. Start the Application:

    • Run the project using the following Go command:
      go run cmd/ordersystem/main.go cmd/ordersystem/wire_gen.go

Tip: The project includes php my admin access on http://localhost:8080/

Testing the Project

REST API Endpoints

  • Base URL: http://localhost:8000
  • Available Endpoints:
    • Create Order: POST /orders/create
    • List Orders: GET /orders/list
    • Get Order by ID: GET /orders/{id}

Tip: You can find example HTTP requests in the api/orders.http file.

GraphQL

  • Base URL: http://localhost:8081
  • Access the GraphQL playground by visiting localhost:8081.
  • For further customization, the GraphQL server port can be changed via the GRAPHQL_SERVER_PORT environment variable.

gRPC

To test the gRPC services, use Evans with reflection support enabled. Run the following command:

evans -r repl

Note: Ensure Evans is installed on your system.

Code Generation

If you make any changes to the dependencies, be sure to regenerate the Wire dependency injection code with:

wire gen ./cmd/ordersystem

This version is more polished and organized, making it easier to understand and follow.

go-orders-service's People

Contributors

drawiin avatar

Watchers

 avatar

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.