/todolist_wine

There are RESTful API and UI for the simple To Do List.

Primary LanguagePHP

To Do List

There are RESTful API with Https and UI for the simple To Do List.

This project is done using SLIM PHP Micro Framework + Apache + PHP + PHPUnit + MySQL + JQuery + Ajax + HTML + CSS.

Configuration

Database: "db/todolist_wine.sql"

MySQL-PHP connection: "include/config.php"

Pre-requisites: LAMP Server (Ubuntu14.04, Apache2, MySQL5, PHP5)

Docker To Build

$ cd ~/todolist_wine/environment/todolistv1/
$ docker build -t todolistv1 . 

Docker To run apache(http/https)

# run docker todolistv1
$ CONTAINER=$(docker run -d -i -t -p 80:80 -p 3306:3306 -p 443:443 todolistv1)
# get the http port
$ docker port $CONTAINER 80
0.0.0.0:80
# get the https port
$ docker port $CONTAINER 443
0.0.0.0:443

Docker To access the database

# get the mysql port
$ docker port $CONTAINER 3306
0.0.0.0:3306
$ mysql -hdockerhost -uroot -P 3306

###Testing Restful API

 phpunit ~/todolist_wine/tests/api/v1/apiTest.php

Chrome: Advanced REST client extension (Postman)

###Request

URL Method Parameters Description
/register POST name,email,password User Registration
/login POST email,password User Login
/login/:user_id DELETE User Logout
/categories GET Fetching All Categories
/categories POST category_name To Create a New category
/categories/:id GET Fetching A Single Category
/categories/:id PUT name,status Updating a Single Category
/categories/:id DELETE category Delete a Single Category
/categories/:id/lists GET Fetching All Lists
/categories/:id/lists POST list_name To Create a New List
/categories/:id/lists/:list_id GET Fetching A Single List
/categories/:id/lists/:list_id PUT name,status Updating a Single List
/categories/:id/lists/:list_id DELETE Delete a Single List