{"id":21307510,"url":"https://github.com/jdegand/origin-spring-boot-backend","last_synced_at":"2025-06-11T00:06:40.629Z","repository":{"id":175106269,"uuid":"652793333","full_name":"jdegand/origin-spring-boot-backend","owner":"jdegand","description":"Origin Financial Take Home Assignment Solution ","archived":false,"fork":false,"pushed_at":"2023-06-13T22:46:42.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T20:12:42.579Z","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-12T20:09:43.000Z","updated_at":"2023-06-12T20:29:57.000Z","dependencies_parsed_at":null,"dependency_job_id":"56a417af-bbfa-47ef-a6d5-d476d55ef25c","html_url":"https://github.com/jdegand/origin-spring-boot-backend","commit_stats":null,"previous_names":["jdegand/origin-spring-boot-backend"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Forigin-spring-boot-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Forigin-spring-boot-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Forigin-spring-boot-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Forigin-spring-boot-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdegand","download_url":"https://codeload.github.com/jdegand/origin-spring-boot-backend/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdegand%2Forigin-spring-boot-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259172969,"owners_count":22816558,"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:32:20.521Z","updated_at":"2025-06-11T00:06:40.606Z","avatar_url":"https://github.com/jdegand.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Origin Financial Backend Assessment\n\nThis is a Spring Boot Conversion of [my past repo solution](https://github.com/jdegand/origin-backend-take-home-assignment) to [origin financial's backend take home assignment](https://github.com/OriginFinancial/origin-backend-take-home-assignment).  \n\nThe backend works with this [frontend](https://github.com/jdegand/origin-angular-frontend).\n\n## Screenshots\n\n![](screenshots/origin-spring-backend.png)\n\n## Built With\n\n- Java 17\n- Spring Boot 3.1\n- VS Code\n\n## How to Use\n\nThe Express application runs by default on `http://localhost:4000` and has the following endpoints:\n\n - `http://localhost:4000/api/score` - post endpoint that expects the form object below\n\n\n### Expected Payload JSON\n\n```json\n{\n  \"personal\": {\n    \"age\": 35,\n    \"income\": 0,\n    \"marital_status\": \"married\"\n  },\n  \"house\": {\n    \"ownership_status\": \"owned\",\n    \"dependents\": 2\n  },\n  \"vehicle\": {\n    \"year\": 2018\n  },\n  \"questions\": {\n    \"question1\": \"false\",\n    \"question2\": \"true\",\n    \"question3\": \"false\"\n  }\n}\n```\n\n### Running the Spring Boot Application\n\n```bash \n\ngit clone https://github.com/jdegand/origin-spring-boot-backend.git\n\n# need java jdk installed \n\n# cd into directory \u0026 run directly with maven or open in ide - click run button\n```\n\n### Running the Angular Application\n\nRun the backend application first.\n\n```bash\n\ngit clone https://github.com/jdegand/origin-angular-frontend.git\n\n# cd into the directory\nnpm install \n\nnpm start\n```\n\n## Thoughts\n\n- Have to add @Valid in ApplicantData because properties are nested  \n- The only standard annotations which can be applied to enum's are @NotNull and @Null.\n- Adding custom validation for question to ensure question answers are only 'true' or 'false' requires an implementation similar to [this](https://stackoverflow.com/questions/74227120/how-can-i-create-custom-validator-on-java-list-type)\n- Don't think using an entity makes sense since data is not saved to a database \n- Using DTO vs entity - not much practical difference - although I think it was a bigger issue in the past\n- Didn't add setters to DTOs - necessary for more complicated testing logic ?\n- I gitignored the maven-wrapper.jar - debatable if it should be ignored or not - The mvnw / mvnw.cmd scripts will download a maven wrapper if it is missing\n\n## Improvements\n\n- Code Coverage plugin\n- More tests\n- Custom Validator for questions\n- Error route \n\n## Useful Resources\n\n- [Official Apache Maven documentation](https://maven.apache.org/guides/index.html)\n- [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/3.1.0/maven-plugin/reference/html/)\n- [Create an OCI image](https://docs.spring.io/spring-boot/docs/3.1.0/maven-plugin/reference/html/#build-image)\n- [Spring Web](https://docs.spring.io/spring-boot/docs/3.1.0/reference/htmlsingle/#web)\n- [Building a RESTful Web Service](https://spring.io/guides/gs/rest-service/) - spring guide\n- [Serving Web Content with Spring MVC](https://spring.io/guides/gs/serving-web-content/) - spring guide\n- [Building REST services with Spring](https://spring.io/guides/tutorials/rest/) - spring guide\n- [VS Code Docs](https://code.visualstudio.com/docs/java/java-project) - java vscode\n- [JSON 2 CSHARP](https://json2csharp.com/code-converters/json-to-pojo) - json to pojo\n- [YouTube](https://www.youtube.com/watch?v=zvR-Oif_nxg) - Spring Boot Complete Tutorial - Master Class\n- [Github](https://github.com/shabbirdwd53/Springboot-Tutorial) - Springboot Tutorial Repo for Spring Boot Complete Tutorial - Master Class video\n- [Stack Overflow](https://stackoverflow.com/questions/69639251/should-entity-class-be-used-as-request-body) - DTO or entity?\n- [Spring Framework Guru](https://springframework.guru/requestbody-annotation/) - requestbody annotation\n- [YouTube](https://www.youtube.com/watch?v=GYMz4sfHz-Y) - Coding Challenge #1 - RESTful Calculator with Java Spring Boot\n- [Stack Overflow](https://stackoverflow.com/questions/70071007/how-can-i-return-an-object-from-a-post-method-with-spring-boot) - return an object from a post method with spring boot\n- [Stack Overflow](https://stackoverflow.com/questions/71091905/spring-boot-mapping-between-entity-and-database-not-working-getting-in-res) - spring boot mapping between entity and database not working\n- [Stack Overflow](https://stackoverflow.com/questions/64517537/springboot-validate-requestbody) - validate requestbody\n- [YouTube](https://www.youtube.com/watch?v=93OBRePaoxY) - Spring boot Post Method Example with JSON and Postman\n- [Stack Overflow](https://stackoverflow.com/questions/62588065/option-for-generating-getters-and-setters-not-showing-up-on-vs-code) - option for generating getters and setters on vscode\n- [VS Code](https://code.visualstudio.com/docs/java/java-refactoring) - java refactoring\n- [How to Do in Java](https://howtodoinjava.com/spring-mvc/controller-getmapping-postmapping/) - controller getMapping / postMapping\n- [YouTube](https://www.youtube.com/watch?v=zMavMTK3qps\u0026list=PLdW9lrB9HDw101ImXtR_xkvTe1HWx7Gc6\u0026index=18) - RESTful Web Service with Spring Boot - Consume and Produce JSON or XML\n- [Java Guides](https://www.javaguides.net/2021/04/spring-boot-dto-validation-example.html) - dto validation example\n- [Stack Overflow](https://stackoverflow.com/questions/57704183/how-to-use-a-lambda-to-filter-a-boolean-array-in-java) - lambda to filter a boolean array\n- [Stack Overflow](https://stackoverflow.com/questions/8260881/what-is-the-most-elegant-way-to-check-if-all-values-in-a-boolean-array-are-true) - most elegant way to check if all values in a boolean array are true\n- [Spring Docs](https://docs.spring.io/spring-framework/docs/4.1.x/spring-framework-reference/html/validation.html) - validation\n- [YouTube](https://www.youtube.com/watch?v=gPnd-hzM_6A) - Spring Boot | REST API Request Validation \u0026 Exception Handling Realtime Example | JavaTechie\n- [Stack Overflow](https://stackoverflow.com/questions/59934783/how-do-you-change-the-spring-boot-dashboard-project-name-in-vs-code) - change spring boot dashboard project name in vscode\n- [Stack Overflow](https://stackoverflow.com/questions/58336387/why-does-validation-not-work-on-objects-of-type-dto-but-only-on-entities) - validation not working with dto objects\n- [Stack Overflow](https://stackoverflow.com/questions/57277850/spring-validator-class-does-not-validate-the-dto-data) - spring validator class does not validate the dto data\n- [Stack Overflow](https://stackoverflow.com/questions/41005850/validation-nested-models-in-spring-boot) - validation nested models\n- [Baeldung](https://www.baeldung.com/javax-validations-enums) - javax validations enums\n- [Stack Overflow](https://stackoverflow.com/questions/6294587/java-string-validation-using-enum-values-and-annotation) - java string validation using enum values and annotation\n- [Stack Overflow](https://stackoverflow.com/questions/62372281/how-to-validate-enum-in-dto) - how to validate enum in dto\n- [YouTube](https://www.youtube.com/watch?v=P5sAaFY3O2w) - Spring Boot - Creating Custom Annotation For Validation | InterviewQA | JavaTechie\n- [YouTube](https://www.youtube.com/watch?v=oKA2-aIEQaw) - 13. Spring Boot | Working with enum | @Enumerated\n- [Stack Overflow](https://stackoverflow.com/questions/45968008/requestbody-valid-somedto-has-field-of-enum-type-custom-error-message) - requestbody valid custom error message\n- [Fun of Programming Blog](https://funofprograming.wordpress.com/2016/09/29/java-enum-validator/) - java enum validator\n- [Spring Docs](https://spring.io/guides/gs/rest-service-cors/) - rest service cors\n- [Stack Overflow](https://stackoverflow.com/questions/74227120/how-can-i-create-custom-validator-on-java-list-type) - custom validator on java list type\n- [Sololean](https://www.sololearn.com/compiler-playground/java) - compiler playground java\n- [Free Formatter](https://www.freeformatter.com/json-escape.html#before-output) - escape json\n- [Stack Overflow](https://stackoverflow.com/questions/72788387/mockmvc-contenttype-is-undefined-in-result-action) - mockMvc contentType is undefined in result action\n- [Medium](https://medium.com/@karlrombauts/setting-up-unit-testing-for-java-in-vs-code-with-maven-3dc75579122f) - setting up unit testing for java in vs code with maven\n- [Stack Overflow](https://stackoverflow.com/questions/51792830/what-files-in-a-maven-project-should-be-committed-to-git) - maven gitignore\n- [Stack Overflow](https://stackoverflow.com/questions/73180793/should-i-gitignore-mvn-folder-in-a-spring-boot-project) - should i gitignore mvn folder in a spring boot project\n- [Gist](https://gist.github.com/fedir/cd58012d42c8c1edbb3fff611de6c2f6) - java gitignore\n- [Github](https://ucsb-cs48.github.io/javatopics/gitignore_maven/) - gitignore maven\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdegand%2Forigin-spring-boot-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdegand%2Forigin-spring-boot-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdegand%2Forigin-spring-boot-backend/lists"}