Quick Start

Prerequisites

  • GraalVM JDK 21 (not just JRE)
  • Maven 3.8+
  • Git

Verify your setup:

java --version    # Should show GraalVM 21.x
mvn --version     # Should show 3.8+

Build

git clone https://gitcode.com/qiusls/firmiana.git
cd firmiana
mvn compile

Run

mvn exec:java

The server starts on http://localhost:8899.

Verify

Check the server is running:

curl http://localhost:8899/_matrix/client/versions

Expected response:

{
  "versions": ["v1.1", "v1.2", "v1.3", "v1.4", "v1.5", "v1.6"],
  "unstable_features": {
    "org.matrix.msc2965": true
  }
}

Register a User

curl -X POST http://localhost:8899/_matrix/client/v3/register \
  -H "Content-Type: application/json" \
  -d '{
    "username": "alice",
    "password": "secret123",
    "auth": {
      "type": "m.login.dummy"
    }
  }'

Save the access_token from the response — you'll need it for all subsequent requests.

Send a Message

# Create a room
curl -X POST http://localhost:8899/_matrix/client/v3/createRoom \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"name": "Test Room"}'

# Send a message (replace ROOM_ID with the actual room ID)
curl -X PUT http://localhost:8899/_matrix/client/v3/rooms/{roomId}/send/m.room.message/msg1 \
  -H "Authorization: Bearer <access_token>" \
  -H "Content-Type: application/json" \
  -d '{"msgtype": "m.text", "body": "Hello, Matrix!"}'

Connect with Element

  1. Open Element Web or Element Desktop
  2. Go to Settings > Advanced > Other homeserver
  3. Enter http://localhost:8899
  4. Register or login with the credentials above

Alternative: Classpath Startup

On Windows, the exec:java plugin may not work. Use the classpath approach instead:

mvn dependency:build-classpath -q -DincludeScope=runtime -Dmdep.outputFile=target/cp.txt
java -cp "target/classes;$(cat target/cp.txt)" com.firmiana.matrix.Application

Run Tests

mvn test

Expected: 244 tests, 0 failures.