This project is a reactive Java login application built using Spring WebFlux and integrates with Oracle Database 21c XE using its reactive R2DBC driver. It showcases how to create a non-blocking, asynchronous login backend with modern Java technologies.
- Java 17+
- Spring Boot (WebFlux)
- R2DBC (Reactive Relational Database Connectivity)
- Oracle Database 21c XE (Express Edition)
- Oracle R2DBC Reactive Driver
- Gradle (build tool)
git clone https://github.com/TwizzyBomb/fun.git
cd fun- Install Oracle Database 21c XE
- Start the database and create a user and schema:
CREATE USER login_app IDENTIFIED BY your_password;
GRANT CONNECT, RESOURCE TO login_app;- Create the
userstable:
CREATE TABLE login_app.users (
id NUMBER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
username VARCHAR2(255) UNIQUE NOT NULL,
password VARCHAR2(255) NOT NULL
);In src/main/resources/application.yml (or .properties), update:
spring:
r2dbc:
url: r2dbc:oracle://localhost:1521/XEPDB1
username: login_app
password: your_password
main:
web-application-type: reactiveMake sure Gradle is installed, then:
./gradlew clean build./gradlew bootRunYour reactive login API will be available at:
http://localhost:8080/login
| Method | Endpoint | Description |
|---|---|---|
| POST | /login |
Authenticate user |
| POST | /register |
Create new account |
You can test with Postman or curl:
curl -X POST http://localhost:8080/register \
-H "Content-Type: application/json" \
-d '{"username":"testuser", "password":"secret"}'- Ensure Oracle R2DBC dependencies are included in
build.gradle - For password storage, consider hashing (e.g., BCrypt)
- Supports full non-blocking reactive flow end-to-end
This project is licensed under the MIT License.