Giter Site home page Giter Site logo

dm-rest-api's Introduction

REST API to store user rating

Description

It is a simple REST API to create key-val stored that serves as user rating example.

Prerequisites

Following package and library have to install into your machine to run this app

  • Helm
  • Docker
  • docker-compose

Usage

This repository contains two part:

  1. The service source code (stored in service)
  2. A Helm chart with the required services to help you deploy the application on Kubernetes Cluster (in chart)

Service part:

This directory contains the Makefile that contains some important step to help with the dev and build of the service that follows (gazr)[https://gazr.io/] guidelines.

To start dev and watch you can use :

make watch

Note: In this part we leverage docker-compose to setup our dev environement and run the required services to startup our application.

To build :

make build

Push the latest image to the registry:

make push

To run test:

make test

API Usage

After running the app you can use curl to test out the app. The API has total 4 endpoints

  1. GET /ratings/ (Get all the values of the store)
  • response: {user1: rating1, user2: rating2, user3: rating3...}
  1. GET /ratings/user1/ (Get one the rating of te specific user)
  • response: {value: rating1}
  1. POST /ratings/
  • request: {user1: rating1, user2: rating2, user3: rating3..}
  • response: Successfully store the values
  1. PUT /values
  • request: {user1: rating1, user2: rating2, user3: rating3..}
  • response: Successfully updated the values

Helm Chart

This service depends on Redis as datastore so it has a dependecy with Bitname Helm chart.

To deploy :

helm install --namespace=<custom-ns> rating chart

dm-rest-api's People

Contributors

mrmm avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.