Giter Site home page Giter Site logo

nestjs-simple-referral's Introduction

NestJS Jumpstart

Description

The Problem: The company wants to implement a customer referral program, in order to acquire new paying customers. Here are the product requirements that we are given:

● When 5 people sign up using that referral, the inviter gets $10.
● When somebody signs up referencing a referral, that person gets $10 on signup.
Signups that do not reference referrals do not get any credit.
● Multiple inviters may invite the same person. Only one inviter can earn credit for a
particular user signup. An inviter only gets credit when somebody they invited signs up; they do not get credit if they invite somebody who already has an account.

Use cases:

She emails that link to 5 of her friends.
● Bob, one of Alice’s friends, clicks on the link. He goes through the signup process to
create a new account. Once he has created his account, he sees that he has $10 in
credit.
● Four more people follow the same process as Bob, clicking on the link Alice sent them.
They all get $10 in credit. Once the fifth person has signed up, Alice sees that she has
$10 in credit.
● Jeffrey signs up using a link that does not contain a unique referral code. After he
creates a new account, he has $0 in credit.

You can check live swagger ui here: (https://nestjs-referral-staging.herokuapp.com/api)

Installation

$ yarn install

Database configuration

Install postgres latest version. Copy .env.example -> .env and config database variables.

$ yarn migration:run

Running the app

# development
$ yarn start

# watch mode
$ yarn start:dev

# production mode
$ yarn start:prod

Open browser and visit localhost:8080/api.

Test

# unit tests
$ yarn test

# e2e tests
$ yarn test:e2e

# test coverage
$ yarn test:cov

nestjs-simple-referral's People

Contributors

leadstar116 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.