Development Setup

Prerequisites

ToolVersionPurpose
GraalVM JDK21Runtime, compilation, and optional native image
Maven3.8+Build system
Git2.xVersion control
IDEIntelliJ IDEA recommendedDevelopment

Clone & Build

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

Run

mvn exec:java

Server starts on http://localhost:8899.

Windows Classpath Approach

The exec:java plugin may not work on Windows. Use:

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.

IDE Setup (IntelliJ IDEA)

  1. Open the project as a Maven project
  2. Enable annotation processing: Settings > Build > Compiler > Annotation Processors > Enable
  3. Install the Lombok plugin if not already present
  4. Import code style from the project settings (if available)

Project Structure

firmiana/
├── pom.xml                          # Maven build config
├── src/main/java/com/firmiana/matrix/
│   ├── Application.java             # Entry point
│   ├── config/                      # Configuration classes
│   ├── controller/                  # HTTP controllers (43+)
│   │   ├── auth/                    # Login, register, logout
│   │   ├── room/                    # Room operations
│   │   ├── user/                    # Profile, presence
│   │   ├── device/                  # Device management
│   │   └── media/                   # Media upload/download
│   ├── entity/                      # Data entities
│   ├── exception/                   # Error handling
│   ├── federation/                  # Server-Server API
│   ├── repository/                  # Data repositories
│   ├── request/                     # Request DTOs
│   ├── response/                    # Response DTOs
│   ├── security/                    # Auth, tokens, UIAA
│   └── service/                     # Business logic
├── src/main/resources/
│   ├── application.yml              # Configuration
│   ├── logback.xml                  # Logging config
│   └── db/migration/               # Flyway SQL migrations
├── src/test/java/                   # Test classes
├── docs/plan/                       # Implementation plans
└── data/                            # H2 database files (gitignored)

Key Dependencies

DependencyPurpose
micronaut-http-server-nettyHTTP server
micronaut-data-jdbcData access
micronaut-securityAuthentication
h2Embedded database
flyway-coreSchema migrations
lombokCode generation
jackson-databindJSON serialization