This project is done using SLIM PHP Micro Framework + Apache + PHP + PHPUnit + MySQL + JQuery + Ajax + HTML + CSS.
Database: "db/todolist_wine.sql"
MySQL-PHP connection: "include/config.php"
Pre-requisites: LAMP Server (Ubuntu14.04, Apache2, MySQL5, PHP5)
$ cd ~/todolist_wine/environment/todolistv1/
$ docker build -t todolistv1 .
# 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
# 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)
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 |