https://github.com/w-ptra/microservice_3service
A microservice system consisting 3 services: public-layer-service,user-service and listing-service. Build using Golang version 1.23.2,GORM as ORM,PostgreSQL as databases and Docker for containerization.
https://github.com/w-ptra/microservice_3service
docker docker-compose fiber golang gorm microservice postgresql
Last synced: 3 months ago
JSON representation
A microservice system consisting 3 services: public-layer-service,user-service and listing-service. Build using Golang version 1.23.2,GORM as ORM,PostgreSQL as databases and Docker for containerization.
- Host: GitHub
- URL: https://github.com/w-ptra/microservice_3service
- Owner: W-ptra
- Created: 2024-10-18T13:18:06.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-21T07:13:24.000Z (over 1 year ago)
- Last Synced: 2025-04-01T13:18:06.043Z (over 1 year ago)
- Topics: docker, docker-compose, fiber, golang, gorm, microservice, postgresql
- Language: Go
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microservice_3service
A microservice system consisting 3 services: ``public-layer-service``,``user-service`` and ``listing-service``. Build using ``Golang version 1.23.2``,``GORM`` as ORM,``PostgreSQL`` as databases and ``Docker`` for containerization.
# High Level Overview

# Prerequisite
1. Have ``Golang`` min ``version 1.23.2`` or higher installed on your device
2. Have ``Docker`` installed on your device
# Usage
1. clone this repository and cd to ``Microservice_3service``
```
git clone https://github.com/W-ptra/Microservice_3service.git
cd Microservice_3service
```
2. run following script to activate the ``docker-compose.yaml``
```
docker-compose up
```
3. Use browser/postman/curl to interact with api
```
GET http://127.0.0.1:8000/public-api/listing
or
GET http://127.0.0.1:8000/public-api/listing?userId=1&pageNum=2&pageSize=5
Parameters:
pageNum = int # Default = 1
pageSize = int # Default = 10
userId = str # Optional
POST http://127.0.0.1:8000/public-api/listing
headers:
Content-Type: application/json
Request body: (JSON body)
{ // example
"userId": 1,
"listingType": "rent", // either "rent" or "sale"
"price": 6000 // can't negative
}
POST http://127.0.0.1:8000/public-api/users
headers:
Content-Type: application/json
Request body: (JSON body)
{ // example
"name": "Lorel Ipsum"
}
```
4. To clean up run following script
```
docker-compose down
```