Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hantsy/angular-spring-websocket-sample
Demo for using Angular and Spring Reactive WebSocket together
https://github.com/hantsy/angular-spring-websocket-sample
angular reactive spring-data-mongodb spring-webflux websocket
Last synced: about 2 months ago
JSON representation
Demo for using Angular and Spring Reactive WebSocket together
- Host: GitHub
- URL: https://github.com/hantsy/angular-spring-websocket-sample
- Owner: hantsy
- License: gpl-3.0
- Created: 2020-07-15T14:43:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-01-31T08:33:50.000Z (11 months ago)
- Last Synced: 2024-10-10T18:44:15.756Z (2 months ago)
- Topics: angular, reactive, spring-data-mongodb, spring-webflux, websocket
- Language: TypeScript
- Homepage: https://medium.com/@hantsy/building-a-chat-application-with-angular-and-spring-reactive-websocket-400e0769f4ec
- Size: 331 KB
- Stars: 13
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular-spring-websocket-sample
This sample is to demonstrate a chat application using the following cutting-edge technology stack :
* Angular as WebSocket client
* Spring WebFlux based Reactive WebSocket APIs
* In-memory Reactor Sink as a message queue([feat/reactor-sinks branch](https://github.com/hantsy/angular-spring-websocket-sample/tree/feat/reactor-sinks)) or
* Spring Data MongoDB based `@Tailable` query result as an infinite stream## Prerequisites
* NodeJS 14
* OpenJDK 14
* Docker for Windows(or Mac if you are a MacOS user)## Build
Before running the application, you should build and run client and server side respectively.
### Server
Run a MongoDB service firstly, simply you can run it from a Docker container. There is a `docker-compose.yaml` file is ready for you.
```bash
docker-compose up mongodb
```Build the application.
```e
./gradlew build
```Run the target jar from the *build* folder to start up the application.
```bash
java -jar build/xxx.jar
```### Client
Install dependencies.
```bash
npm install
```Start up the application.
```bash
npm run start
```Now you can open a browser and navigate to http://localhost:4200 and have a try.
## Reference
* [How to use Processor in Reactor Java/](https://ducmanhphan.github.io/2019-08-25-How-to-use-Processor-in-Reactor-Java)
* [How To Build a Chat App Using WebFlux, WebSockets & React ](https://blog.monkey.codes/how-to-build-a-chat-app-using-webflux-websockets-react/)