{"id":21307641,"url":"https://github.com/jdegand/lcogt-spring-backend","last_synced_at":"2025-03-15T20:13:05.022Z","repository":{"id":181676680,"uuid":"654268415","full_name":"jdegand/LCOGT-spring-backend","owner":"jdegand","description":"Spring Backend for a past LCOGT-takehomeinterview challenge","archived":false,"fork":false,"pushed_at":"2023-09-20T00:20:46.000Z","size":83,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-22T09:13:19.457Z","etag":null,"topics":["java","java17-spring-boot","spring-boot-3"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdegand.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-15T18:46:17.000Z","updated_at":"2023-09-19T17:35:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"2e61e81c-661a-4a25-9cb4-07425e367d2b","html_url":"https://github.com/jdegand/LCOGT-spring-backend","commit_stats":null,"previous_names":["jdegand/lcogt-spring-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2FLCOGT-spring-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2FLCOGT-spring-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2FLCOGT-spring-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2FLCOGT-spring-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdegand","download_url":"https://codeload.github.com/jdegand/LCOGT-spring-backend/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243785089,"owners_count":20347409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java17-spring-boot","spring-boot-3"],"created_at":"2024-11-21T16:33:21.964Z","updated_at":"2025-03-15T20:13:04.988Z","avatar_url":"https://github.com/jdegand.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LCOGT Spring Backend\n\nThis is spring boot conversion of [my express solution](https://github.com/jdegand/LCOGT-takehomeinterview) to a past interview test from [LCOGT](https://github.com/LCOGT).\n\nI have created an [angular frontend](https://github.com/jdegand/LCOGT-angular-frontend) that works with this backend.  \n\n## Screenshots\n\n![](screenshots/LCOGT-spring-backend-1.png)\n\n***\n\n![](screenshots/LCOGT-spring-backend-2.png)\n\n***\n\n![](screenshots/LCOGT-spring-backend-3.png)\n\n***\n\n![](screenshots/LCOGT-spring-backend-4.png \"Added Mercury from angular frontend\")\n\n***\n\n![](screenshots/LCOGT-spring-backend-5.png)\n\n***\n\n## Built With\n\n- Maven\n- Java 17\n- Spring Boot 3.1\n- JPA\n- H2 Console\n\n## Thoughts\n\n- 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.  \n- Package names are not allowed to use dashes -\u003e '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. \n- 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\n- [JPA query methods](https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods) save you a lot of time - many use cases are covered\n- However, JPA query methods don't throw errors - they return nothing and have a 200 status code.\n- @Digits annotation seems better than @Pattern with a regex\n- Easy to swap databases in Spring Boot.  Not much has to be changed - add a driver dependency and update the `application.properties` file.\n- Constructor injection is better than field injection(@Autowired) for unit testing. \n- 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.  \n\n## Continued Development\n\n- Lombok / Tests added on 'lombok' branch \n- Database Integration / Removal of H2 Console\n- Query method exception\n\n## Useful Resources\n\n- [Stack Overflow](https://stackoverflow.com/questions/4078559/how-to-specify-doubles-precision-on-hibernate) - double's precision\n- [H2 Docs](https://www.h2database.com/html/tutorial.html#connecting_using_jdbc) - connecting using jdbc\n- [Stack Overflow](https://stackoverflow.com/questions/71984489/h2-console-not-being-found-in-browser-while-running-springboot-application) - h2 console not being found \n- [Stack Overflow](https://stackoverflow.com/questions/47221582/h2-in-memory-database-console-not-opening) - h2 console not opening\n- [Baeldung](https://www.baeldung.com/spring-boot-h2-database) - spring boot h2 database\n- [Stack Overflow](https://stackoverflow.com/questions/47018159/spring-boot-h2-console-not-showing-my-table) - spring h2 console not showing my table\n- [YouTube](https://www.youtube.com/watch?v=xgG1JgaG1p4) - How To Access The H2 Database Console In Spring Boot Projects\n- [Stack Overflow](https://stackoverflow.com/questions/73983769/h2-database-doesnt-create-table-from-schema-sql) - h2 database doesn't create table from schema\n- [Spring Docs](https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#jpa.query-methods) - jpa query methods\n- [Stack Overflow](https://stackoverflow.com/questions/17092601/how-to-validate-unique-username-in-spring) - validate unique username in spring\n- [Stack Overflow](https://stackoverflow.com/questions/3495368/unique-constraint-with-jpa-and-bean-validation/3499111#3499111) - unique constraint\n- [Stack Overflow](https://stackoverflow.com/questions/30321564/swing-jtextfield-max-3-digits-before-decimal-and-max-2-digits-after-decimal) - swing jtextfield max 3 digits before decimal and max 2 digits after decimal\n- [Stack Overflow](https://stackoverflow.com/questions/22218350/invalid-escape-sequence-valid-ones-are-b-t-n-f-r-in-java) - invalid escape sequence valid one are b-t-n-f-r in java\n- [Stack Overflow](https://stackoverflow.com/questions/35460884/validation-with-double-value-in-spring) - validation with double value in spring\n- [Blind Text Generator](https://www.blindtextgenerator.com/lorem-ipsum) - used this to test description max length \n- [Stack Overflow](https://stackoverflow.com/questions/35460884/validation-with-double-value-in-spring) - validation with double value in spring\n- [JTuts](http://jtuts.com/2016/05/24/validating-double-values-spring/) - validating double values spring\n- [Stack Overflow](https://stackoverflow.com/questions/47088949/validating-size-for-bigdecimal-for-given-length-not-precision) - validating size for big decimal for given length not precision\n- [Cheat Sheet Series](https://cheatsheetseries.owasp.org/cheatsheets/Bean_Validation_Cheat_Sheet.html) - Bean Validation Cheat Sheet\n- [Stack Overflow](https://stackoverflow.com/questions/39849574/how-to-throw-exceptions-on-search-methods-in-spring-data-jpa) - throw exceptions on search methods in spring data jpa\n- [Java Guides](https://www.javaguides.net/2022/11/optional-orelsethrow-method.html) - optional orElseThrow method\n- [Spring Docs](https://docs.spring.io/spring-boot/docs/1.3.0.M2/reference/html/boot-features-sql.html) - boot features sql\n- [Github](https://github.com/springframeworkguru/spring-boot-mariadb-example/blob/master/src/main/resources/application.properties) - mariadb\n- [Reflectoring](https://reflectoring.io/unit-testing-spring-boot/) - unit testing spring boot\n- [Blog](https://www.arhohuttunen.com/spring-boot-unit-testing/) - spring boot unit testing\n- [Baeldung](https://www.baeldung.com/javax-bigdecimal-validation) - big decimal validation\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdegand%2Flcogt-spring-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdegand%2Flcogt-spring-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdegand%2Flcogt-spring-backend/lists"}