Giter VIP home page Giter VIP logo

karpul_server's Introduction

Karpul_server

API endspoints


All requests and responses are in JSON format.

Action Path
Users https://karpul-server.herokuapp.com/api/users
Authentication https://karpul-server.herokuapp.com/api/auth
Carpools https://karpul-server.herokuapp.com/api/carpools
Find Carpools https://karpul-server.herokuapp.com/api/findCarpool
Image Upload https://karpul-server.herokuapp.com/api/profilePic

Users

POST request to endpoint / is for creating user documents. It accepts the following request body,

{
  username,
  password,
  firstName, 
  lastName,
  phone
}

username will be rejected if it is not a unique email. Once a user document is successfully created, this will be the server's response.

{
  id,
  username,
  firstName,
  lastName,
  phone,
  city,
  state,
  bio,
  profilePicUrl
}

profilePic is an object for storing a user's profile picture on Cloudinary's server.

POST request to endpoint /userData settings will modify some of a user's info. It accepts the following request body,

{
  id,
  bio,
  phone,
  state,
  city
}

POST request to endpoint /:id settings will modify the user's profile pic url. It accepts the following request body,

{
  profilePicUrl
}

Authentication

POST to /login endpoint for creation of JWT. It accepts the following request body,

{
  username,
  password
}

This endpoint takes in the username and verifies the password. When validated, the server will respond with a token,

{
  authToken
}

POST to /refresh will send back another token with a newer expiriation. No request body is necessary as an existing and valid JWT must be provided to access this endpoint.

Carpools

POST request to endpoint / is for creating carpools. It accepts the following request body,

{
  carpoolTitle, 
  startAddress, 
  endAddress, 
  arrivalTime, 
  openSeats, 
  details, 
  days
}

Once a carpool document is successfully created, this will be the server's response.

{
  id,
  carpoolTitle, 
  startAddress, 
  endAddress, 
  arrivalTime, 
  openSeats,
  host,
  details, 
  days,
  users,
  pendingRequests
  
}

DELETE request to / will delete a carpool document. It accepts the following request body.

{
  carpoolId
}

The server will respond with status 204 whether or not the account exists.

Find Carpools

GET request to endpoint '/' is for finding nearby carpools. It accepts the following request query,

{
  address,
  days,
  from,
  to,
  radius
}

The server will respond with an array or carpool documents.

karpul_server's People

Contributors

sumanbandita15 avatar manny1806 avatar lereiver avatar gyuhankim avatar

Watchers

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