Giter Club home page Giter Club logo

wilddonut-sever's Introduction

WildDonut-Sever


API Endpoints

students:

* GET: api/users/students/:username - (get particular student)

teachers:

* GET: api/users/teachers - (get all teachers)
* GET: api/users/teachers/:username - (get particular teacher)

users:

* POST: api/users/ - (creates user)
* POST: api/users/login - (authenticates user)
* POST: api/users/:username - (updates user)

bookings:

* GET: api/bookings/students/:username - (get all bookings for a particular student)
* GET: api/bookings/teachers/:username - (get all bookings for a particular teacher)
* POST: api/bookings - (create booking for student and teacher)

example curl commands

user

### signup
curl --data "username=linda&&password=nycccccc" http://localhost:4568/api/users/signup

### login
curl --data "username=linda&&password=nycccccc" http://localhost:4568/api/users/login

### update user
curl --data "username=linda&&firstName=Fred&&lastName=Tee&&location=Walmart&&picture=jj.jpg&&bio=boss&&teacher=true&&experience=none&&skill=singing&&payments=beer" http://localhost:4568/api/users/linda

students

### get specific student
curl http://localhost:4568/api/users/students/linda

teachers

### get all teachers
curl http://localhost:4568/api/users/teachers

### get specific teacher
curl http://localhost:4568/api/users/teachers/tony

bookings

### get student's bookings
curl http://localhost:4568/api/bookings/students/jude

### get teacher's bookings
curl http://localhost:4568/api/bookings/students/tony

### create booking user
curl --data "teacherUsername=tony&&studentUsername=linda" http://localhost:4568/api/bookings

Updated API

cURL for API testing

Authentication

  • api/users/login POST - Returns the user object after authentication
  • api/users/signup POST - Returns the user object after creating a new user in the database

Student / Teacher Profile Settings

  • /api/users/:username POST - Updates a user's information (teacher and student)
  • /api/users/:username GET - Returns a data object for a user (teacher and student)

Student

  • /api/users/:username/student/classes/booked GET - Returns all classes a student has booked
  • /api/users/:username/student/classes/booked POST - Student clicks “book” on a class

Teacher

  • /api/users/:username/teacher/classes GET - Returns array of classes objects for teacher
  • /api/users/:username/teacher/classes/booked GET - Returns all booked classes
  • /api/users/:username/teacher/classes/available GET - Returns all classes w/ no signups
  • /api/users/:username/teacher/classes/ POST - Teacher creates a new class
  • /api/users/:username/teacher/classes/:id POST - Teacher update / modify an existing class
  • /api/users/:username/teacher/classes/:id DELETE - Teacher can they delete the class
  • /api/users/:username/teacher/classes/:id GET - Returns object with details of a specific class

Browse

  • /api/classes GET - Returns an array of class objects for all classes that are available

wilddonut-sever's People

Contributors

rjatkinson2 avatar devmeyster avatar kyleaowen avatar miketdonahue 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.