Coder Social home page Coder Social logo

devbook's Introduction

DevBook Documentation

Setup

Requires Homestead/Vagrant

  • Run composer install
  • Run vagrant up
  • Run vagrant ssh
  • Run mysql -u homestead -p
  • Enter password (secret)
  • Run CREATE DATABASE devbook
  • Run exit
  • Run php artisan migrate

I have included devbook.postman_collection.json in the repo to provide examples of the API requests. These are the examples I used to test the API

Create a profile

Method: POST

URL: devbook.local/api/users

Available fields: (*required)

  • `email *
  • first_name *
  • surname
  • dob (minimum age 18) *
  • national_insurance_no
  • profile_image (URL)
  • full_address
  • bio

You will receive a token when your profile is created. Keep a note of this.

Show a profile

Method: GET

URLs:

  • devbook.local/api/users/me - Returns your profile
  • devbook.local/api/users/{id} - Returns profile with matching ID
  • devbook.local/api/users/{email} - Returns profile with matching email

Requires token adding to request header.

If the profile being returned is not yours, sensitive information will be omitted from the returned data.

Update your profile

Method: PATCH

URL: devbook.local/api/users/me

Requires token adding to request header.

You can update any field except for email, dob and national_insurance_no. If you attempt to edit these fields, the request will fail.

Delete your profile

Method: DELETE

URL: devbook.local/api/users/me

Requires token adding to request header.

Will instantly force delete your profile (not soft delete)

Search profiles based on keywords in bio

Method: GET

URL: devbook.local/api/users?search=add,search,terms,comma,separated

Requires token adding to request header.

Will return profiles where the users bio contains at least 1 of the search terms

devbook's People

Contributors

breakwell92 avatar

Watchers

 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.