Skip to content

Spring Backend for a past LCOGT-takehomeinterview challenge

Notifications You must be signed in to change notification settings

jdegand/LCOGT-spring-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LCOGT Spring Backend

This is spring boot conversion of my express solution to a past interview test from LCOGT.

I have created an angular frontend that works with this backend.

Screenshots






Built With

  • Maven
  • Java 17
  • Spring Boot 3.1
  • JPA
  • H2 Console

Thoughts

  • The interview challenge repo was long outdated before I started. I used the repo to practice my skills as there are few Java take home tests on Github.
  • Package names are not allowed to use dashes -> 'The original package name 'com.example.LCOGT-spring-backend' is invalid and this project uses 'com.example.LCOGTspringbackend' instead.' It is probably best to not use capitals either.
  • H2 console does not automatically create a table (based on your schema) for you anymore - add spring.jpa.hibernate.ddl-auto=create-drop in application.properties
  • JPA query methods save you a lot of time - many use cases are covered
  • However, JPA query methods don't throw errors - they return nothing and have a 200 status code.
  • @Digits annotation seems better than @Pattern with a regex
  • Easy to swap databases in Spring Boot. Not much has to be changed - add a driver dependency and update the application.properties file.
  • Constructor injection is better than field injection(@Autowired) for unit testing.
  • Added DBDataInitializer to add "Mars" to the database on start-up. I used a SQL migration to add "Mars" to the database in my Express application.

Continued Development

  • Lombok / Tests added on 'lombok' branch
  • Database Integration / Removal of H2 Console
  • Query method exception

Useful Resources

About

Spring Backend for a past LCOGT-takehomeinterview challenge

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages