Implementation of phonebook REST functionality.
Tecnology stack:
8085
, 8086
available on the host machine.Run to setup the project locally:
git clone https://github.com/zerotool/phonebook-rest.git
cd phonebook-rest
./provisioning.sh
It will bootstrap the project into a set of docker containters and run the tests.
Sometimes install process can take 1-2 minutes to start up MySQL:
=== Waiting for db to initialize
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
.ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
.ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
.=== Running database migrations
Phalcon DevTools (3.4.0)
Success: Version 1.0.0 was successfully migrated
That’s ok, just wait ¯\(ツ)/¯ You can safely run ./provisioning.sh
multiple times in a row to
retry/resume/debug the process.
Adminer credentials:
MySQL
db
root
111111
phonebook
/contacts/{page}/{limit}
/contacts/{page}/{limit}/{name_query}
/contacts/{id}
/contacts
{
"first_name": "Stanislav",
"last_name": "Erokhin",
"phone_number": "+12 223 444224455",
"country_code": "RU",
"timezone": "Europe/Moscow"
}
/contacts/{id}
/contacts/{id}
(payload is the same as POST)/countries
(Redis cache used)/timezones
(Redis cache used)Run all tests under the folder:
$ docker-compose run --rm codecept run
contacts
fields used in search.Copyright 2019 Stanislav Erokhin