A full‑stack notes app with an auditable Cardano Preview Testnet trail for every note action.
- Backend: Spring Boot 3 (Java 17, JPA, MySQL) — REST API + blockchain proof storage (
backend/) - Frontend: React + Vite — wallet flow + Blockfrost integration (
frontend/)
The UI never stores private keys. Signing always happens inside a CIP-30 compatible wallet (Lace, Nami, Eternl, ...). The backend only persists the business data plus the blockchain proof (content_hash, last_tx_hash).
| Actor | Responsibilities |
|---|---|
| React/Vite frontend | Generates SHA-256 content hash, prepares metadata, connects to wallet, asks wallet to sign, submits signed TX through Blockfrost, sends note + txHash + contentHash to backend |
| Spring Boot backend | Stores note, owner_wallet, content_hash, and last_tx_hash in MySQL; exposes CRUD APIs used by the UI |
| Cardano blockchain | Holds immutable metadata for CREATE/UPDATE/DELETE actions (no note content) |
All blockchain activity runs against the Cardano Preview Testnet using Blockfrost.
Before installing the project, make sure you have the following installed on your system:
-
Java 17 SDK
- Download from: Oracle JDK 17 or OpenJDK 17
- Verify installation:
java -version
-
Node.js 18+ and npm
- Download from: Node.js Official Website
- Verify installation:
node -vandnpm -v
-
MySQL 8+
- Download from: MySQL Community Server
- Verify installation:
mysql --version
-
Maven (if not using IDE)
- Download from: Apache Maven
- Verify installation:
mvn -version
-
IDE (Choose one):
- IntelliJ IDEA Community or Ultimate (Recommended)
- you can get free license for Ultimate here
- VS Code with Java extensions
- Wallet extension — Lace (recommended) or any CIP-30 wallet switched to the Preview Testnet
- Blockfrost Project ID — create a Preview project at Blockfrost.io
- Test ADA — fund your wallet via the Cardano faucet (keep ~5 ADA for fees)
-
Clone the repository to your local directory using one of the following methods:
- Command Line:
git clone https://github.com/pawekz/RedMatrix-App.git
- VS Code (User Interface):
- Open VS Code.
- Go to the Source Control panel (or use
Ctrl+Shift+G). - Click "Clone Repository" and enter your repository URL (https://github.com/pawekz/RedMatrix-App.git).
- Select a local folder to clone into.
- IntelliJ IDEA (User Interface):
- Open IntelliJ IDEA.
- On the Welcome screen, click "Get from VCS".
- Paste your repository URL (https://github.com/pawekz/RedMatrix-App.git) and choose a directory.
- Click "Clone".
- Command Line:
-
Navigate to the project directory:
cd RedMatrixNotesApp
- Start MySQL locally and create the database:
CREATE DATABASE IF NOT EXISTS redmatrix_notes CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
- Update database credentials in
backend/src/main/resources/application.propertiesif needed:spring.datasource.username=root spring.datasource.password=root
- Navigate to the backend directory:
cd backend - Install the dependencies using Maven:
mvn clean install
- Start the backend server:
mvn spring-boot:run
- The backend should now be running at http://localhost:8080/.
When running locally, the backend schema auto-creates tables defined in backend/src/main/resources/schema.sql and seeds optional demo data from data.sql.
- Navigate to the frontend directory:
cd frontend - Install the dependencies using npm:
npm install
- Start the frontend development server:
npm run dev
- The frontend should now be running at http://localhost:5173/.
Tip: keep backend and frontend running together for the full blockchain experience. The UI will block C/U/D actions until a wallet is connected.
Congratulations! You have successfully set up the RedMatrix Notes App project on your local machine (running both Frontend and Backend).
Edit: backend/src/main/resources/application.properties
# Example customizations
server.port=8080
spring.datasource.url=jdbc:mysql://localhost:3306/redmatrix_notesThe Note entity (backend/src/main/java/com/redmatrix/notesapp/entity/Note.java) already contains ownerWallet, contentHash, and lastTxHash fields used for on-chain verification. No extra backend setup is needed beyond database credentials.
IntelliJ tip: this project already expects environment variables named
DB_URL,DB_USERNAME, andDB_PASSWORD(seeapplication.properties). Open Run/Debug Configurations → Modify options → Environment variables and define those keys there so IntelliJ injects the secrets without hardcoding them.
Create: frontend/.env
VITE_API_URL=http://localhost:8080
VITE_BLOCKFROST_PROJECT_ID=your_preview_project_idVITE_API_URLdefaults to the deployed backend but should be pointed to your local instance for development.VITE_BLOCKFROST_PROJECT_IDis required for submitting signed transactions insidefrontend/src/services/blockchainService.js.
IntelliJ tip: if you prefer IntelliJ to inject secrets, set Environment variables in your Vite run configuration (e.g., define only
VITE_BLOCKFROST_PROJECT_IDif that is the value you keep outside.env).
Restart npm run dev after editing .env.
| Issue | Solution |
|---|---|
| ❌ Cannot connect to DB | Ensure MySQL is running, credentials match, and redmatrix_notes database exists |
| ❌ Port conflicts | Change server.port in backend properties or Vite dev server port via vite.config.js |
| ❌ Maven/Java version | Confirm Project SDK is Java 17 and reload Maven |
| ❌ Extensions not working (VS Code) | Reload VS Code window: Ctrl+Shift+P → Developer: Reload Window |
| ❌ No wallets detected | Install Lace/Nami/Eternl, refresh the app, and confirm the wallet is on Preview Testnet |
| ❌ Transaction failed | Verify you still have test ADA, the wallet is unlocked, and your Blockfrost key targets Preview |
| ❌ Note actions stuck | The UI requires a connected wallet before calling backend APIs |
| ❌ Wallet doesn't appear when creating / updating / deleting notes | Check network connection, change DNS Server to 8.8.8.8 or use Cloudflare WARP VPN |
Note: This project currently serves frontend and backend separately. If you want Spring Boot to serve the built frontend, configure static resources (e.g., copy frontend/dist to backend/src/main/resources/static during build or use a reverse proxy).
- User action — create/update/delete inside
frontend/src/components/NotePad.jsxorNotesGrid.jsx. - Hashing — the UI computes
contentHash = SHA256(content)before any network calls. - Wallet signing —
frontend/src/hooks/useWallet.jsrequests a CIP-30 wallet connection, then asks it to sign metadata describing the action. - Blockfrost submission — the signed bytes are POSTed to Blockfrost
/tx/submitusingVITE_BLOCKFROST_PROJECT_ID; Blockfrost returns the finaltxHash. - API call — the frontend sends the note payload +
contentHash+txHashtobackend/src/main/java/com/redmatrix/notesapp/controller/NoteController.java. - Persistence —
NoteServicepersists the record, storing the blockchain proof for later audits.
No PII lives on-chain. The Cardano metadata (label 674) looks like:
{
"674": {
"msg": ["CREATE"],
"noteId": "12",
"contentHash": "a39f92bf12...",
"owner": "addr1...",
"timestamp": "1731891234567"
}
}During incident response you can verify integrity by comparing content_hash (database) with the hash embedded in the Cardano transaction.
- Wallet ownership and signing remain inside the browser extension; the backend never touches private keys.
- Only hashes and metadata are public. Note titles/content stay in MySQL.
- Tamper detection: if a note changes outside the app, its recomputed hash will no longer match the on-chain record, signaling integrity issues.