GithubHelp home page GithubHelp logo

doorslice-backend's Introduction

DoorSlice-Backend

Coded June/July 2016.

Demo: https://vimeo.com/188041261

DoorSlice was a collaborative project with https://github.com/Anteloper that allowed users to order pizza with a single tap. The front end iOS source code is available at https://github.com/Anteloper/DoorSlice.

The backend is a RESTful API implemented in nodejs using express. The application uses four models/controllers: users, orders, cards (user's credit card information), and addresses. API responses are JSON.

Endpoints

User:

URL HTTP Request Description Request Requirements
/users POST creates a new user phone, password, school
/users/login POST Creates JWT for user and sends as response phone, password
/users/addEmail/:user_id POST adds email to user's profile email
/users/wantsReceipts/:user_id POST toggles user's receipt preference wantsReceipts
/users/wantsConfirmation/:user_id POST toggles user's order confirmation preference wantsConfirmation
/users/hasSeenTutorial/:user_id POST marks if user has seen app tutorial hasSeenTutorial
/users/:user_id GET returns user's profile

Order:

URL HTTP Request Description Request Requirements
/orders/:user_id/:address_id POST creates new order cheese, pepperoni, price, cardUsed
/rateOrder/:user_id POST creates new order review stars, review

Card ("payment"):

URL HTTP Request Description Request Requirements
/payments/newStripeUser/:user_id POST creates a new Stripe profile for indicated user stripeToken, lastFour
/payments/newStripeCard/:user_id POST adds new credit card to user's Stripe profile stripeToken, lastFour
/payments/updateDefaultCard/:user_id POST updates user's default Stripe credit card cardID
/payments/removeCard/:user_id POST removes credit card from user's Stripe profile cardID
/payments/charge/:user_id POST charges user's Stripe profile chargeAmount, chargeDescription, stripeToken

Address:

URL HTTP Request Description Request Requirements
/address/:user_id POST add a new address to user's profile school, dorm, room
/address/dorms/:user_id GET returns list of dorms for user's school
/address/:user_id/:address_id DELETE deletes address from user's profile

Misc:

URL HTTP Request Description Request Requirements
/sendCode POST texts a verification code to user's indicated phone number phone
/sendPassCode POST texts a verification code for a user resetting their password phone
/resetPass POST changes user's password if verification code matches phone, code, password
/isOpen/:user_id GET returns JSON indicating whether DoorSlice is open or closed
/sendOpenText POST triggers a text to users when delivery is open
/prices GET returns JSON with cheese and pepperoni prices

doorslice-backend's People

Contributors

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