notedeck/README.md

114 lines
2.7 KiB
Markdown
Raw Permalink Normal View History

# Damus
2023-11-29 04:32:40 +00:00
A multiplatform nostr client. Works on android and desktop
Alpha! WIP!
## Desktop
The desktop client is called notedeck:
![notedeck](https://cdn.jb55.com/s/notedeck-2024-04.png)
## Android
Look it actually runs on android!
<img src="https://cdn.jb55.com/s/bebeeadf7001fae1.png" height="500px" />
## Usage
You can customize the columns by passing them as command-line arguments. This is only for testing and will likely change.
```bash
$ ./target/release/notedeck "$(cat queries/timeline.json)" "$(cat queries/notifications.json)"
```
# Developer Setup
## Desktop (Linux/MacOS, Windows?)
If you're running debian-based machine like Ubuntu or ElementaryOS, all you need is to install [rustup] and run `sudo apt install build-essential`.
First, install [nix][nix] if you don't have it.
2023-11-29 04:43:40 +00:00
The `shell.nix` provides a reproducible build environment, mainly for android but it also includes rust tools if you don't have those installed. It will likely work without nix if you are just looking to do non-android dev and have the rust toolchain already installed. If you decide to use nix, I recommend using [direnv][direnv] to load the nix shell environment when you `cd` into the directory.
2023-11-29 04:43:40 +00:00
If you don't have [direnv][direnv], enter the dev shell via:
```bash
$ nix-shell
```
2023-11-29 04:43:40 +00:00
Once you have your dev shell setup, you can build with this command:
```bash
$ cargo run --release
2023-11-29 04:43:40 +00:00
```
## Android
The dev shell should also have all of the android-sdk dependencies needed for development, but you still need the `aarch64-linux-android` rustup target installed:
```
$ rustup target add aarch64-linux-android
```
2023-11-29 04:43:40 +00:00
To run on a real device, just type:
```bash
$ cargo apk run --release
```
## Android Emulator
- Install [Android Studio](https://developer.android.com/studio)
- Open 'Device Manager' in Android Studio
- Add a new device with API level `34` and ABI `arm64-v8a` (even though the app uses 30, the 30 emulator can't find the vulkan adapter, but 34 works fine)
- Start up the emulator
while the emulator is running, run:
2023-11-29 04:43:40 +00:00
```bash
cargo apk run --release
2023-11-29 04:43:40 +00:00
```
The app should appear on the emulator
2023-11-29 04:43:40 +00:00
[direnv]: https://direnv.net/
[nix]: https://nixos.org/download/
## Previews
You can preview individual widgets and views by running the preview script:
```bash
./preview RelayView
./preview ProfilePreview
# ... etc
```
When adding new previews you need to implement the Preview trait for your
view/widget and then add it to the `src/ui_preview/main.rs` bin:
```rust
previews!(runner, name,
RelayView,
AccountLoginView,
ProfilePreview,
);
```
## Contributing
Configure the developer environment:
```bash
./scripts/dev_setup.sh
```
This will add the pre-commit hook to your local repository to suggest proper formatting before commits.
[rustup]: https://rustup.rs/