Coder Social home page Coder Social logo

steep's Introduction

Steep

Contributors

Description

Steep is Ruby on Rails API-only backend that allows a user (customer) to subscribe to different varieties of teas.

This may implement the Tea API.

Versioning

  • Ruby version: 2.5.3
  • Rails version: 5.2.6

Setup

Clone the app using the "Code" button above to download it to your machine. After you've done this, you can use bundle install and rails db:setup in your terminal/shell to set up the app locally.

Testing

Testing is provided using RSpec. Test status can be checked by running bundle exec rspec in your terminal/shell once you've followed the setup above.

Endpoints

POST '/api/v1/subscribe'
  • This provides a way for a customer to subscribe to a variety of tea.
  • This can also reactivate a subscription for a previously-unsubscribed tea.
  • This requires "customer_id" and "tea_id" query params.
POST '/api/v1/unsubscribe'
  • This provides a way for a customer to unsubscribe from a variety of tea.
  • This requires "customer_id" and "tea_id" query params.
  • This responds with "null" if there is no active subscription for that customer and tea data set.
GET '/api/v1/subscriptions'
  • This provides a way to see all of a customer's subscriptions, active and inactive.
  • This requires "customer_id" query param.

steep's People

Contributors

hopesgit avatar

Watchers

 avatar

steep's Issues

Interact with TeaAPI

[ ] Include Faraday gem
[ ] Set up Faraday to call Tea API
[ ] Get API Key if required
[ ] Create Tea API class
[ ] Test it all (as you go)

set up endpoint to subscribe a customer to a tea subscription

Endpoint: POST /api/v1/unsubscribe
Requires: customer_id, tea_id
[ ] Create tests for endpoint
[ ] Build endpoint
[ ] Ensure that endpoint creates a Subscriptions item that belongs to a customer and a tea OR activates the subscription if it's inactive

Set up Tables

Tables:

Customers:

  • first_name (string)
  • last_name (string)
  • email (string) (unique)
  • address (string)

Teas:

  • title (string)
  • description (string)
  • brew_time (integer / minutes)
  • api_id (string) (unique)

Subscriptions:

  • tea_id
  • customer_id
  • status (int, refers to active(0) or inactive(1))
  • has and belongs to many users AND teas

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.