Skip to content

Latest commit

Β 

History

History
128 lines (91 loc) Β· 3.93 KB

README.md

File metadata and controls

128 lines (91 loc) Β· 3.93 KB

CustomerService: Microservice Connected to Cerebro API Gateway

CustomerService is a microservice written in Golang, designed to be connected to the Cerebro API Gateway. It provides specific functionalities and services to the overall system.

Features

  • Specific functionalities for customer-related operations
  • Integration with Cerebro API Gateway via gRPC connections
  • Scalable architecture for handling customer-related requests

Structure

customerService/
    β”œβ”€β”€ api/
    β”‚    └── core/
    β”‚         └── grpc/
    β”œβ”€β”€ cmd/
    β”‚    └── main.go
    β”œβ”€β”€ internal/
    β”‚    β”œβ”€β”€ config/
    β”‚    β”œβ”€β”€ handler/
    β”‚    β”œβ”€β”€ model/
    β”‚    β”œβ”€β”€ repository/
    β”‚    β”œβ”€β”€ validator/
    β”‚    └── log/
    β”œβ”€β”€ pkg/
    β”‚    └── utils/
    β”œβ”€β”€ scripts/
    β”œβ”€β”€ .dockerignore
    β”œβ”€β”€ config.json
    β”œβ”€β”€ go.mod
    β”œβ”€β”€ go.sum
    β”œβ”€β”€ README.md
    └── Dockerfile
  • api/: Contains API-related code.

    • core/: Core functionality of the API.
      • grpc/: gRPC related code.
  • cmd/: Main application entry point.

    • main.go: Main entry point for the application.
  • internal/: Internal package containing application-specific code.

    • config/: Configuration related code.
    • handler/: Request handler functions.
    • model/: Data models used by the application.
    • repository/: Data access layer for interacting with databases.
    • validator/: Validation logic for incoming requests.
    • log/: Logging functionality.
  • pkg/: Package directory containing reusable code.

    • utils/: Utility functions and libraries.
  • scripts/: Directory containing scripts for building, testing, and running the application.

  • .dockerignore: File specifying paths to exclude when building Docker images.

  • config.json: Configuration file for the application.

  • go.mod, go.sum: Go module files specifying dependencies for the project.

  • README.md: Markdown file containing project information and instructions.

  • Dockerfile: File used to build a Docker image for the project.

Usage

The project can be built and run using Docker containers. Follow the instructions provided in the README.md file to build and run the application.

Feel free to reach out if you have any questions or need further assistance!

Frameworks & Libraries

The project relies on the following frameworks and libraries:

Usage

Building Docker Images

To build the Docker images for CustomerService, follow these steps:

  1. Clone the CustomerService repository:
  git clone https://github.com/HouseCham/customerService.git
  1. Navigate to the project directory:
cd customerService
  1. Build the docker image using the provided Dockerfile:
docker build -t customer-service:[version] .

Running Docker Containers

Once you have built the Docker image, you can run containers for CustomerService using the following commands:

sudo docker run -d \
--name customer-service \
-p [host_port]:[container_port] \
-it \
--restart unless-stopped \
customer-service:[version]

Replace [host_port] and [container_port] with the desired port mapping. Remember to adjust the configuration within the config.json file accordingly.

Interacting with the Running Container

If you choose to run the container interactively (-it tag), you can interact with the container's CLI. Upon successful startup, you'll see log messages indicating the server is running.