- Use Spring Boot, Spring Data JPA and Hibernate to build a RESTful API
- Use object-oriented programming to manage source code complexity
- Use an API client to test-drive code
It's time to use everything you've learned up to this point! Your task is to build a complete API in Java using Spring Boot, Spring Data JPA and Hibernate. Treat this challenge like a real project, not just an exercise to complete. Take time to read documentation, experiment & discuss ideas with your peers and teachers.
- Fork this repository
- Clone your fork to your machine
- Open the project in IntelliJ
- Navigate to the
src/main/resources/
dirctory and rename theapplication.yml.example
file toapplication.yml
- Create a new PostgreSQL database for this exercise, a cloud database such as ElephantSQL is fine
- Replace the
DATABASE_URL
,DATABASE_USERNAME
andDATABASE_PASSWORD
sections in the .yml file with your real database information. An example of what the file should look like is below
- Your task is to develop the API that satisfies this API spec. Create your source code in the
com.booleanuk.api.cinema
package
Pay close attention to the details of each endpoint. How you choose to implement the solution is up to you, there are no wrong answers, but the inputs and outputs must match the provided API documentation exactly.
You'll find an entity relationship diagram here. Use it to help you design your models.
Example application.yml file:
server:
port: 4000
error:
include-message: always
include-binding-errors: always
include-stacktrace: never
include-exception: false
spring:
datasource:
url: jdbc:postgresql://tfke.db.elephantsql.com/dkshfirn
username: dkshfirn
password: PFif40fj-eb6btfiF*k3nfEobyGaH
max-active: 3
max-idle: 3
jpa:
hibernate:
ddl-auto: create-drop
properties:
hibernate:
dialect: org.hibernate.dialect.PostgreSQLDialect
format_sql: true
show-sql: true
Here is an extension API spec.
It contains a few new routes, different approaches to data mutation and, most importantly, an entirely different response format for each request.
You'll need to do a fair amount of research in order to complete this challenge. Make liberal use of StackOverflow, search engines, YouTube and the teaching team.
Here are some reference documentation links that will be useful: