{"id":26856735,"url":"https://github.com/orpolyzos/spring-web-initializr","last_synced_at":"2025-05-05T22:53:54.274Z","repository":{"id":37637056,"uuid":"177409874","full_name":"OrPolyzos/spring-web-initializr","owner":"OrPolyzos","description":"Spring Web Initializr is a library that helps you easily create Web Apps with Spring Boot.","archived":false,"fork":false,"pushed_at":"2021-06-30T09:58:31.000Z","size":442,"stargazers_count":18,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-05T22:53:49.014Z","etag":null,"topics":["java","library","mvc","mvc-pattern","plugin","rest","rest-api","spring","spring-boot","webapp"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OrPolyzos.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":"contributing.md","funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-24T12:11:23.000Z","updated_at":"2024-05-22T05:35:54.000Z","dependencies_parsed_at":"2022-08-18T16:50:40.795Z","dependency_job_id":null,"html_url":"https://github.com/OrPolyzos/spring-web-initializr","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrPolyzos%2Fspring-web-initializr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrPolyzos%2Fspring-web-initializr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrPolyzos%2Fspring-web-initializr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OrPolyzos%2Fspring-web-initializr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OrPolyzos","download_url":"https://codeload.github.com/OrPolyzos/spring-web-initializr/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590533,"owners_count":21772935,"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","library","mvc","mvc-pattern","plugin","rest","rest-api","spring","spring-boot","webapp"],"created_at":"2025-03-31T00:23:23.123Z","updated_at":"2025-05-05T22:53:54.240Z","avatar_url":"https://github.com/OrPolyzos.png","language":"Java","readme":"Spring Web Initializr\n==========\n\n[![build][shield-build]](#)\n[![tests][shield-tests]](#)  \n[![code-coverage-92%][shield-coverage]](#)\n\n[![release-2.0.0][shield-release]](#)\n[![jdk-8][shield-jdk]](#)\n[![spring-boot-2.0.0.RELEASE][shield-spring]](#)\n[![MIT licensed][shield-license]](#)  \n\nSpring Web Initializr _(will be referenced Swi from now on)_ is a library that helps you easily create Web Apps with Spring Boot.  \nIt was initially developed in order to support the [Swip (Spring Web Initializr Plugin)](https://plugins.jetbrains.com/plugin/12239-swip-spring-web-initializr-) \nbuilt for IntelliJ IDEA, but was extended beyond that usage and can be obviously used independently.\n\nTL;DR\n-----\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.github.orpolyzos\u003c/groupId\u003e\n    \u003cartifactId\u003espring-web-initializr\u003c/artifactId\u003e\n    \u003cversion\u003e2.0.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n**Fully working examples can be found at [Swi(p) Demo](https://github.com/OrPolyzos/swip-demo)**\n\nTable of Contents\n-----------------\n  * [Description](#Description)\n  * [Examples](#Examples)\n  * [Contributors](#Contributors)\n  * [License](#License)\n  \nDescription\n-----------\nSwi is providing implementations for the Create, Read, Update \u0026 Delete (CRUD) operations of an Entity (ResourcePersistable)  \n*  CRUD REST API\n   *  exposing directly the ResourcePersistable\n   *  exposing a DTO instead of the ResourcePersistable\n*  CRUD MVC API (ServerSide Rendering using a compatible Template Engine of your choice)\n   *  exposing directly the ResourcePersistable\n   *  exposing a DTO instead of the ResourcePersistable\n\n__Generic Type Parameters__\n* **R** stands for the class of the ResourcePersistable, the one annotated with @Entity (e.g. User)\n* **I** stands for the class of the primary key of the ResourcePersistable, the one annotated with @Id (e.g. Long)\n* **D** stands for the class of the DTO that is going to be exposed instead of the ResourcePersistable (e.g. UserDto)\n\n__ResourcePersistable\\\u003cI\\\u003e__\n* Should be implemented by the corresponding Entity (e.g. User)  \n* There is only a single method to be implemented  \n    * `I getRpId();` - Should return the primary key field\n\n__RpService\\\u003cR extends ResourcePersistable\\\u003cI\\\u003e, I extends Serializable, D\\\u003e extends ResourcePersistableService\\\u003cD, I\\\u003e__\n* It is responsible for the communication with the corresponding CrudRepository\u003cR,I\u003e\n* Should be implemented by the @Service for the corresponding ResourcePersistable (e.g. UserService)\n* There are 3 methods to be implemented\n    * `CrudRepository\u003cR, I\u003e getRepository();` - Should return the corresponding CrudRepository\u003cR,I\u003e (e.g. UserRepository)\n    * `Function\u003cR, D\u003e getEntityToDtoConverter();` - Should provide a way for the ResourcePersistable to be converted to the DTO\n    * `Function\u003cD, R\u003e getDtoToEntityConverter();` - Should provide a way for the DTO to be converted to the ResourcePersistable\n\n__NoDtoRpService\\\u003cR extends ResourcePersistable\\\u003cI\\\u003e, I extends Serializable\\\u003e extends RpService\\\u003cR, I, R\\\u003e__\n* NoDtoRpService should be used if we want to expose directly the ResourcePersistable\n* Everything from RpService applies to NoDtoRpService, with the difference of 2 already implemented methods\n    * `default Function\u003cR, R\u003e getEntityToDtoConverter() { return Function.identity(); }`\n    * `default Function\u003cR, R\u003e getDtoToEntityConverter() { return Function.identity(); }`\n\n__RpRestController\\\u003cD, I extends Serializable\u003e extends ResourcePersistableRestController\\\u003cD, I\\\u003e__\n* It is responsible for the communication with the corresponding ResourcePersistableService\u003cR, I\u003e\n* Provides a REST API for the CRUD operations of the ResourcePersistable\n* Should be implemented by the @RestController for the corresponding ResourcePersistable (e.g. UserRestController)\n* There is only a single method to be implemented  \n    * `ResourcePersistableService\u003cD, I\u003e getService();` - Should return the corresponding ResourcePersistableService\u003cD,I\u003e (e.g. UserService)\n\n__RpViewController\\\u003cD, I extends Serializable\\\u003e extends ResourcePersistableViewController\\\u003cD, I\\\u003e__\n* It is responsible for the communication with the corresponding ResourcePersistableService\u003cR, I, D\u003e\n* Provides a MVC API for the CRUD operations of the ResourcePersistable\n* Should be implemented by the @Controller for the corresponding ResourcePersistable (e.g. UserController)\n* There is only a single method to be implemented  \n    * `ResourcePersistableService\u003cD, I\u003e getService();` - Should return the corresponding ResourcePersistableService\u003cD,I\u003e (e.g. UserService)\n    \nExamples\n--------\n* [CRUD REST API exposing the Entity](https://github.com/OrPolyzos/spring-web-initializr/wiki/Example:-CRUD-REST-API-exposing-the-Entity)\n* [CRUD REST API exposing the Data Transfer Object (DTO)](https://github.com/OrPolyzos/spring-web-initializr/wiki/Example:-CRUD-REST-API-exposing-the-Data-Transfer-Object-(DTO))\n* [CRUD MVC API exposing the Entity](https://github.com/OrPolyzos/spring-web-initializr/wiki/Example:-CRUD-MVC-API-exposing-the-Entity)\n* [CRUD MVC API exposing the Data Transfer Object (DTO)](https://github.com/OrPolyzos/spring-web-initializr/wiki/Example:-CRUD-MVC-API-exposing-the-Data-Transfer-Object-(DTO))\n\n\nContributors\n------------\n\u003c!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --\u003e\n\u003c!-- prettier-ignore --\u003e\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003ctd align=\"center\"\u003e\n      \u003ca href=\"https://github.com/orpolyzos\"\u003e\n        \u003cimg src=\"https://avatars0.githubusercontent.com/u/27271443?s=460\u0026v=4\" width=\"100px;\" alt=\"Orestes Polyzos\"/\u003e\n        \u003cbr /\u003e\n        \u003csub\u003e\u003cb\u003eOrestes Polyzos\u003c/b\u003e\u003c/sub\u003e\n      \u003c/a\u003e\n     \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c!-- ALL-CONTRIBUTORS-LIST:END --\u003e  \n__To contribute to Spring Web Initializr, follow the instructions in our [contributing guide](/contributing.md)__\n\nLicense\n-------\nSpring Web Initializr is licensed under the [MIT](/license.md) license.  \nCopyright \u0026copy; 2019, Orestes Polyzos\n\n[shield-release]: https://img.shields.io/badge/release-2.0.0-blue.svg\n[shield-jdk]: https://img.shields.io/badge/jdk-8-blue.svg\n[shield-spring]: https://img.shields.io/badge/spring-2.2.1-blue.svg\n[shield-license]: https://img.shields.io/badge/license-MIT-blue.svg\n[shield-build]: https://github.com/OrPolyzos/spring-web-initializr/workflows/build/badge.svg\n[shield-tests]: https://github.com/OrPolyzos/spring-web-initializr/workflows/tests/badge.svg\n[shield-coverage]: https://img.shields.io/badge/coverage-92%25-brightgreen.svg\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forpolyzos%2Fspring-web-initializr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Forpolyzos%2Fspring-web-initializr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Forpolyzos%2Fspring-web-initializr/lists"}