Skip to content

An AddressBook Application Written with React + Spring Boot

Notifications You must be signed in to change notification settings

pmaher/ReactAddressBook

Repository files navigation

React Address Book

Welcome!

With this little app you’ll be able to add addresses, update address, view addresses and delete addresses using a handy little single page webapp built with React + Spring Boot.

Step 0 - Building the ReactAddressBook Project

mvn clean install

Step 1 - Run the ReactAddressBook Project With a Local Tomcat Server

java -jar target/react-address-book-0.0.1-SNAPSHOT.jar

Step 2 - Touring your REST service

With the app running, you can check things out on the command line using cURL (or any other tool you like).

View a specific Address:

$ curl localhost:8080/api/address/view/?id=1
{
    "id":1,
    "firstName":"firstName",
    "lastName":"lastName",
    "email":"[email protected]",
    "phone":"999-999-9999",
    "address":"address",
    "address2":"address2",
    "city":"city",
    "state":"CA",
    "zipcode":"91361"
}

List all Addresses:

$ curl localhost:8080/api/address/list
[{
    "id" : 1,
    "firstName" : "firstName",
    "lastName" : "lastName",
    "email" : "[email protected]",
    "phone" : "999-999-9999",
    "address" : "address",
    "address2" : "address2",
    "city" : "city",
    "state" : "CA",
    "zipcode" : "91361"
}]

Create a New Address:

$ curl -X POST localhost:8080/api/address/new -d "{\"firstName\": \"George\", \"lastName\": \"Washington\", \"email\": \"[email protected]\", \"phone\": \"(999) 999-9999\",\"address\": \"16 Pennsylvania Ave\",\"address2\": \"Apt 2\",\"city\": \"Washington\",\"state\": \"D.C\",\"zipcode\": \"99999\"}" -H "Content-Type:application/json"
{
    "id":2,
    "firstName":"George",
    "lastName":"Washington",
    "email":"[email protected]",
    "phone":"(999) 999-9999",
    "address":"16 Pennsylvania Ave",
    "address2":"Apt 2",
    "city":"Washington",
    "state":"D.C",
    "zipcode":"99999"
}

Update an Existing Address:

$ curl -X POST localhost:8080/api/address/update -d "{\"id\": \"1\", \"firstName\": \"Denzel\", \"lastName\": \"Washington\", \"email\": \"[email protected]\", \"phone\": \"(999) 999-9999\",\"address\": \"16 Pennsylvania Ave\",\"address2\": \"Apt 2\",\"city\": \"Washington\",\"state\": \"D.C\",\"zipcode\": \"99999\"}" -H "Content-Type:application/json"
{
    "id":1,
    "firstName":"Denzel",
    "lastName":"Washington",
    "email":"[email protected]",
    "phone":"(999) 999-9999",
    "address":"16 Pennsylvania Ave",
    "address2":"Apt 2",
    "city":"Washington",
    "state":"D.C",
    "zipcode":"99999"
}

Delete an Existing Address:

$ curl -X POST localhost:8080/api/address/delete/2
{
    "message" : "success"
}

About

An AddressBook Application Written with React + Spring Boot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages