Skip to content

kleopatra999/Coupons

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Coupons

Coupons is a nodejs-angular app powered by cloudboost.io for creating discount coupons

Installation

Clone this project

$ git clone https://github.com/CloudBoost/Coupons.git

Install all dependencies

$ cd Coupons
$ npm install

This coupon uses cloudboost database service.

  • Go to cloudboost.io's dashboard and create an app.
  • Click on 'App Keys' Button

AppId and AppKey

  • Go to 'Manage App'.
  • Create a table 'Coupon'

Table Schema

  • code - textdescription - text
  • percentage - boolean
  • amount - number
  • limit - number
  • validFrom - DateTime
  • validUntil - DateTime
  • redemCount - number
CB.CloudApp.init('appId', 'appKey'); //replace appId and appKey with your app's appId and appKey

Run

$ node server.js

https://localhost:8000

APIs

Generate a random string for coupon code

$http.get("/generate/code"); //returns a string

Apply a Coupon

$http.post("/apply", {"couponId":'ABCD234', "amount":1200}); //retruns total discount on 1500 for given coupon code.

Redeem a Coupon

$http.post("/redeem", {"couponId":'ABCD234', "amount":1200}); //retruns total discount on 1500 for given coupon code and also increase value of redeem count.

Delete a Coupon

$http.post("/delete", {"couponId":'ABCD234'});

Get List of Coupon

$http.post("/couponlist"); //returns list of coupons

Screenshots

List of coupons Creating coupons

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 61.5%
  • HTML 33.6%
  • CSS 4.9%