https://github.com/theborakompanioni/nostr-spring-boot-starter
Write Nostr applications with Spring Boot.
https://github.com/theborakompanioni/nostr-spring-boot-starter
java nostr spring spring-boot
Last synced: 28 days ago
JSON representation
Write Nostr applications with Spring Boot.
- Host: GitHub
- URL: https://github.com/theborakompanioni/nostr-spring-boot-starter
- Owner: theborakompanioni
- License: apache-2.0
- Created: 2024-02-04T19:05:34.000Z (over 1 year ago)
- Default Branch: devel
- Last Pushed: 2025-04-11T20:27:57.000Z (29 days ago)
- Last Synced: 2025-04-12T08:18:22.453Z (28 days ago)
- Topics: java, nostr, spring, spring-boot
- Language: Java
- Homepage:
- Size: 1.32 MB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: readme.md
- Changelog: changelog.md
- Contributing: contributing.md
- License: LICENSE
Awesome Lists containing this project
- awesome-nostr - nostr-spring-boot-starter - spring-boot-starter.svg?style=social) - Spring boot starter projects for building Nostr applications. (Libraries / Client reviews and/or comparisons)
README
[](https://github.com/theborakompanioni/nostr-spring-boot-starter/actions/workflows/build.yml)
[](https://github.com/theborakompanioni/nostr-spring-boot-starter/releases/latest)
[](https://search.maven.org/#search|g%3A%22io.github.theborakompanioni%22)
[](https://github.com/theborakompanioni/nostr-spring-boot-starter/blob/master/LICENSE)
![]()
nostr-spring-boot-starter
===Spring boot starter projects for building [Nostr](https://github.com/nostr-protocol/nostr) applications.
Whether you're building your own client or custom relay software, this framework provides most of what you
need to write scalable and efficient solutions effortlessly.**Note**: Most code is still experimental - **this is work in progress**.
- [x] [NIP-1](https://github.com/nostr-protocol/nips/blob/master/01.md)
- [x] [NIP-6](https://github.com/nostr-protocol/nips/blob/master/06.md)
- [x] [NIP-9](https://github.com/nostr-protocol/nips/blob/master/09.md)
- [x] [NIP-10](https://github.com/nostr-protocol/nips/blob/master/10.md)
- [x] [NIP-13](https://github.com/nostr-protocol/nips/blob/master/13.md)
- [x] [NIP-18](https://github.com/nostr-protocol/nips/blob/master/18.md)
- [x] [NIP-19](https://github.com/nostr-protocol/nips/blob/master/19.md)
- [x] [NIP-21](https://github.com/nostr-protocol/nips/blob/master/21.md)
- [x] [NIP-24](https://github.com/nostr-protocol/nips/blob/master/24.md)
- [x] [NIP-25](https://github.com/nostr-protocol/nips/blob/master/25.md)
- [x] [NIP-30](https://github.com/nostr-protocol/nips/blob/master/30.md)
- [x] [NIP-38](https://github.com/nostr-protocol/nips/blob/master/38.md)
- [x] [NIP-40](https://github.com/nostr-protocol/nips/blob/master/40.md)
- [x] [NIP-42](https://github.com/nostr-protocol/nips/blob/master/42.md)
- [x] [NIP-50](https://github.com/nostr-protocol/nips/blob/master/50.md)
- [x] [NIP-65](https://github.com/nostr-protocol/nips/blob/master/65.md)Planned:
- [ ] [NIP-02](https://github.com/nostr-protocol/nips/blob/master/02.md)
- [ ] [NIP-11](https://github.com/nostr-protocol/nips/blob/master/11.md)
- [ ] [NIP-45](https://github.com/nostr-protocol/nips/blob/master/45.md)
- [ ] [NIP-64](https://github.com/nostr-protocol/nips/blob/master/64.md)
- [ ] [NIP-70](https://github.com/nostr-protocol/nips/blob/master/70.md)### `nostr-proto`
See [nostr-proto](https://github.com/theborakompanioni/nostr-proto) for protobuf definitions.
```protobuf
message Event {
bytes id = 1 [json_name = "id"];
bytes pubkey = 2 [json_name = "pubkey"];
uint64 created_at = 3 [json_name = "created_at"];
uint32 kind = 4 [json_name = "kind"];
repeated TagValue tags = 5 [json_name = "tags"];
string content = 6 [json_name = "content"];
bytes sig = 7 [json_name = "sig"];
}[...]
```### `nostr-template`
Publish events easily.
```java
NostrTemplate template = new SimpleNostrTemplate(RelayUri.parse("wss://relay.damus.io"));
Signer signer = SimpleSigner.random();Event event = MoreEvents.finalize(signer, Nip40.expire(
Nip1.createTextNote(signer.getPublicKey(), "GM"),
Instant.now().plusSeconds(60)
));template.send(event).block(Duration.ofSeconds(5));
```## Table of Contents
- [Install](#install)
- [Examples](#examples)
- [Development](#development)
- [Contributing](#contributing)
- [Resources](#resources)
- [License](#license)## Install
[Download](https://search.maven.org/#search|g%3A%22io.github.theborakompanioni%22) from Maven Central.
### Gradle
```groovy
repositories {
mavenCentral()
}
``````groovy
implementation "io.github.theborakompanioni:nostr-proto:${nostrSpringBootStarterVersion}"
```## Examples
[This project contains various examples](examples/) that are stand-alone applications showing basic usage of the functionality provided.
| Application | Description |
|------------------------------------------------------------|----------------------------------------------------------------------------------|
| [nostr-client](nostr-client-example-application/readme.md) | A simple Nostr client example application that subscribes to all kind `1` notes. |
| [nostr-relay](nostr-relay-example-application/readme.md) | A simple Nostr relay example application. |
| [nostr-shell](nostr-shell-example-application/readme.md) | A simple Nostr shell example application, e.g. to "mine" notes (NIP-13). |## Development
### Requirements
- java >=21
- docker### Build
```shell script
./gradlew build -x test
```### Test
```shell script
./gradlew test integrationTest --rerun-tasks --no-parallel
```Run full test suite (including load tests):
```shell script
CI=true ./gradlew test integrationTest e2eTest --rerun-tasks --no-parallel
```## Contributing
All contributions and ideas are always welcome. For any question, bug or feature request,
please create an [issue](https://github.com/theborakompanioni/nostr-spring-boot-starter/issues).
Before you start, please read the [contributing guidelines](contributing.md).## Resources
- nostr (GitHub): https://github.com/nostr-protocol/nostr
- NIPs (GitHub): https://github.com/nostr-protocol/nips---
- nostr.com: https://nostr.com
- nostr Relay Registry: https://nostr-registry.netlify.app
- awesome-nostr (GitHub): https://github.com/aljazceru/awesome-nostr
- protocol-buffers: https://developers.google.com/protocol-buffers/docs/proto3#json## License
The project is licensed under the Apache License. See [LICENSE](LICENSE) for details.