A real-time chat client built with JavaFX 25 and powered by ntfy as the messaging backend.
This project was developed as a school assignment during my Java studies. I'm including it in my portfolio as it demonstrates real-time messaging, JavaFX, MVC architecture, and testing.
- MVC architecture — clean separation between
HelloFX(app),HelloController(controller), andHelloModel(model) - Send messages to a configurable ntfy topic via JSON POST
- Receive messages in real time via JSON stream
- Switch topics — change the topic name and reconnect on the fly with the "Connect" button
- Connection status indicator — live 🟢/🔴 status showing whether you're connected to a topic
- Environment-based configuration — backend URL loaded from a
.envfile (excluded from version control) - Unit tested — model layer covered with JUnit 5, AssertJ, and Mockito
| Layer | Technology |
|---|---|
| Language | Java 25 |
| UI Framework | JavaFX 25 (Controls + FXML) |
| HTTP | java.net.http (built-in Java HTTP Client) |
| JSON | Jackson Databind 3.0 |
| Configuration | dotenv-java 3.2 |
| Testing | JUnit Jupiter 6, AssertJ 3.27, Mockito 5.20, WireMock 4.0 |
| Build | Maven (with Maven Wrapper) |
- JDK 25 (set
JAVA_HOMEaccordingly) - No separate Maven installation required — the included Maven Wrapper (
mvnw) handles it
Create a .env file in the project root with your ntfy backend URL:
NTFY_URL=https://ntfy.sh
The
.envfile is listed in.gitignoreand will not be committed.
./mvnw clean javafx:runOn Windows:
mvnw.cmd clean javafx:runJavaFX-Chat-App/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ ├── module-info.java
│ │ │ └── com/example/
│ │ │ ├── HelloFX.java # Application entry point
│ │ │ ├── HelloController.java # FXML controller
│ │ │ ├── HelloModel.java # Business logic / model
│ │ │ ├── NtfyConnection.java # Connection abstraction
│ │ │ ├── NtfyConnectionImpl.java # HTTP-based ntfy connection
│ │ │ └── NtfyMessageDto.java # Message data transfer object
│ │ └── resources/com/example/
│ │ └── hello-view.fxml # FXML UI layout
│ └── test/java/com/example/
│ ├── HelloModelTest.java # Model unit tests
│ ├── NtfyConnectionSpy.java # Test spy
│ └── NtfyConnectionStub.java # Test stub
├── .github/workflows/classroom.yml # CI autograding workflow
├── pom.xml
└── README.md
This project is for educational purposes.