https://github.com/cloudboost/coupons
https://github.com/cloudboost/coupons
Last synced: 12 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/cloudboost/coupons
- Owner: CloudBoost
- Created: 2016-03-25T12:14:32.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2016-04-05T13:34:37.000Z (about 10 years ago)
- Last Synced: 2025-03-05T17:47:27.400Z (over 1 year ago)
- Language: JavaScript
- Size: 3.09 MB
- Stars: 2
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Coupons
Coupons is a nodejs-angular app powered by [cloudboost.io](https://www.cloudboost.io) for creating discount coupons
## Installation
Clone this project
```bash
$ git clone https://github.com/CloudBoost/Coupons.git
```
Install all dependencies
```bash
$ cd Coupons
$ npm install
```
This coupon uses cloudboost database service.
- Go to [cloudboost.io](htttps://dashboard.cloudboost.io)'s dashboard and create an app.
- Click on 'App Keys' Button

- 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
```javascript
CB.CloudApp.init('appId', 'appKey'); //replace appId and appKey with your app's appId and appKey
```
## Run
```bash
$ node server.js
```
[https://localhost:8000](https:localhost:8000)
## APIs
Generate a random string for coupon code
```javascript
$http.get("/generate/code"); //returns a string
```
Apply a Coupon
```javascript
$http.post("/apply", {"couponId":'ABCD234', "amount":1200}); //retruns total discount on 1500 for given coupon code.
```
Redeem a Coupon
```javascript
$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
```javascript
$http.post("/delete", {"couponId":'ABCD234'});
```
Get List of Coupon
```javascript
$http.post("/couponlist"); //returns list of coupons
```
## Screenshots

