Sample application to bookmark links, where interface build with Angular.js + Twitter Bootstrap and server powered by PHP with Slim Framework

Overview

RESTful Bookmarks PHP Slim

TODO:

  • review and update FrontEnd

Sample application to bookmark links, where interface build with Angular.js + Twitter Bootstrap and server powered by PHP with Slim Framework, serving JSON by REST URLs.

Install Guide

Clone

$ git clone https://github.com/erkobridee/restful-bookmarks-phpslim.git
$ cd restful-bookmarks-phpslim/

Create Mysql Database

$ mysql -u DBUSERNAME -p MYSQLPASSWORD -e 'CREATE DATABASE bookmarks;'
$ mysql -u DBUSERNAME -p MYSQLPASSWORD bookmarks < bookmarks.sql

Mysql connections

edit user DBUSERNAME and MYSQLPASSWORD in api/dao/BookmarkDAO.php

setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); return $dbh; } ...">
...
  private function getDBConn()
  {
    $dbhost="127.0.0.1";
    $dbuser="DBUSERNAME";
    $dbpass="MYSQLPASSWORD";
    $dbname="bookmarks";
    $dbh = new PDO("mysql:host=$dbhost;dbname=$dbname", $dbuser, $dbpass);
    $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    return $dbh;
  }
...

XAMPP

  • Put project structure inside XAMPP /htdocs directory

Nginx example configuration

server {
  listen 127.0.0.1:80;
  access_log /var/www/restful-bookmarks-phpslim/log/access.log;
  error_log /var/www/restful-bookmarks-phpslim/log/error.log warn;

  server_name restful-bookmarks-phpslim;
  root   /var/www/restful-bookmarks-phpslim/public/;

  index  index.php index.html index.htm;
  try_files $uri $uri/ /index.php?$request_uri;

  location /rest/ {
    try_files /rest/$uri $uri/ /rest/index.php?$request_uri;
    fastcgi_pass 127.0.0.1:9000;
    fastcgi_split_path_info ^/rest/(.+\.php)(/.+)$;
    fastcgi_intercept_errors on;
    fastcgi_index  index.php;
    include fastcgi_params;
  }
}

Development with Sublime Text

  1. On Sublime Text, in menu: File > Open... select project directory location in you computer

  2. And happy coding :)

License

MIT : http://erkobridee.mit-license.org

Project build with

Helpful posts

Project REST URLs

HTTP Verbs

Project Structure

restful-bookmarks-phpslim/
  rest/
    dao/
      BookmarkDAO.php
    Slim/
      # Slim Framework files
    .htacess    # URLs map for Apache (XAMPP)
    index.php   # slim routes config
  app/
    # application files
  shared/
    # shared files with any future project
  vendor/
    # libs
  index.html
  require.config.js # require.js app config file
You might also like...
An easy-to-use web interface for downloading bittorrents, videos from twitter, youtube and the likes
An easy-to-use web interface for downloading bittorrents, videos from twitter, youtube and the likes

An easy-to-use web interface for Aria2 and youtube-dl Search for torrents within the app from mutiple BT sites Control Aria2 and manage download tasks

Twitter Bootstrap base theme for Magento

Magento Bootstrap This is an adaption of the Twitter Bootstrap framework for the Magento Commerce system. PLEASE NOTE THIS IS A WORK IN PROGRESS Insta

HTML5 Twitter Bootstrap 3.1 Magento Boilerplate Template

Magento Boilerplate A HTML5 Twitter Bootstrap 3.1 Magento 1.8 Boilerplate Template Read the blog post or checkout the demo for more information. Insta

Sample Web Application in Laravel with tailwind css

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

A research raw data repository for researchers of Arba Minch University built using Codeigniter which follows MVC architecture. The front-end is build using Bootstrap.

Arba Minch University Dataset Repository This system is a research dataset repository for Arba Minch University researchers and is build using Codeign

Buy and sell crypto top 100 crypto with our fake currency. Donate to and use our referal links for discounts

