create account

STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem. by creatrixity

View this thread on: hive.blogpeakd.comecency.com
· @creatrixity · (edited)
$43.84
STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem.
### Repository

[https://github.com/stonecoinproject/stonem-frontend](https://github.com/stonecoinproject/stonem-frontend)

### Pull request

[Project Refactoring, Test Suite Development and Development of Masternodes Screen.](https://github.com/stonecoinproject/stonem-frontend/pull/1)

![stone-banner.jpg](https://cdn.steemitimages.com/DQmUDKmSTV6bUWjW2c7THp5pnRfy5PAs43Kko8AnAzhNmou/stone-banner.jpg)

![STONEm-WIP-2.png](https://cdn.steemitimages.com/DQmYmK5yct6XfrEjU2eGAjvg5gsdJAnqNV9tmwCy3Ybf2j4/STONEm-WIP-2.png)

### About

STONE is an emerging cryptocurrency ecosystem that seeks to create an interconnected secure and encrypted network. To do this, as key to its initial phase, a cloud-based masternode hosting solution that will use the STONE cryptocurrency as the main form of payment must be developed.

Currently it is possible to create STONE masternodes from the shell interface but the [process is pretty technical](https://github.com/stonecoinproject/stonemnsetup) and not very friendly. We hope to eliminate this tedium through a simple, fun interface accessible anywhere in the world.

### Defining the Stack: Challenges Arising.

In setting up the STONEm front-end stack: a lot of technical, research based decisions had to be made. Having seen multiple open source projects devolve into an intangible mess of buggy, spaghetti code—an unmaintainable heap—these steps were taken:

+ __Static code analysis__ is enforced with Typescript as the static typing compiler of choice. 
+ __Strict linting__ was enforced to sustain top code quality. The project adheres to a [strict interpretation of Airbnb's lint rules adapted for Typescript](https://github.com/progre/tslint-config-airbnb)
+ __Unit and end-to-end tests__ are written to guarantee correct behavior in production. We use a combination of functional, unit and e2e tests to achieve higher code coverage levels. We use [Jest](https://github.com/facebook/jest),  [Enzyme](https://github.com/airbnb/enzyme) and [react-testing-library](https://github.com/kentcdodds/react-testing-library)
![STONEm-Coverage.png](https://cdn.steemitimages.com/DQmSmErfDibaedWaaQunoweV5J3im9dht7tdLdjcm6ojuhv/STONEm-Coverage.png)
+ __Unidirectional data flow__ is achieved using Redux.
+ __Code organization and architecture__ was heavily inspired by [an article published by @fat](https://medium.com/bumpers/isnt-our-code-just-the-best-f028a78f33a9)
+ __Rebass, Styled Components and Styled Systems__ are used to keep styles lightweight and modular.

### Technology Stack

+ TypeScript (v3.1.4 and greater).
+ React with Redux.
+ Rebass & Styled Components.
+ Jest with Enzyme and React-testing-library.
+ Tslint with tslint-config-airbnb.

### A Brief Peek into the Code.

With the premium on automated testing enforced within STONEm's front-end, its really important to test correctly. Our testing strategy from unit tests to end-to-end tests involve *testing the interface exactly as a user would*. This means less emphasis on testing code constructs and more emphasis on testing behaviour. In scenarios were no user interactions are provided yet, we may test implementation details such as in the example below.

Here's a simple unit test for the `<FilterButton />` component available at `src/components/FilterSuite/filterButton.spec.tsx`.

```js
test('A `Dot` element is rendered when the filter button is selected', () => {
    const {
        queryByTestId,
        unmount
    } = render(<FilterButton isSelected/>);

    const dot = queryByTestId('dot');
    expect(dot).toBeInstanceOf(HTMLElement);

    unmount();
})
```

The `FilterButton` component below has `data-testid` DOM nodes useful for hooking into our tests. No contract has been enforced so far since the implementation details are not fully formed.

In `src/components/FilterSuite/filterButton.tsx`:

```js
import * as React from 'react';
import { Button } from 'rebass';
import { Dot } from '../UI';
import { theme } from '../../config';

const filterButton = ({ isSelected, children }:any) => (
  <Button
    px={3}
    variant={'default'}
    data-testid={'filter-button'}
  >
    {/*
      If `isSelected` is true, render a <Dot/> within the button.
    */}
    {isSelected &&
      <Dot
        theme={theme}
        css={{
          position: 'absolute',
          top: 3,
          right: 3,
        }}
        data-testid={'dot'}
      />
    }
    {children}
  </Button>
);

filterButton.defaultProps = {
  isSelected: false,
};

export default filterButton;
```

### Features.

+ View all masternodes created by a STONE user.

### Roadmap

+ Add capacity to create STONE masternodes directly from the interface.
+ Masternodes remote management (spin up, pause, power down) from web interface.
+ Facilitate creation of STONE wallet for STONErs.
+ STONE wallet management all in one location.
+ Include Continuous Integration (CI)/Continuous Deployment strategies alongsides a staging server for QA tests.
+ Better, more detailed Github & component documentation.

### Github Account

[https://github.com/creatrixity](https://github.com/creatrixity)

### How to Contribute?

Please get in touch with the front-end core team on the official STONE Discord channel: https://discord.gg/p22bgqp
πŸ‘  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
properties (23)
authorcreatrixity
permlinkstonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem
categoryutopian-io
json_metadata{"tags":["utopian-io","development","stonecoin","programming","technology"],"image":["https://cdn.steemitimages.com/DQmUDKmSTV6bUWjW2c7THp5pnRfy5PAs43Kko8AnAzhNmou/stone-banner.jpg","https://cdn.steemitimages.com/DQmYmK5yct6XfrEjU2eGAjvg5gsdJAnqNV9tmwCy3Ybf2j4/STONEm-WIP-2.png","https://cdn.steemitimages.com/DQmSmErfDibaedWaaQunoweV5J3im9dht7tdLdjcm6ojuhv/STONEm-Coverage.png"],"links":["https://github.com/stonecoinproject/stonem-frontend","https://github.com/stonecoinproject/stonem-frontend/pull/1","https://github.com/stonecoinproject/stonemnsetup","https://github.com/progre/tslint-config-airbnb","https://github.com/facebook/jest","https://github.com/airbnb/enzyme","https://github.com/kentcdodds/react-testing-library","https://medium.com/bumpers/isnt-our-code-just-the-best-f028a78f33a9","https://github.com/creatrixity","https://discord.gg/p22bgqp"],"app":"steemit/0.1","format":"markdown"}
created2018-11-18 13:13:57
last_update2018-11-19 15:18:51
depth0
children7
last_payout2018-11-25 13:13:57
cashout_time1969-12-31 23:59:59
total_payout_value33.301 HBD
curator_payout_value10.542 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length5,240
author_reputation16,463,772,859,893
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,495,612
net_rshares69,564,529,605,874
author_curate_reward""
vote details (59)
@djstonedcoin ·
Awesome work and the progress looks amazing brother.
properties (22)
authordjstonedcoin
permlinkre-creatrixity-stonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem-20181118t183853034z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-11-18 18:38:51
last_update2018-11-18 18:38:51
depth1
children1
last_payout2018-11-25 18:38:51
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length52
author_reputation4,396,217,643
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,511,497
net_rshares0
@creatrixity ·
Thanks. We'll keep improving on this.
πŸ‘  
properties (23)
authorcreatrixity
permlinkre-djstonedcoin-re-creatrixity-stonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem-20181118t195502670z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"app":"steemit/0.1"}
created2018-11-18 19:55:09
last_update2018-11-18 19:55:09
depth2
children0
last_payout2018-11-25 19:55:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length37
author_reputation16,463,772,859,893
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,514,688
net_rshares0
author_curate_reward""
vote details (1)
@helo ·
$7.45
- Great post with lots of images and code samples.
- I really like your approach to defining the Stack, since a good foundation is needed for great project to succeed.


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/1211112).

---- 
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)
authorhelo
permlinkre-creatrixity-stonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem-20181119t225128802z
categoryutopian-io
json_metadata{"tags":["utopian-io"],"links":["https://join.utopian.io/guidelines","https://review.utopian.io/result/3/1211112","https://support.utopian.io/","https://discord.gg/uTyJkNm","https://join.utopian.io/"],"app":"steemit/0.1"}
created2018-11-19 22:51:30
last_update2018-11-19 22:51:30
depth1
children1
last_payout2018-11-26 22:51:30
cashout_time1969-12-31 23:59:59
total_payout_value5.642 HBD
curator_payout_value1.810 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length659
author_reputation121,547,934,535,311
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,581,188
net_rshares11,980,041,966,176
author_curate_reward""
vote details (16)
@utopian-io ·
Thank you for your review, @helo! Keep up the good work!
πŸ‘  
properties (23)
authorutopian-io
permlinkre-re-creatrixity-stonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem-20181119t225128802z-20181122t040755z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-22 04:07:57
last_update2018-11-22 04:07:57
depth2
children0
last_payout2018-11-29 04:07:57
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length56
author_reputation152,955,367,999,756
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,710,537
net_rshares0
author_curate_reward""
vote details (1)
@steem-ua ·
#### Hi @creatrixity!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
**Feel free to join our [@steem-ua Discord server](https://discord.gg/KpBNYGz)**
properties (22)
authorsteem-ua
permlinkre-stonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem-20181120t015001z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-20 01:50:03
last_update2018-11-20 01:50:03
depth1
children0
last_payout2018-11-27 01:50:03
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length290
author_reputation23,214,230,978,060
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,588,465
net_rshares0
@steemitboard ·
Congratulations @creatrixity! You have completed the following achievement on the Steem blockchain and have been rewarded with new badge(s) :

<table><tr><td>https://steemitimages.com/60x70/http://steemitboard.com/@creatrixity/votes.png?201811262102</td><td>You made more than 8000 upvotes. Your next target is to reach 9000 upvotes.</td></tr>
</table>

<sub>_[Click here to view your Board of Honor](https://steemitboard.com/@creatrixity)_</sub>
<sub>_If you no longer want to receive notifications, reply to this comment with the word_ `STOP`</sub>



> Support [SteemitBoard's project](https://steemit.com/@steemitboard)! **[Vote for its witness](https://v2.steemconnect.com/sign/account-witness-vote?witness=steemitboard&approve=1)** and **get one more award**!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-creatrixity-20181127t001323000z
categoryutopian-io
json_metadata{"image":["https://steemitboard.com/img/notify.png"]}
created2018-11-27 00:13:21
last_update2018-11-27 00:13:21
depth1
children0
last_payout2018-12-04 00:13:21
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length765
author_reputation38,975,615,169,260
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,961,543
net_rshares0
@utopian-io ·
Hey, @creatrixity!

**Thanks for contributing on Utopian**.
We’re already looking forward to your next contribution!

**Get higher incentives and support Utopian.io!**
 Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via [SteemPlus](https://chrome.google.com/webstore/detail/steemplus/mjbkjgcplmaneajhcbegoffkedeankaj?hl=en) or [Steeditor](https://steeditor.app)).

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

<a href='https://steemconnect.com/sign/account-witness-vote?witness=utopian-io&approve=1'>Vote for Utopian Witness!</a>
properties (22)
authorutopian-io
permlinkre-stonem-client-development-building-a-front-end-client-for-a-rock-solid-feature-rich-cryptocurrency-ecosystem-20181120t030753z
categoryutopian-io
json_metadata"{"app": "beem/0.20.9"}"
created2018-11-20 03:07:54
last_update2018-11-20 03:07:54
depth1
children0
last_payout2018-11-27 03:07:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length593
author_reputation152,955,367,999,756
root_title"STONEm Client Development: Building A Front-end Client for a Rock Solid, Feature Rich Cryptocurrency Ecosystem."
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id75,591,279
net_rshares0