Skip to content
forked from vaadin/hilla

The modern frontend framework for Java backends. Build fast reactive web apps with full type safety. Supports React and Lit / Web Components. Powered by Spring Boot. Built by Vaadin.

License

Notifications You must be signed in to change notification settings

kjordan2001/hilla

 
 

Repository files navigation

Hilla

The modern web framework for Java

Latest Stable Version Releases

hilla.dev · Docs · Chat


Hilla integrates a Spring Boot Java backend with a reactive TypeScript front end. It helps you build apps faster with type-safe server communication, included UI components, and integrated tooling.

Simple type-safe server communication

Hilla helps you access the backend easily with type-safe endpoints.

index.ts

// Type info is automatically generated based on Java
import Person from 'Frontend/generated/dev/hilla/demo/entity/Person';
import { PersonEndpoint } from 'Frontend/generated/endpoints';

async function getPeopleWithPhoneNumber() {
  const people: Person[] = await PersonEndpoint.findAll();

  // Compile error: The property is 'phone', not 'phoneNumber'
  return people.filter((person) => !!person.phoneNumber);
}

console.log('People with phone numbers: ', getPeopleWithPhoneNumber());

PersonEndpoint.java

@Endpoint
@AnonymousAllowed
public class PersonEndpoint {

    private PersonRepository repository;

    public PersonEndpoint(PersonRepository repository) {
        this.repository = repository;
    }

    public @Nonnull List<@Nonnull Person> findAll() {
        return repository.findAll();
    }
}

Person.java

@Entity
public class Person {

    @Id
    @GeneratedValue
    private Integer id;

    @Nonnull private String firstName;
    @Nonnull private String lastName;
    @Email @Nonnull private String email;
    @Nonnull private String phone;

    // getters, setters
}

Learn more at hilla.dev

Get started

Follow the tutorials at https://hilla.dev/docs

Contributing

The best way to contribute is to try out Hilla and provide feedback to the development team in our Discord chat or with GitHub issues.

Development

If you want to develop Hilla, you can clone the repo and run tests using the following commands:

git clone https://github.com/vaadin/hilla.git
npm install
npm run build
npm test

You need the following versions of Node.js and npm:

  • Node.js: >= 18 LTS (native support for ES Modules and NodeJS execution of the newest hooks),
  • npm: ^9 (package-lock.json is of version 3)

Frontend CI Java CI codecov

About

The modern frontend framework for Java backends. Build fast reactive web apps with full type safety. Supports React and Lit / Web Components. Powered by Spring Boot. Built by Vaadin.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 70.9%
  • TypeScript 25.5%
  • Kotlin 2.2%
  • Other 1.4%