Actifit Landingpage and Wallet View by mkt

View this thread on steempeak.com
· @mkt · (edited)
$139.38
Actifit Landingpage and Wallet View
![image.png](https://ipfs.busy.org/ipfs/QmTMhCQjFTCaKDuP9Da59Ncv5Q4BbvHnqjXjvnu4JeCBnE)

#### Repository
https://github.com/mcfarhat/actifit-landingpage
*I created this repository and then transferred ownership to [mcfarhat](https://github.com/mcfarhat). That's why there are no PRs but you can see me as [the only contributor](https://github.com/mcfarhat/actifit-landingpage/graphs/contributors). For future updates there will be PRs.*

#### Read about the project:
https://steemit.com/actifit/@actifit/announcing-actifit-innovative-smt-for-rewarding-fitness-activity

# Landingpage and Wallet

The project was in need of a first little landingpage and a way for people to see their current funds.
Since this includes some data fetching and logic, I decided to use [Vue.js](https://vuejs.org/) and [Nuxt.js](https://nuxtjs.org/) again, to have a solid framework to work with.

The layout is completely custom, no templates were used, just bare [Bootstrap 4](https://getbootstrap.com/).

The images come from [pixabay.com](https://pixabay.com) and are free and require no attribution. But anyway, here are the sources:
https://pixabay.com/en/adult-body-casual-close-up-1867757/
https://pixabay.com/en/people-man-guy-running-sport-2590796/
https://pixabay.com/en/home-fitness-equipment-1840858/

Since the user wallet was the driving purpose of this page, there's a prominently placed box in the header, where you can enter a username and then see the account balance and transaction history. There's no login or other validation. You can type in any username and see it's balance and history.

By the way,... there are no features such as sending and receiving funds. It is really just pure information.

<center>
![image.png](https://ipfs.busy.org/ipfs/QmfByKAotvLo9TUwhvPFXdPLcDR3PjrRzxEFWjmkBXHLy1)
</center>

![image.png](https://ipfs.busy.org/ipfs/QmYXLWNLz1B4h2JBLUfjtmh1vQQyqcMFqyfBoMwR6Yq7MU)

The main page contains only a little bit of text and some images, that I tried to arrange nicely. The only dynamic part is those two numbers - *Tokens Distributed* and *Token Holders*.

![image.png](https://ipfs.busy.org/ipfs/Qmf5zk8XnqXrptipcJssX6vgWtoPwpBXQz8NZWWz1TRuxG)

#

# Implementation

I started with the wallet view, since this was the main task.

First step was to install a fresh Nuxt.js app. You can do this easily with the [npx installer for Nuxt](https://github.com/nuxt-community/create-nuxt-app).

`npx create-nuxt-app actifit-landingpage`

This results in this first commit: https://github.com/mcfarhat/actifit-landingpage/commit/863d551e7ca75e90da4f27e949652728c957f9c3

The second commit actually already implements the wallet view functionality:
https://github.com/mcfarhat/actifit-landingpage/commit/f3d3624442c1b7fb102ad735fb27279db1daf235

There are two views, one for the homepage, which contains a form to provide the username and later became the actual landingpage, and the wallet page to view your account balance and transaction history.

On click on the "Show Wallet" button or by hitting enter in the input field, the `goToWallet` method is triggered, and sends you to `/wallet/<username>` if the provided username is at least 3 characters long.
https://github.com/mcfarhat/actifit-landingpage/blob/master/pages/index.vue#L136

The wallet page then just fetches the data from the API that the project already provides, and displays it.
https://github.com/mcfarhat/actifit-landingpage/blob/master/pages/wallet/_username.vue#L55

Regarding the rest of the landingpage, well... I don't really know what to write about it. It's plain and simple HTML/CSS. Nothing that needs any explanation, I guess. I can only say that [all the commits](https://github.com/mcfarhat/actifit-landingpage/commits/master) after the first two, are only related to the looks of the website and displaying the content nicely.

Oh and of course it's mobile optimized:

<center>
![localhost_3000_(iPhone 5_SE).png](https://ipfs.busy.org/ipfs/QmV3FmtTKvbuy4Vdqm7FEd6skSwyqAndTftMamjQteCf1e)
</center>

# <center><sup>Final Result:</sup><br>[actifit.io](https://actifit.io/)</center>
#

This is just the first iteration, the minimum that was required. I'm already talking with @mcfarhat about future updates, so don't see this as a finished project. I guess it's far from that but it's a start.
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
post_id56,823,050
authormkt
permlinkactifit-landingpage-and-wallet-view
categoryutopian-io
json_metadata{"tags":["utopian-io","development","actifit","vuejs","webdesign"],"community":"busy","links":["https:\/\/github.com\/mcfarhat\/actifit-landingpage","https:\/\/github.com\/mcfarhat","https:\/\/github.com\/mcfarhat\/actifit-landingpage\/graphs\/contributors","https:\/\/steemit.com\/actifit\/@actifit\/announcing-actifit-innovative-smt-for-rewarding-fitness-activity","https:\/\/vuejs.org\/","https:\/\/nuxtjs.org\/","https:\/\/getbootstrap.com\/","https:\/\/pixabay.com","https:\/\/pixabay.com\/en\/adult-body-casual-close-up-1867757\/","https:\/\/pixabay.com\/en\/people-man-guy-running-sport-2590796\/"],"image":["https:\/\/ipfs.busy.org\/ipfs\/QmTMhCQjFTCaKDuP9Da59Ncv5Q4BbvHnqjXjvnu4JeCBnE"],"users":["actifit","mcfarhat"],"app":"busy\/2.5.2","format":"markdown"}
created2018-07-17 12:39:30
last_update2018-07-17 12:51:24
depth0
children8
net_rshares66,593,377,642,738
last_payout2018-07-24 12:39:30
cashout_time1969-12-31 23:59:59
total_payout_value105.603 SBD
curator_payout_value33.777 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length4,298
author_reputation44,782,786,305,028
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (52)
@mcfarhat ·
Thank you for the fantastic work so far @mkt ! :)
properties (22)
post_id56,824,669
authormcfarhat
permlinkre-mkt-actifit-landingpage-and-wallet-view-20180717t125712123z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"users":["mkt"],"app":"steemit\/0.1"}
created2018-07-17 12:57:18
last_update2018-07-17 12:57:18
depth1
children0
net_rshares0
last_payout2018-07-24 12:57:18
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length49
author_reputation104,178,422,702,645
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@zoneboy ·
This is awesome. It will let users see their tokens at a glance and ultimately increase the userbase
properties (22)
post_id56,826,794
authorzoneboy
permlinkre-mkt-actifit-landingpage-and-wallet-view-20180717t131820050z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit\/0.1"}
created2018-07-17 13:18:21
last_update2018-07-17 13:18:21
depth1
children0
net_rshares0
last_payout2018-07-24 13:18:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length100
author_reputation94,769,080,451,415
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@helo ·
$0.05
* More Vue wonders, congrats.
* My eyes went crossed when I saw this:  `this.transactions = json ? json : this.transactions`, can you explain?  
  * So if json has data, then transactions will get json, otherwise, it get itself?


Your contribution has been evaluated according to [Utopian policies and guidelines](https://join.utopian.io/guidelines), as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, [click here](https://review.utopian.io/result/3/2211213).

---- 
Need help? Write a ticket on https://support.utopian.io/. 
Chat with us on [Discord](https://discord.gg/uTyJkNm). 
[[utopian-moderator]](https://join.utopian.io/)
πŸ‘  , ,
properties (23)
post_id56,847,991
authorhelo
permlinkre-mkt-actifit-landingpage-and-wallet-view-20180717t170558303z
categoryutopian-io
json_metadata{"links":["https:\/\/join.utopian.io\/guidelines","https:\/\/review.utopian.io\/result\/3\/2211213","https:\/\/support.utopian.io\/","https:\/\/discord.gg\/uTyJkNm","https:\/\/join.utopian.io\/"],"app":"steemit\/0.1","tags":["utopian-io"]}
created2018-07-17 17:05:57
last_update2018-07-17 17:05:57
depth1
children4
net_rshares26,068,112,570
last_payout2018-07-24 17:05:57
cashout_time1969-12-31 23:59:59
total_payout_value0.042 SBD
curator_payout_value0.011 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length720
author_reputation119,612,833,307,875
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (3)
@mkt · (edited)
$0.04
Exactly... although, this is more a workaround. The default value for `this.transactions` is an empty array. Unfortunately this API endpoint returns a `200 OK` response even though it returns invalid JSON for some reason. This is why I had to add this check there. It makes sure that `this.transactions` is still an empty array in case of an invalid response.
πŸ‘  
properties (23)
post_id56,851,501
authormkt
permlinkre-helo-re-mkt-actifit-landingpage-and-wallet-view-20180717t174711989z
categoryutopian-io
json_metadata{"format":"markdown","community":"busy","links":[],"app":"busy\/2.5.2","tags":["utopian-io"],"users":[],"image":[]}
created2018-07-17 17:47:12
last_update2018-07-17 17:49:21
depth2
children3
net_rshares21,405,437,194
last_payout2018-07-24 17:47:12
cashout_time1969-12-31 23:59:59
total_payout_value0.033 SBD
curator_payout_value0.009 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length359
author_reputation44,782,786,305,028
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (1)
@helo ·
It looked like code poetry with its symmetry.   And it gave me an idea! πŸ’‘
properties (22)
post_id56,863,240
authorhelo
permlinkre-mkt-re-helo-re-mkt-actifit-landingpage-and-wallet-view-20180717t201058377z
categoryutopian-io
json_metadata{"links":[],"tags":["utopian-io"],"image":[],"format":"markdown","community":"busy","app":"busy\/2.5.3","users":[]}
created2018-07-17 20:10:57
last_update2018-07-17 20:10:57
depth3
children0
net_rshares0
last_payout2018-07-24 20:10:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length73
author_reputation119,612,833,307,875
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
@luschn ·
$0.24
Nice project! I would do it like this though: `this.transactions = json || this.transactions`
πŸ‘  , , , , , ,
properties (23)
post_id56,928,529
authorluschn
permlinkre-mkt-re-helo-re-mkt-actifit-landingpage-and-wallet-view-20180718t112106540z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit\/0.1"}
created2018-07-18 11:23:12
last_update2018-07-18 11:23:12
depth3
children1
net_rshares112,822,826,333
last_payout2018-07-25 11:23:12
cashout_time1969-12-31 23:59:59
total_payout_value0.184 SBD
curator_payout_value0.052 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length93
author_reputation19,349,362,753,909
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000
author_curate_reward""
vote details (7)
@utopian-io ·
Hey @mkt
**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Want to chat? Join us on Discord https://discord.gg/h52nFrV.**

<a href='https://v2.steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
post_id57,053,598
authorutopian-io
permlinkre-actifit-landingpage-and-wallet-view-20180719t133009z
categoryutopian-io
json_metadata{"app":"beem\/0.19.42"}
created2018-07-19 13:30:12
last_update2018-07-19 13:30:12
depth1
children0
net_rshares0
last_payout2018-07-26 13:30:12
cashout_time1969-12-31 23:59:59
total_payout_value0.000 SBD
curator_payout_value0.000 SBD
pending_payout_value0.000 SBD
promoted0.000 SBD
body_length295
author_reputation152,913,012,544,965
root_title"Actifit Landingpage and Wallet View"
beneficiaries[]
max_accepted_payout1,000,000.000 SBD
percent_steem_dollars10,000