A backend API project developed using Spring and Java.
This project involved creating a backend API using Spring Boot and Java which would enable a consumer of the API to do some CRUD (GET and POST) operations. It is also designed to be RESTful so that it can scale.
-
Initialise MySQL database with name employee_creator_backend
CREATE DATABASE postcode_backend -
Set up the API in Spring in production/src/main/resources/application.properties
spring.datasource.url=jdbc:mysql://localhost:3306/postcode_backend spring.datasource.username=root spring.datasource.password=<YOUR_ROOT_PASSWORD> spring.jpa.hibernate.ddl-auto=update spring.jpa.generate-ddl=true -
Run the Spring API using an IDE of your choice
- Spring Boot: To build and test the backend with the relevant dependancies.
- MySQL: To build a scalable and reliable relational database.
- Java: To build the backend, used for it's scalability and integration of other frameworks/technologies (i.e. Spring Boot).
The requirements of the project were to:
- To create an API in Java that would allow mobile clients to retrieve and add unique suburb/postcode combinations.
- To have a secured API endpoint to add new unique suburb and postcode combinations
- To have persistence
- To have tests for controller/service layers
- POST and GET of postcode data
- Allows a user to Get by suburb and/or Get by postcode
- RESTful
- Persistence through MySQL workbench database
- Testing
- Authentication via Basic Auth of a specified route