A spring boot application that uses MVC and the Hibernate ORM to conect to a Postgres database
-
Start Postgres database using the command:
docker-compose up
[Development Only]: Once the database server has been started it can be connected to using the command:psql -h localhost -p 5440 -U admin
Once prompted for the password enter: admin100% -
Once signed into the postgres client cli tool, create the todo database using the command
CREATE DATABASE todo;
The database can also be created using the single command below:PGPASSWORD=admin100% psql -U admin -h localhost -p 5440 -c 'create database todo;'
-
Exit the postgres client and start the Spring Boot server using the command:
mvn spring-boot:run
mvn testCreate Account
curl -d '{"email":"example@gmail.com", "password":"password"}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/v1/auth/registerSign In
curl -d '{"email":"example@gmail.com", "password":"password"}' -H "Content-Type: application/json" -X POST http://localhost:8080/api/v1/auth/loginCreate TODO List Item
curl -d '{"entry": "my test todo item"}' -H "Authorization: Bearer [JWT TOKEN]" -H "Content-Type: application/json" -X POST 'http://localhost:8080/api/v1/list'Get TODO List Items
curl -H "Authorization: Bearer [JWT TOKEN]" -H "Content-Type: application/json" -X GET 'http://localhost:8080/api/v1/list?filter=&offset=0&limit=40'Update TODO List Item
curl -d '{"id": 1, "entry": "hello world 2", "checked": true}' -H "Authorization: Bearer [JWT TOKEN]" -H "Content-Type: application/json" -X PUT 'http://localhost:8080/api/v1/list'Delete TODO List Item
curl -d '{"id": 1}' -H "Authorization: Bearer [JWT TOKEN]" -H "Content-Type: application/json" -X DELETE 'http://localhost:8080/api/v1/list'