Giter VIP home page Giter VIP logo

tq-be-20180728's Introduction

Location Base With Rails Backend API

Rails 5.0 API example application that provides user with authentication, check-in, finding venue, and other users who are checked in. The application uses:

  • FourSquare API for finding venues
  • JWT for management and authentication
  • Unplugg API for time-series prediction
  • Ruby on Rails for back-end framework

What Is Implemented

This backend API provides:

  • Create user account
  • Provide authentication for users
  • List venues new user current location
  • Check in user to venue
  • Provide popular venue locatioin
  • List other checked in users
  • Provide recomended venue

Dependencies

Before genearting your application, you will need:

  • The Ruby language - version 2.3.5
  • The Rails gem - version 5.2.1

Getting Started

Gems

Main gems used by the application

  • JWT - provides module to decode and encode user payload
  • Dotenv-rails - helps hide important information that you do not want to expose to the public
  • Rspec-rails - for testing your application
  • Faraday - helps make HTTP calls easier and organize
  • Haversine - helps to calculate latitude and lo

Install the Required Gems

Install gem with command

  bundle install

Create Postegres Database

  rails db:create

Run database migration

  rails db:mirgate

Register for API keys

Register for FourSquare API development

  • Store client id key in .env file with key CLIENT_ID
  • Store client secret in .env file with key CLIENT_SECRET

Register for Unplugg API

  • Store the API key in .env file with key UNPLUG_SECRET
  • Store callback URL in .env file with key CALLBACK_WEBHOOK

API endpoints

Method Endpoint Header Example
POST /login Login User http://yourURL.com/login
POST /users Create User http://yourURL.com/users
GET /users/:id/venue_list Get user a venue http://yourURL.com/users/:id/venue_list
POST /users/:id/user_list Get user around venue http://yourURL.com/users/:id/user_list
GET /users/:id/recommend_venue Return a recommended venue for user http://yourURL.com/users/:id/recommend_venue
POST /users/:id/checkins Check into venue http://yourURL.com/users/:id/checkins

tq-be-20180728's People

Contributors

rghuynh avatar hotson405 avatar

Watchers

James Cloos 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.