Skip to content

rajkumar-palani/lendingservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

inventoryservice

Exposes a REST API for CRUD operations on Lending Service and supports persistence. Designed for containerized deployment and easy local development.

Features

  • CRUD operations for inventory items
  • Simple JSON REST API
  • Validation and error responses
  • Configurable data store (e.g., PostgreSQL)
  • K8s Friendly

Prerequisites

  • Git
  • K8s (optional for containerized runs)
  • A database such as PostgreSQL if not using in-memory store

Quickstart (local)

  1. Clone the repo:
    git clone <repo-url> lendingservice
    cd inventoryservice
  2. Configure the Database (see Configuration to update the Postgres DB).
    check under deploy folder: postgres-db.yaml
    sudo iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 30002 -j ACCEPT
    oc port-forward lendingdb-postgres-7b588d8896-thjm5 -n assignment 30002:5432 --address <<10.187.168.189>>
  • Run the script under "dbpreq" folder.
  1. Run the service (example for a generic runtime):
    # example: go run main.go
    # or create image using docker build. Refer Quick Start

Quickstart (Docker)

Build and run with Docker: Refer Docker File //:: Note: For local testing use below line in main.go router.Run("localhost:3002")

//:: For Docker uncomment the below line in main.go //router.Run(":3002")

docker build -t lendingservice .

kubectl create -f postgres-db.yaml
sudo iptables -I INPUT -p tcp -s 0.0.0.0/0 --dport 30002 -j ACCEPT
oc port-forward lendingdb-postgres-7b588d8896-thjm5 -n assignment 30002:5432 --address 192.168.1.5

Configuration

Common environment variables:

  • Fill the details in the dbConfig.yaml file

API (example)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors