Skip to content

Latest commit

 

History

History

data-management-service

Data Management service

data management service for dhammanva search system

This service use to store managed data

CI/CD :

deploy data service deploy data db

Run locally

Prerequisite

  1. Install golang
  2. Install docker / make
  3. Start data management db
cd <your-path>/<project-root(where docker compose is)>
docker compose -f docker-compose.dev.yml up -d data-db
  1. Copy raw data then create datasource directory and paste the file

Steps

There are 3 ways to run the service

  1. Using golang (Recommend for isolate service development)
    cd <your-path>/data-management-service
    go mod tidy
    go mod vendor
    go run mock/isolate.go 
  2. Using docker - uncomment every line in Dockerfile - Navigate to root directory - Run
    docker compose -f docker-compose.dev.yml up --build -d data-service 
  3. Using make (spin up all dependencies service) (recommend for final testing / testing with another services) - Install make - run
     cd <your-path>/patipada-search
    make up_build_data

Test

  • to run all test cases
go test -v ./...
  • integration test
go test -v ./tests
  • unit tests are inside each layer

API Reference

Postman documentation : link

Tech stack

Language : Golang Web Server : Gin Database: Mongo DB

Project structure

This service imply clean architecture

.
├── communication           # gRPC client setup
├── proto                   # GRPC
    ├── auth_proto 
    ├── search_proto 
├── config
├── database
├── mock                    # mock external services
├── errors                  # Custom errors
├── messages                # Response Message
├── server
├── it                      # integration testing
├── structValidator         # validator
├── request
    ├── handlers
    ├── entities
    ├── usecases
    ├── repositories
    ├── models
    ├── helper
├── app.env                 # default env file
├── go.mod
├── go.sum
├── main.go
├── Dockerfile              # Docker file use to build docker image
└── README.md