-
spring-boot-movies-api
A sample of making a movies API using Spring Boot following a set of best practices.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
-
insomnia
The open-source, cross-platform API client for GraphQL, REST, WebSockets, SSE and gRPC. With Cloud, Local and Git storage.
To make this code accessible for all of you, and insure its version, we'll be using git and GitHub, find all the code here : Github Repo
Spring provides us with an Initialization suite that helps us start our project quicker than usual.
provides us with embedded constructors and accessors so we can reduce the written code. see more about the [Lombok project](https://projectlombok.org/). The ```@Entity``` is there to tell Spring Data that particular class should be represented as a table in our relational database. we call that process an ORM (Object Relational Mapping). So that our id won’t be duplicated, we will use a sequence, we put the ```@GeneratedValue(strategy = GenerationType.SEQUENCE)``` there. ### Building the repository facade Simply, an interface that will inherit Spring Data JPA powers and handle the CRUD ORM operations on our behalf.
All we need to do next is to test what we build via a rest client, for this reason, I'm using [Insomnia](https://insomnia.rest/) : ##### The post end-point ##### The get end-point ##### The put end-point ##### The delete end-point And finally, testing the error scenario for some end-points. Let's try and save a movie with an existing id : Or delete a non-existing movie : ## Summary Spring Boot is a powerful apps making tool, takes away all the times consuming tasks and leaves you with the logical ones to handle. Don't get fouled, building APIs is not that easy, and from what I saw, that's just the tip of the Iceberg! Find the source code [Here](https://github.com/xrio/simple-spring-boot-movies). More articles [Here](https://elattar.me/).
Related posts
-
The Collaborative API Development Platform – Insomnia
-
GitHub stars are one of the most inexpensive ways to generate an outsized outcome in the community by leveraging the tailwinds of increased adoption
-
Local-only projects are coming back in mid October (Insomnia v8.3)
-
Local-only projects are coming back in mid October (Insomnia v8.3) #6626
-
Local-only projects are coming back in mid October (Insomnia v8.3)