Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
reyamir committed Jul 8, 2023
1 parent 4cf5330 commit 3752a3a
Show file tree
Hide file tree
Showing 6 changed files with 1,066 additions and 219 deletions.
694 changes: 674 additions & 20 deletions LICENSE

Large diffs are not rendered by default.

91 changes: 16 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,100 +1,41 @@
<p align="center">
<a href="#">
### Introduction

</a>
<p align="center">
<img width="150" height="150" src="https://bafybeiascaupgzgxuoercns33vhxhq7c6oibhvxnzenvurgsjdyr4jp3la.ipfs.w3s.link/macos-512.png" alt="Logo">
</p>
<h1 align="center"><b>Lume</b></h1>
<p align="center">
An ambitious nostr client
<br />
<a href="https://uselume.xyz"><strong>uselume.xyz »</strong></a>
<br />
<b>Download for </b>
macOS
·
Windows
·
Linux
<br />
<i>~ Links will be added once a release is available. ~</i>
</p>
</p>
Lume is an open source cross-platform Nostr client, powered by (<a href="https://tauri.app" target="_blank">Tauri</a>) and web-tech.
<br/>
<br/>
Lume is a nostr client

> NOTE: Lume is under active development, most of the listed features are still experimental and subject to change.
### Usage

Nostr is truly censorship-resistant protocol for social network and messenger app, combine with Bitcoin, they are powerful tools bring you to freedom. Lume is one of many great clients to help you interact with them, built with Tauri and Web-tech aiming for speed and efficiency
Download Lume for your platform here: [https://github.com/luminous-devs/lume/releases](https://github.com/luminous-devs/lume/releases)

Lume is simple as it is, no more buzzwords
Supported platform: macOS, Windows and Linux

<p align="center">
<img src="https://void.cat/d/2oaFfzJsjnKNye6fHTpaq2" alt="App screenshot">
<br />
<br />
</p>
### Develop

## How Nostr works?

Everybody runs a client. It can be a native client, a web client, etc. To publish something, you write a post, sign it with your key and send it to multiple relays (servers hosted by someone else, or yourself). To get updates from other people, you ask multiple relays if they know anything about these other people. Anyone can run a relay. A relay is very simple and dumb. It does nothing besides accepting posts from some people and forwarding to others. Relays don't have to be trusted. Signatures are verified on the client side. [Learn more](https://github.com/nostr-protocol/nostr)

## Motivation

When Nostr became popular, many clients exist but none of them satisfy me, so I built my own. I don't many experence in develop desktop app before, my background is just strongly in Ruby on Rails, this is also a good opportunity for me to improve my skills.

## Development

Prerequisites:

- Nodejs >= 18.0.0
- Install pnpm: [docs](https://pnpm.io/)
- Setup Tauri: [docs](https://tauri.app/v1/guides/getting-started/prerequisites)

Clone repo:

Note: always use `canary` branch for development
Clone project

```
git clone -b canary https://github.com/luminous-devs/lume.git
git clone https://github.com/luminous-devs/lume.git && cd lume
```

Move to clone folder in previous step

```
cd lume/
```

Install dependencies
Install packages

```
pnpm install
```

Run development build
Run dev

```
pnpm tauri dev
```

First time launch app, Lume automatically create local database (sqlite) and run migrations, place at `src-tauri/migrations`
Build

```
Database folder: tauri::api::path::BaseDirectory::App
MacOS: /Users/<username>/Library/Application Support/com.lume.nu/lume.db
pnpm tauri build
```

In `splashscreen` page, Lume will check accounts table has any account or not. If not redirect to `/onboarding`. If present, run `subscribe` to fetch events from `DEFAULT_RELAYS`
(Advance) - Generate SQLite migration

In `/onboarding` page, user can import old `private key` or create new .If import old key, fetch `kind 0, 3` then insert to accounts table in database .If create new, show to user npub/nsec as well as random profile, then move to pre-follows page. Then redirect back to `splashscreen`

**About Lume event processing**

- Lume is using [nostr-relaypool-ts](https://github.com/adamritter/nostr-relaypool-ts) to interact with relays
- When user open app, if `total notes in db == 0`, splashscreen `src/app/page.tsx` will fetch all events from 24 hours ago, if above zero, it will fetch all events since `last time` logged
- When user using app, `event collector` component have role fetch all events since `current time` and save to `database`
- `event collector` also have role update `last time logged` to local storage when user close the app
- Newsfeed page `following or circle` will fetch event from `database` then render in `virtuaso` component
- Lume don't render event directly after get it from relays, event will be saved in database first, and fetch via `sql query`
```
pnpm add-migrate <migrate_name>
```
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"dependencies": {
"@headlessui/react": "^1.7.15",
"@nostr-dev-kit/ndk": "^0.7.3",
"@nostr-dev-kit/ndk": "^0.7.4",
"@radix-ui/react-popover": "^1.0.6",
"@radix-ui/react-tooltip": "^1.0.6",
"@tanstack/react-query": "^4.29.19",
Expand Down Expand Up @@ -70,13 +70,13 @@
"eslint-plugin-simple-import-sort": "^10.0.0",
"husky": "^8.0.3",
"lint-staged": "^13.2.3",
"postcss": "^8.4.24",
"postcss": "^8.4.25",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.3.0",
"prop-types": "^15.8.1",
"tailwindcss": "^3.3.2",
"typescript": "^4.9.5",
"vite": "^4.3.9",
"vite": "^4.4.2",
"vite-plugin-top-level-await": "^1.3.1",
"vite-tsconfig-paths": "^4.2.0"
}
Expand Down
Loading

0 comments on commit 3752a3a

Please sign in to comment.