Code Monkey home page Code Monkey logo

library's Introduction

Create

Dependencies

PHP >= 7.1.3
OpenSSL PHP Extension
PDO PHP Extension
Mbstring PHP Extension
Tokenizer PHP Extension
XML PHP Extension
Ctype PHP Extension
JSON PHP Extension
PostgreSQL

For create database

#!/bin/bash

DB="library"
USER="forex"
PASSWORD="password"

sudo -u postgres psql -c "REVOKE ALL PRIVILEGES ON ALL TABLES IN SCHEMA public FROM $USER;"
sudo -u postgres psql -c "REVOKE ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public FROM $USER;"
sudo -u postgres psql -c "REVOKE ALL PRIVILEGES ON ALL FUNCTIONS IN SCHEMA public FROM $USER;"
sudo -u postgres psql -c "DROP OWNED BY $USER;"
sudo -u postgres psql -c "DROP USER $USER;"
sudo -u postgres psql -c "DROP DATABASE $DB;"

sudo -u postgres createuser $USER
sudo -u postgres createdb $DB
sudo -u postgres psql -c "alter user $USER with encrypted password '$PASSWORD';"
sudo -u postgres psql -c "grant all privileges on database $DB to $USER;"

For install package dependences

cd /var/www
git clone https://github.com/kamaliev/library.git
cd library
composer install
./artisan migrate

Next

Configure your NGINX or Apache

API Routes

[cds] can be replaced to [books]

Create Book or Cd

POST api/v1/scan

Get top from authors

GET api/v1/cds/top/{limit}

Get cds between from and to years

GET api/v1/cds/between/{yearFrom}/{yearTo}

Get cds beafore year

GET api/v1/cds/before/{before}

Get cds after year

GET api/v1/cds/after/{after}

Get CDs albums average per years

GET api/v1/cds/author/average
GET api/v1/cds/author/average?author=Би-2

Get author albums

GET api/v1/cds/author?author=Би

Logs

cd /var/www/library/storage/logs/scanner.log

Test

cd /var/www/library
./vendor/bin/phpunit

library's People

Watchers

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