{"id":22213977,"url":"https://github.com/xmlking/reactive-apps","last_synced_at":"2025-07-27T12:31:58.106Z","repository":{"id":142313680,"uuid":"91307592","full_name":"xmlking/reactive-apps","owner":"xmlking","description":":racehorse: Reactive Apps with Spring 5","archived":false,"fork":false,"pushed_at":"2017-12-13T02:11:59.000Z","size":455,"stargazers_count":14,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-05-01T20:22:20.227Z","etag":null,"topics":["docker","gradle","kotlin","mongodb","netty","reactive-programming","reactive-streams","spring-webflux","spring5","thymeleaf","webflux"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/xmlking.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2017-05-15T07:26:22.000Z","updated_at":"2024-05-01T20:22:20.228Z","dependencies_parsed_at":"2024-02-15T05:43:34.326Z","dependency_job_id":null,"html_url":"https://github.com/xmlking/reactive-apps","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/xmlking%2Freactive-apps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Freactive-apps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Freactive-apps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xmlking%2Freactive-apps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xmlking","download_url":"https://codeload.github.com/xmlking/reactive-apps/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227802821,"owners_count":17822113,"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":["docker","gradle","kotlin","mongodb","netty","reactive-programming","reactive-streams","spring-webflux","spring5","thymeleaf","webflux"],"created_at":"2024-12-02T21:12:51.310Z","updated_at":"2024-12-02T21:12:52.010Z","avatar_url":"https://github.com/xmlking.png","language":"Kotlin","readme":"Reactive Apps\n=============\nA simple demo application showcases end-to-end `Functional Reactive Programming (FRP)` with Spring 5.\n\n![Reactive](./docs/reactive-apps.png \"Reactive App\")\n\n##### Technology stack\n* Spring Framework 5\n* Spring Boot 2.0.0\n* Spring WebFlux\n* Embedded MongoDB\n* Reactive MongoDB Driver\n* Gradle 4\n\n##### Highlights\n* Use of Server-Sent Events (SSE) rendered in HTML by Thymeleaf from a reactive data stream.\n* Use of Server-Sent Events (SSE) rendered in JSON by Spring WebFlux from a reactive data stream. \n* Use of Spring Data MongoDB's reactive (Reactive Streams) driver support.\n* Use of Spring Data MongoDB's support for infinite reactive data streams based on MongoDB tailable cursor (see [here](https://docs.mongodb.com/manual/core/tailable-cursors/)). \n* Use of Thymeleaf's fully-HTML5-compatible syntax.\n* Use of `webjars` for client-side dependency managements.\n* Reactive Netty as a server\n* Multi-project builds with Gradle Kotlin Script. \n* Kotlin as a language\n* Cross-Origin Resource Sharing (CORS)\n* Docker deployment\n\n\n### Prerequisites\n1. Gradle 4 (Install via [sdkman](http://sdkman.io/))\n2. Docker for Mac [Setup Instructions](./docs/Docker.md)\n\n### Build\n```bash\n# build all 3 executable jars\ngradle build\n# continuous build with `-t`. \n# this shoud be started before any run tasks i.e., `gradle ui-app:bootRun`, for spring's devtools to work.\ngradle -t build\n# build all 3 apps\ngradle build -x test -x shared:build\n# build all 3 docker images\ngradle docker -x test -x shared:build\n```\n\n### Test\n```bash\ngradle test\n```\n\n### Run\n##### Manual \nStart all 3 apps: [mongo-data-service](./mongo-data-service/), [stream-service](./stream-service/), [ui-app](./ui-app/)\n\u003e If you want to debug the app, add --debug-jvm parameter to Gradle command line\n\n##### Docker\nYou can also build Docker images and run all via `Docker Compose`\n```bash\n# start containers in the background\ndocker-compose up -d\n# start containers in the foreground\ndocker-compose up \n# show runnning containers \ndocker-compose ps\n# scaling containers and load balancing\ndocker-compose scale stream=2\n# 1. stop the running containers using\ndocker-compose stop\n# 2. remove the stopped containers using\ndocker-compose rm -f\n# start specific docker-compose file\ndocker-compose  -f docker-compose-all.yml up\n# see logs of a service \ndocker-compose -f docker-compose-all.yml logs  mongodb\n# connect(ssh) to a service and run a command\ndocker-compose -f docker-compose-all.yml exec mongodb mongo -u \"admin\" -p \"admin\" --authenticationDatabase \"admin\"\n# restart single service\ndocker-compose -f docker-compose-all.yml restart mongodb\n# start single service\ndocker-compose -f docker-compose-all.yml up mongodb\n# check health for a service\ndocker inspect --format \"{{json .State.Health.Status }}\" reactiveapps_app_1\ndocker ps\n```\n\u003eAccess UI App at http://localhost:8080\n\n\n### Gradle Commands\n```bash\n# upgrade project gradle version\ngradle wrapper --gradle-version 4.2-rc-2 --distribution-type all\n# gradle daemon status \ngradle --status\ngradle --stop\n```\n\n### Credits\n* [MiXiT](https://github.com/mixitconf/mixit)\n* [Stéphane Nicoll](https://github.com/snicoll-demos/demo-webflux-streaming)\n* [Daniel Fernández](https://github.com/danielfernandez/reactive-matchday)\n* [Stathis Souris](https://ssouris.github.io/2017/06/02/petclinic-spring-5-kotlin-reactive-mongodb.html)\n* [Sébastien Deleuze](https://github.com/sdeleuze/spring-kotlin-functional) \n\n### TODO\n* [spring-kotlin-functional](https://github.com/sdeleuze/spring-kotlin-functional)\n* [service-blocks](https://github.com/kbastani/service-block-samples)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Freactive-apps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxmlking%2Freactive-apps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxmlking%2Freactive-apps/lists"}