Skip to content

Commit

Permalink
Fix logo, ignore pnpm-lock, cleanup readme
Browse files Browse the repository at this point in the history
  • Loading branch information
kanshi committed Jul 12, 2024
1 parent 7af7364 commit 4d9c287
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 59 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ logs
.env
.env.*
!.env.example

pnpm-lock.yaml
47 changes: 1 addition & 46 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,7 @@
# AnyOne Relay Dashboard (WIP)
# AnyOne Relay Dashboard

This repo houses the code to display the user specific information pertaining to ANON Relays.

## To Do

Since this is in progress, there is still work to be done.
While this list seems long much of the boilerplate exists.

- Get claimable rewards total
- Get previously claimed to date
- Get reward history per user and plot a graph (empty array now)
- We need to implement signing for the functions - see below.
- Register, Claim and Renounce functions need to be tested (need mock data)
- We need decent mock data to test properly

## Background

This is actually the third iteration of this code:

1. ANON built: https://github.com/ATOR-Development/ator-dashboard/
2. Brewlabs built: https://github.com/brewlabs-code/ator/
3. Brewlabs built stripped down: https://github.com/brewlabs-code/ator-relay-dashboard

For reasons not worth getting into now ANON changed directions technically. As such the 2nd build was halted.
Now, the underlying tech has changed somewhat and we are developing an MVP version focussing on the user account section.
Much of the code has been migrated but also some updates where necessary.

## Tech used

While there is a bunch of other packages installed some worth pointing out are:
Expand Down Expand Up @@ -82,26 +58,5 @@ Data is stored on chain using Arweave - this means it's permanent.

Locally or in the app, the data is stored using Pinia.

### Getting data

For the most part data is fetched using Nuxt's `useAsyncData`.
See https://nuxt.com/docs/getting-started/data-fetching

Often, but not always, the results are stored in a Pinia state store.
Alongside the store there are actions to retrieve the data, these actions or functions are called by `useAsyncData`, this means we can easily refresh, cache and manage the data.

#### To get relay data per user we do something like this:

- Using the Warp SDK we can get the contracts state.
- Namely we want to get `verified` and `claimable` data.
- This returns a list of relay fingerprints and associated addresses, stored in Pinia as a Getter.
- The data is fetched here, `components\DataTableMyRelays.vue`, but stored in Pinia.
- Since this only gives us relay fingerprints, we make an additional request to Arweave (using ARDB) `stores\useMetricsStore.ts`.
- That gives use transaction data, namely the latest transaction ID.
- We use that to retrieve relay meta in JSON format for ALL relays.
- Then we need to map it to the existing fingerprints we retrieved earlier and display in the table.

## Resources

- https://cookbook.g8way.io/concepts/index.html
- http://arweave.net/bKdUd6vonjrZS4-FUGMPr5ecOeF405pR2DdO_at1D9I (example of Arweave JSON data)
1 change: 0 additions & 1 deletion components/DashboardHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const menuStore = useMenuStore();
>
<div class="flex gap-2 items-center">
<TitleAndLogo />
<h1 class="lg:hidden capitalize font-brand tracking-wider">ANyONe</h1>
</div>
<nav class="flex-1">
<ul class="flex justify-center items-center space-x-4">
Expand Down
14 changes: 2 additions & 12 deletions components/ui-kit/TitleAndLogo.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,8 @@
<template>
<div>
<router-link to="/" class="flex gap-2 items-top">
<img src="/images/anyone-logo.png" width="30" height="30" />
<img
src="/images/anyone-text.png"
width="100"
height="30"
className="hidden lg:block"
/>
<h2
class="dark:text-white text-cyan-800 text-xl sr-only lg:not-sr-only font-brand font-bold block lg:hidden"
>
ANyONe
</h2>
<img class="object-contain h-8" src="/images/anyone-logo.png" />
<img class="object-contain h-8 mt-[2px]" src="/images/anyone-text.png" />
</router-link>
</div>
</template>

0 comments on commit 4d9c287

Please sign in to comment.