For building and running the application you need:
- JDK 11
- Maven 3
- Common Library
- Before using phonebook api you should compile and add this project. You can use this command:
mvn clean install
.
- Before using phonebook api you should compile and add this project. You can use this command:
There are several ways to run a Spring Boot application on your local machine. One way is to execute the main
method in the digital.paisley.phonebook.Application
class from your IDE.
Alternatively you can use the Spring Boot Maven plugin like so:
mvn spring-boot:run
The easiest way to run the application in a docker container is to use the Docker CLI:
- Go to the folder containing Dockerfile
cd project
- sudo docker build -t name:tag .
sudo docker build -t phonebook:1.0 .
- Start the docker container phonebook:1.0, run the /opt/app/app.jar file during startup.
sudo docker run -d -p 8080:8080 -t phonebook:1.0
- use this URL http://localhost:8080/
After running thr App you can use this URL to find OpenAPI specification for the REST APIs
You can find here all documents related to this project: Notion Documents
Also, you can find Tech Spec here: Tech Spec
- Add new contact:
curl -X POST "https://api-dev.paisley.digital/contacts" -H "accept: application/json" -H "Content-Type: application/json" -d
"{
"firstName": "string",
"lastName": "string",
"description": "string",
"organization": "string",
"githubUserName": "burrsutter",
"email": "meysam.tamkin@gmail.com",
"phoneNumber": "+098 (707) 777-1234",
"address": "string"
}"
- Search contact:
curl -X GET "https://localhost:8080/contacts?search=address:string,lastName:meysam" -H "accept: application/json"