PLEASE ENABLE SQLITE3 AND GD OR GD2 IN XAMPP TO RUN THE APP! (SEE HOW_TO_SETUP_XAMPP.gif) ![alt text](https://github.com/Tby23rd/Project1-Cryptosimul

A sample project to showcase a real world example and benchmarks for crowphp

CrowPHP Sample project This project is to showcase an example of how a real world project might look like. It has two basic endpoints to show-case the

A highly compressed version of the magento 1.9 sample data and a script to create it.

Compressed Magento 1.9 Sample Data The following variations are available: 65M compressed-magento-sample-data-1.9.2.4.tgz 64M compressed-magento-sampl

Sample code for several design patterns in PHP 8

DesignPatternsPHP Read the Docs of DesignPatternsPHP or Download as PDF/Epub This is a collection of known design patterns and some sample codes on ho

Comments
  • A little bug?

    A little bug?

    Hi Erko,

    I appreciate your github account. I was testing this app on Firefox(31), Chrome(last) and IE(11). For all, I caught these exceptions when the save button was clicked:

    Firefox:

    rror: JSON.parse: unexpected character at line 1 column 18 of the JSON data Tb@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:14:130 kd/this.defaults.transformResponse<@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:408 kc/<@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:192 p@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:7:253 kc@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:176 c@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:64:366 wd/e/k.promise.then/z@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:91:260 wd/f/<.then/<@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:92:407 xd/this.$get</g.prototype.$eval@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:100:317 xd/this.$get</g.prototype.$digest@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:98:202 xd/this.$get</g.prototype.$apply@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:101:155 g@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:67:162 Q@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:71:64 md/</t.onreadystatechange@http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:72:27

    Chrome:

    SyntaxError: Unexpected token S at Object.parse (native) at Tb (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:14:147) at e.defaults.transformResponse (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:433) at http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:194 at Array.forEach (native) at p (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:7:255) at kc (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:176) at c (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:64:371) at z (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:91:280) at http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:92:417

    IE:

    SyntaxError: Caractere inválido at Tb (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:14:130) at Anonymous function (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:431) at Anonymous function (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:192) at p (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:7:253) at kc (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:63:176) at c (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:64:352) at z (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:91:260) at Anonymous function (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:92:407) at g.prototype.$eval (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:100:317) at g.prototype.$digest (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:98:202) TypeError: Não é possível obter a propriedade 'method' de referência indefinida ou nula at isCached (http://localhost/restful-bookmarks-phpslim-master/shared/components/progressbar/loading/config.interceptor.js:46:7) at responseError (http://localhost/restful-bookmarks-phpslim-master/shared/components/progressbar/loading/config.interceptor.js:93:9) at J (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:91:331) at J (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:91:331) at Anonymous function (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:92:512) at g.prototype.$eval (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:100:317) at g.prototype.$digest (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:98:202) at g.prototype.$apply (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:101:155) at g (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:67:173) at Q (http://localhost/restful-bookmarks-phpslim-master/vendor/angular.js/1.2.1/angular.min.js:71:64)

    For tests, i put:

    Name: Google URL: http://google.com Description: google!

    See you!

    opened by fzoro 1
Releases(1.1.0)
Owner
Erko Bridee
I'm a mad computer scientist, but with bachelor's degree \o/
Erko Bridee
Magento sample data includes a sample store, complete with more than 250 products

Magento sample data includes a sample store, complete with more than 250 products (about 200 of them are configurable products), categories, promotional price rules, CMS pages, banners, and so on. Sample data uses the Luma theme on the storefront.

Magento 203 Dec 16, 2022
Minimalistic bookmark manager for your own server written in PHP. Bookmarks are stored in a sqlite database.

b - Bookmark manager b is a minimalistic bookmark manager for your own server. Written in PHP. Bookmarks are stored in a sqlite database. Features: fi

Sebastian Volland 48 Jan 6, 2023
Aplicação criada com Angular e Laravel em conjunto para fazer um treinamento de autenticação com sistema de login, guarda de rotas e cadastro de usuários no banco de dados MySQL

Times-de-Futebol-BR Descrição do Projeto Aplicação criada com Angular e Laravel em conjunto para fazer um treinamento de autenticação com sistema de l

Lucas Henrique Pessutto 5 Mar 14, 2022
Your self-hosted bookmark archive. Free and open source.

Your self-hosted bookmark archive. Free and open source. Contents About LinkAce Support Setup Contribution About LinkAce LinkAce is a self-hosted arch

Kevin Woblick 1.7k Jan 2, 2023
TXP-Tweet - arc twitter - Twitter-Textpattern integration

TXP Tweet This is TXP Tweet, a collection of Textpattern plugins for Twitter integration. TXP Tweet consists of two plugins: arc_twitter (the core Tex

Andy Carter 11 Sep 20, 2021
A Twitter bot powered by Github Actions tweeing Wikidata milestones

Twitter WikidataMeter Bot I'm the code, and deployment of Twitter bot WikidataMeter. I tweet a few fun things about Wikidata as it grows. Tweets Feel

null 9 Dec 9, 2022
Your visual bookmark manager

Colllect Introduction Colllect is your new bookmark manager! With it, you can manage your inspiration and resources into colllections. Go to Colllect

Colllect 336 Jan 4, 2023
🔖 Bookmark app for Nextcloud

Nextcloud Bookmarks Bookmarks app for Nextcloud This app provides you with a web interface for collecting and organizing bookmarks to the places on th

Nextcloud 803 Jan 8, 2023
Invo - Sample application for the Phalcon PHP Framework

INVO Application Phalcon is a web framework delivered as a C extension providing high performance and lower resource consumption. This is a sample app

The Phalcon PHP Framework 344 Dec 14, 2022
Album-o-rama - Sample application for the Phalcon PHP Framework.

Album O'Rama Phalcon PHP is a web framework delivered as a C extension providing high performance and lower resource consumption. This is a sample app

The Phalcon PHP Framework 84 Oct 7, 2022