Giter VIP home page Giter VIP logo

rails-referrals-vin's Introduction

Rails Referrals

A simple referral system built on Rails

User can share there referral link or send a referral email and track count of total successful referals and there names.

Current API URL: https://rails-referrals.herokuapp.com/api/

Built With

  • Ruby on Rails

Getting Started

Prerequisites

  • Ruby
  • Postgres server

Setup

Clone this repo and enter the directory.

git clone [email protected]:eapenzacharias/rails-referrals.git && cd rails-referrals

Install

Run the following command to install all the dependencies.

bundle install

Usage

Run the following command to start the server, then go to http://localhost:3000

rails db:create # create database
rails db:migrate # migrate tables
rails s # to start the server

API REQUEST EXAMPLES

Sign Up

URL without referral: http://domain.com/api/auth
URL with referral: http://website.com/api/auth/?referrer={User ID of the referrer}
Method: POST

Request example:
{ 
   "email": "[email protected]",
   "password": "password",
   "password_confirmation": "password",
   "name": "User"
}

Sign In

URL: http://domain.com/api/auth/sign_in
Method: POST

Request example:
{
   "email": "[email protected]",
   "password": "password"
}

Authentication headers example for all further queries

"access-token": "wwwww",
"token-type":   "Bearer",
"client":       "xxxxx",
"expiry":       "yyyyy",
"uid":          "zzzzz"

Sign Out

URL: http://domain.com/api/auth/sign_out
Method: DELETE

Referrals of current_user

URL: http://domain.com/api/referrals
Method: GET

Current_user referred by

URL: http://domain.com/api/referred_by
Method: GET

Send invite email

URL: http://domain.com/api/send_invite
Method: POST

Request example:
{
   "email": "[email protected]"
}

Author

Authors

๐Ÿ‘ค Eapen Zacharias

Show your support

Give a โญ๏ธ if you like this project!

rails-referrals-vin's People

Contributors

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