Before running this project, ensure that the following dependencies are installed:
-
Environment Configuration:
- The project already includes a
.env
file with the default env modify then if they dont work for you
- The project already includes a
-
Start Docker Services:
- Ensure all required Docker services are up and running by executing:
docker compose up -d
- Ensure all required Docker services are up and running by executing:
-
Start the Application:
- Run the project using the following Go command:
go run cmd/ordersystem/main.go cmd/ordersystem/wire_gen.go
- Run the project using the following Go command:
Tip: The project includes php my admin access on http://localhost:8080/
- Base URL:
http://localhost:8000
- Available Endpoints:
- Create Order:
POST /orders/create
- List Orders:
GET /orders/list
- Get Order by ID:
GET /orders/{id}
- Create Order:
Tip: You can find example HTTP requests in the
api/orders.http
file.
- 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.
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.
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.