Git Product home page Git Product logo

quizapi's Introduction

License: MIT

Laravel 5.4 based quiz system API

This repository contains a simple demo API built with Laravel.

Installation

  • Clone the repository with git clone
  • Copy .env.example file to .env and edit database credentials there
  • Run composer install
  • Run php artisan key:generate
  • That's it - people can register and take quizzes!

API Documentation

The API only has the following endpoint which is the /api/. The endpoint works with the HTTP verbs: POST, GET

POST HTTP Request
  • POST /login
  • INPUT:
email: [email protected]
password: awonusi11
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
    "status": "success",
    "user": {
        "id": 1,
        "name": "awonusi",
        "email": "[email protected]",
        "api_token": "2qi8yfZjFUHJVZ4VtDRXjEdDNexX6B5OY4peN9u5nN4fR5k8sL",
        "created_at": "2018-01-31 12:03:17",
        "updated_at": "2018-01-31 14:39:45",
        "image": "null"
    }
}
POST HTTP Request
  • POST /register
  • INPUT:
name: awonusi1
email: [email protected]
password: awonusi11
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
    "status": "success",
    "user": {
        "name": "awonusi1",
        "email": "[email protected]",
        "api_token": "fCb6MJLBLX7UwLDCPh963jjEp6FItLFFohvCUaxL19EueXcDMW",
        "updated_at": "2018-01-31 14:41:50",
        "created_at": "2018-01-31 14:41:50",
        "id": 2
    }
}
GET HTTP Request
  • GET /logout
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
    "status": "success",
    "message": "You are now logged out"
}
POST HTTP Request
  • POST /profile
  • INPUT:
email: [email protected]
image: image/adsadzfdsf.jpg
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
    "status": "success",
    "message": "Profile Pix Success"
}
GET HTTP Request
  • GET /allquestions
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
    "status": "success",
    "questions": [
        {
            "id": 1,
            "body": "Who is the President of Nigeria",
            "answer": "Buhari",
            "option1": "buhari",
            "option2": "yaradua",
            "option3": "obasanjo"
        },
        {
            "id": 2,
            "body": "Nigeria flag",
            "answer": "green white green",
            "option1": "green white green",
            "option2": "yellow white yellow",
            "option3": "red white red"
        }
    ]
}
POST HTTP Request
  • POST /result
  • INPUT:
user_id: 1
result: 50
HTTP Response
  • HTTP Status: 201: created
  • JSON data
{
    "status": "success",
    "message": "Result stored"
}

License

Basically, feel free to use and re-use any way you want.

Author

Awonusi Olajide - Software Developer at Instantpickup

quizapi's People

Contributors

zenithcoder avatar

Stargazers

Lucky Onagite avatar  avatar

Watchers

James Cloos avatar

Forkers

shirokun20

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.