Giter Club home page Giter Club logo

bookmarks's Introduction

Bookmarks

For admin:

Run project:

  1. composer install

  2. php bin/console doctrine:database:create

  3. php bin/console doctrine:schema:create

  4. php bin/console hautelook_alice:doctrine:fixtures:load

  5. php bin/console server:run (local php server on http://127.0.0.1:8000)

  6. configuration for apache or nginx see http://symfony.com/doc/current/cookbook/configuration/web_server_configuration.html

PhpUnit:

  1. php bin/console doctrine:database:create --env=test

  2. php bin/console doctrine:schema:create --env=test

  3. php bin/console hautelook_alice:doctrine:fixtures:load --env=test

  4. ./vendor/bin/phpunit

Analysis Tools:

  1. PHP_CodeSniffer: ./vendor/bin/phpcs --standard=psr2 src

  2. PHP Mess Detector: ./vendor/bin/phpmd src text cleancode,codesize,controversial,design,unusedcode

  3. PHP Copy/Paste Detector: ./vendor/bin/phpcpd src

For frontend developer:

Get 10 latest bookmarks:

Example:

GET /bookmark

Response:

[
    {
        "uid": 1,
        "createdAt": "2016-06-16T15:37:31+03:00",
        "url": "http://google.com",
        "comments": []
    },
    {
        "uid": 2,
        "createdAt": "2016-06-15T23:39:26+03:00",
        "url": "http://www.howe.com/culpa-rem-aut-rerum-exercitationem-est-rem",
        "comments": [
            {
                "uid": 1,
                "createdAt": "2016-06-14T07:13:44+03:00",
                "ip": "218.230.103.77",
                "text": "Similique ad sed architecto quod nulla. Voluptas quibusdam inventore esse harum accusantium rerum nulla.",
                "bookmark": 2,
                "changeableAndDeletable": false
            },
        ...
	},
	...
]

Get bookmark by url:

Format:

GET /bookmark/{url}

Example:

GET /bookmark/http://google.com

Response:

{
    "uid": 1,
    "createdAt": "2016-06-16T14:43:20+03:00",
    "url": "http://google.com",
    "comments": [
        {
            "uid": 1,
            "createdAt": "2016-06-14T07:13:44+03:00",
            "ip": "218.230.103.77",
            "text": "Similique ad sed architecto quod nulla. Voluptas quibusdam inventore esse harum accusantium rerum nulla.",
            "bookmark": 1,
            "changeableAndDeletable": false
        },
        ...
    ]
}

Create bookmark:

Example:

POST /bookmark

{"url": "http://google.com"}

Response:

{
    "uid": 1
}

Create comment for bookmark:

Format:

POST /bookmark/{uid}/comment

{"text": "comment text"}

Example:

POST /bookmark/1/comment

{"text": "comment text"}

Response:

{
    "uid": 1
}

Update comment:

Format:

PUT /comment/{uid}

{"text": "comment text"}

Example:

POST /comment/1

{"text": "comment text"}

Response:

{
    "uid": 1
}

Delete comment:

Format:

DELETE /comment/{uid}

Example:

DELETE /comment/1

bookmarks's People

Contributors

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