Skip to content

Interactive Frontend Milestone Project for Code Institute

Notifications You must be signed in to change notification settings

CristianBuca/MS2_MyCrypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Second Milestone Project - Interactive Frontend Development - Code Institute

My Crypto Logo

Responsive Layout

You can find the deployed website HERE

User Experience

The webapp is designed as an interactive project that gives the user the ability to build a crypto-currency portfolio that is stored on their own computer without having to share their data with 3rd parties.

Strategy

Project Goals

  • Use crypto-currency APIs to display relevant data to the user.
  • Offer the user the ability to build their portfolio on our platform.
  • Offer the user an interactive way of learning more about blockchain and testing their knowledge.
  • Offer a way for the user to communicate with the owner.

User Goals

  • Find price and performance related information for the main crypto-currencies by market valuation.
  • Ability to customize a list of currencies and store the data on my device.
  • Ability to view the current valuation of assets and portfolio.
  • Learn blockchain related information and test my knowledge.

User Stories

New Users:

  1. As a new user, I want to see recent data on major crypto-currencies by market capitalization.
  2. As a new user, I want to add personal crypto-currency assets.
  3. As a new user, I want to see the asset valuation.
  4. As a new user, I want to see the total portfolio valuation.
  5. As a new user, I want to learn new information relating to the blockchain.
  6. As a new user, I want to learn more about the knowledge quiz.

Regular Users:

  1. As a regular user, I want to store my portfolio data.
  2. As a regular user, I want the option to change the current webapp color theme.
  3. As a regular user, I want the ability to edit previous portfolio entries.
  4. As a regular user, I want to test the previously acquired knowledge.

Site Owner:

  1. As a site owner, I want the knowledge quiz to be versatile and easy to update.
  2. As a site owner, I want to provide the user a way to get in contact.
  3. As a site owner, I want to showcase my social media.

Design

I have opted for minimalist design focused on user interactivity. The user has the ability to switch between Light and Dark modes with the help of the suggestive switch that is always accessible on the Navbar. The webapp was designed with a mobile-first approach using BootStrap grid for elements to re-arrange based on screen size. The Navbar was also built using BootStrap and collapses on small devices remaining fixed on top of the screen for easy access to the color theme switcher and links.

Colour Palette

Nineties Grunge color combination

Midnight Blue Red Orange Ebony Misty Blue
#00478F #FF5D00 #2A231F #D8E1E7

Font Scheme

Font Scheme is comprised of the fonts from the Ubuntu Family for titles, Oxygen Family for information of focus and Fira Sans for general text. These fonts were chosen using Google Fonts as they compliment each other.

Scope

Feature requirements:

  • Responsive webapp for all devices.
  • Navigation bar that adapts to device size.
  • Landing Page displaying current information on major crypto-currencies using calls to an external API (CoinGeko API).
  • Interactive display of secondary information on major crypto-currencies.
  • Personalized Portfolio Page displaying user assets data by calling external API(CoinGeko API).
  • Portfolio interactivity (ability to add and remove assets by user).
  • Portfolio persistance by storing data on the user's machine.
  • Interactive quiz with information from the crypto-space.
  • Modal with extra information on the quiz design and interaction.
  • Modal with built in e-mail function using external API (EmailJS).
  • Interactive color theme switch.
  • Customized 404 Error Page.
  • Favicon icons.

Structure

Wireframes

(Expand) Landing Page Wireframes.

Landing Page Wireframes

(Expand) Quiz Page Wireframes.

Quiz Page Wireframes

(Expand) Portfolio Page Wireframes.

Portfolio Page Wireframes

(Expand) Email Modal Wireframes.

Email Modal Wireframes

Features

Landing Page

The Landing Page features a grid displaying major crypto-currencies and their current prices. Currencies are organized by market capitalization in descending order. Each currency is displayed in it's own badge that the user can interact with by mouse hover (or tap on touch devices), to access 24-hour high and low prices. All the data displayed is generated dynamically through JavaScript and the CoinGeko API.

All coin badges are dynamically generated with JavaScript and the moment them being displayed are instant confirmation that the information they are viewing is up to date and the API is up and running.

User stories solved by this feature:

  • 1 - As a new user, I want to see recent data on major crypto-currencies by market capitalization.
(Expand) Landing Page on different device widths.

Landing Page on mobile

Landing Page on tablet

Landing Page on 1080p

Landing Page on 1440p

Quiz

The Quiz Page displays a quiz with crypto-currency related questions. Each question is accompanied by a different picture and the pictures featured are hidden on small devices to maintain focus on the quiz.

The info icon at the top of the quiz triggers the Info Modal when clicked, displaying more information on interacting with the game.

At the bottom of the quiz area, a stopwatch is displayed which is triggered when the user clicks the Start Button and stops when End Screen is displayed. On the opposite side, score is kept based on the correct or wrong answers the user selected.

The user is able to choose multiple answers before going to the next question. Feedback to the user is provided in the form of the buttons changing colors and and extra message being displayed when selecting the correct answer which provides additional information related to the question.

The choices in the design were made for first time users to maintain engagement with the information in the quiz. The implementation of a stopwatch instead of a countdown timer and by giving the user the ability to keep trying until they select the right answer before moving to the next question, provides the first time user with the chance to learn something new on initial interactions with the game.

For the returning user the order in which the questions are being displayed is randomized on each game play. The stopwatch and the score keeping provides the ability to test previously acquired knowledge and a challenge to beat previous score and completion time. Score is kept not only by rewarding points for right answer selections but by deducting points for wrong answers. Coupled with the stopwatch feature it adds a variable layer of difficulty and replay value to the game.

The quiz is built to be versatile and easy to update. By loading the questions from a separate file the site owner is able to easily change or update game. The quiz is able to adapt to variable number of answer choices as the HTML is dynamically generated through JavaScript.

User stories solved by this feature:

  • 5 - As a new user, I want to learn new information relating to the blockchain.
  • 6 - As a new user, I want to learn more about the knowledge quiz.
  • 10 - As a regular user, I want to test the previously acquired knowledge.
  • 11 - As a site owner, I want the knowledge quiz to be versatile and easy to update.
(Expand) Quiz Features.

Quiz on mobile

Quiz on tablet

Quiz on 1080p

Quiz on 1440p

Portfolio

The Portfolio Page displays all the user's assets in the form of a table. The user is able to add different currencies by inputting either the name, symbol or by selecting it from a searchable drop-down list; along with the quantity for each asset. Before the asset is added to the portfolio, user input is checked against the list of all coins received from the API. Once it is validated the asset is displayed with the current market price and with a calculation of how much the user's holdings are valued at. Valuations are made both individually per asset and as a total. Users are able to remove assets from their portfolio by interacting with the rubbish bin adjacent to it.

This page makes heavy use of the CoinGeko API. When the user inputs a cryptocurrency name, symbol or just manually selects it from the searchable dropdown list, a check is made against the list fetched from the API and if a match is found then the asset ID is stored in LocalStorage as a key and the asset amount input is stored as the value. This allows the user to keep their portfolio data on their own computer. Due to the large number of cryptocurrencies (over 9000!!!) different endpoints need to be called for the input list and the market list which displays much more detailed information on each cryptocurrency. The keys and values from LocalStorage are converted to JSON format and based on the IDs a custom link is generated when calling the API market list endpoint and only the coins selected by the user are being fetched. Information is then dynamically displayed in the form of a table and asset value is calculated on each API call based on the key value provided by the user and stored in LocalStorage.

To update de asset list the user only has to input the same coin with different value. To remove an asset completely the user can click the rubbish bin at the end of the asset's row.

User stories solved by this feature:

  • 2 - As a new user, I want to add personal crypto-currency assets.
  • 3 - As a new user, I want to see the asset valuation.
  • 4 - As a new user, I want to see the total portfolio valuation.
  • 7 - As a regular user, I want to store my portfolio data.
  • 9 - As a regular user, I want the ability to edit previous portfolio entries.
(Expand) Portfolio showcase.

Portfolio on mobile

Portfolio on tablet

Portfolio on 1080p

Portfolio on 1440p

Navbar

The Navbar is responsive to the size of the user's device and houses the Light/Dark Theme Switch. By using the browsers Session Storage the selected theme is kept between pages for the duration of the browsing session. The theme toggler provides an extra layer of user interaction with instant feedback in the form of the background, font and shadow color change.

User stories solved by this feature:

  • 8 - As a regular user, I want the option to change the current webapp color theme.
(Expand) Navbar

Expanded Navbar

Collapsed Navbar on mobile devices

Email Modal

The Email Modal makes use of the EmailJS API to give the user the ability to send emails to the site owner directly from the webapp. Validation of the input fields is done on the front-end side with javascript and will prevent the form to be submitted with empty fields or an invalid email address syntax. Once the fields have been validated and form submitted the user receives confirmation in the form of an alert.

User stories solved by this feature:

  • 12 - As a site owner, I want to provide the user a way to get in contact.
(Expand) Email Modal

Email Modal

Footer

In the footer, the user can find links the owner social medial.

User stories solved by this feature:

  • 13 - As a site owner, I want to showcase my social media.
(Expand) Footer

Footer

Footer

404 Page

The 404 Error Page is displayed in case of broken or absent links. It provides the user with the ability to go back to one of the webapp pages and maintains user engagement.

(expand) 404 Error Page

404 Page

Technologies Used

Testing

HTML validation was carried out with W3 Validator.

(expand) Home Page HTML Validation found 0 errors:

Home Page HTML Validation

(expand) Quiz Page HTML Validation found 0 errors, 2 warnings:

Quiz Page HTML Validation

(expand) Portfolio Page HTML Validation found 0 errors, 2 warnings:

Portfolio Page HTML Validation

(expand) 404 Page HTML Validation found 0 errors:

404 Page HTML Validation

CSS validation was carried out with W3 Jigsaw.

(expand) css.style Jigsaw Validation found 0 errors:

CSS Validation

Accessibility Evaluation was carried out with WAVE Web Accessibility Evaluation Tool.

(expand) Home Page WAVE Validation found 0 errors, 2 alerts:

Home Page HTML Validation

(expand) Quiz Page WAVE Validation found 0 errors, 3 alerts:

Quiz Page HTML Validation

(expand) Portfolio Page WAVE Validation found 0 errors, 3 alerts:

Portfolio Page HTML Validation

(expand) 404 Page WAVE Validation found 0 errors, 2 alerts:

404 Page HTML Validation

Performance Tests were carried out using Chrome Lighthouse DevTools.

(expand) Home Page Lighthouse Test:

Home Page Lighthouse Test

(expand) Quiz Page Lighthouse Test:

Quiz Page Lighthouse Test

(expand) Portfolio Page Lighthouse Test:

Portfolio Page Lighthouse Test

(expand) 404 Page Lighthouse Test:

404 Page Lighthouse Test

JavaScript Code Tests were carried out with JShint.

JSHint warnings are due to the use of shorthand for IF statements and the use of JQuery where JSHint interprets "$" as an unknown variable.

(expand) email.js JSHint found 0 errors:

EmailJS script

(expand) home.js JSHint found 0 errors 1 warning:

EmailJS script

(expand) quiz.js JSHint found 0 errors 1 warning:

EmailJS script

(expand) quiz_data.js JSHint found 0 errors:

EmailJS script

(expand) portfolio.js JSHint found 0 errors, 3 warnings:

EmailJS script

Devices used for physical testing:

  • Samsung Galaxy S8,
  • Samsung Tab A 9.7-inch tablet,
  • 17-inch 1080p Laptop (Google Chrome, Mozilla Firefox, Opera, Microsoft Edge browsers),
  • 24-inch 1080p Display (Google Chrome, Mozilla Firefox, Opera, Microsoft Edge browsers),
  • 32-inch 2040p Display (Google Chrome, Mozilla Firefox, Opera, Microsoft Edge browsers).

Application performs as intended on all devices.

Testing of User Stories

GitHub does not allow videos hosted in the local repository to be played on the repository page. Although when viewing on GitHub these videos appear fine, they might not be available in this format if this project is forked. Please refer to the Local Links if needed.

1. As a new user, I want to see recent data on major crypto-currencies by market capitalization.

Feature Action Expected Result Actual Result
Coin Badges on Landing Page Load Landing Page. Hover over individual badges. View current price for each currency. View 24 hour price highs and lows. Works as expected
(Expand - User Story 1 testing video)
user_story_1_test.mp4

Local Link

2. As a new user, I want to add personal crypto-currency assets.

Feature Action Expected Result Actual Result
Portfolio Page Click the "Portfolio" Link in navbar. Click on Asset Input Field. Input symbol, name or select from list the asset. Click on "Enter amount" Input Field. Enter amount. Click "Add" button. See the asset added to the table. Works as expected
(Expand - User Story 2 testing video)
user_story_2_test.mp4

Local Link

3. As a new user, I want to see the asset valuation.

Feature Action Expected Result Actual Result
Asset table on Portfolio Page Assets added as described in User Story 2 are stored in Local Storage. Refresh Page, view table containing assets. View current price and valuation for each asset added. Works as expected
(Expand - User Story 3 testing video)
user_story_3_test.mp4

Local Link

4. As a new user, I want to see the total portfolio valuation.

Feature Action Expected Result Actual Result
Current Portfolio Value section at the top of Portfolio Page Refresh Page. View total portfolio valuation. See the total valuation of all assets. Works as expected.
(Expand - User Story 4 testing video)
user_story_4_test.mp4

Local Link

5. As a new user, I want to learn new information relating to the blockchain.

Feature Action Expected Result Actual Result
Quiz Page Click the Quiz Link on the navigation bar. Click the start button on the quiz. Play the game. Find information related to the blockchain. Works as expected
(Expand - User Story 5 testing video)
user_story_5_test.mp4

Local Link

6. As a new user, I want to learn more about the knowledge quiz.

Feature Action Expected Result Actual Result
Quiz info button in the quiz title Click on the information button. See modal with information about the quiz. Works as expected
(Expand - User Story 6 testing video)
user_story_6_test.mp4

Local Link

7. As a regular user, I want to store my portfolio data.

Feature Action Expected Result Actual Result
Add asset section on portfolio page Click on portfolio link in navigation bar. Add asset as described in User Story 2. Close page / browser. Open page again. To see added assets persist through different browsing session. See added data stored in Local Storage Works as expected
(Expand - User Story 7 testing video)
user_story_7_test.mp4

Local Link

8. As a regular user, I want the option to change the current webapp color theme.

Feature Action Expected Result Actual Result
Theme Switch in the Navbar Click the theme switch in the Navbar Page color scheme to change Works as expected
(Expand - User Story 8 testing video)
user_story_8_test.mp4

Local Link

9. As a regular user, I want the ability to edit previous portfolio entries.

Feature Action Expected Result Actual Result
Portfolio Page input fields and trash bin icons To change the Holding amount of an existing asset, select the same asset in the dropdown menu and input new amount. To remove asset from table click the trash bin icon in the asset's table row. Updated amount to show in table when updating. Asset to be removed when clicking trash bin. Works as expected
(Expand - User Story 9 testing video)
user_story_9_test.mp4

Local Link

10. As a regular user, I want to test the previously acquired knowledge.

Feature Action Expected Result Actual Result
End screen on quiz game Click on try again button at the end of the quiz The quiz game starts over and offers the chance to gain a better score and better completion time Works as expected
(Expand - User Story 10 testing video)
user_story_10_test.mp4

Local Link

11. As a site owner, I want the knowledge quiz to be versatile and easy to update.

Feature Action Expected Result Actual Result
quiz_data.js script housing all the questions and answers for the quiz Open project repository. Locate quiz_data.js in assets/js/. Open quiz_data.js and replace questions and answers. The quiz data is displayed dynamically thus making it easy for variable number of answers to be displayed for one question and not being hard coded in HTML to a specific number. View new questions being displayed in the quiz. Works as expected
(Expand - User Story 11 testing video)
user_story_11_test.mp4

Local Link

12. As a site owner, I want to provide the user a way to get in contact.

Feature Action Expected Result Actual Result
Email modal that uses EmailJS API Click on "Get in touch" Link in the Navbar. Fill in the input fields. Click Send Validation when the API sends the message to the site owners inbox. Works as expected
(Expand - User Story 12 testing video)
user_story_12_test.mp4

Local Link

13. As a site owner, I want to showcase my social media.

Feature Action Expected Result Actual Result
Social media links in the page footer Click on the social media icons in the page footer Social media pages to open in new tab. Works as expected
(Expand - User Story 13 testing video)
user_story_13_test.mp4

Local Link

Bugs

  • Bug: Event listener does not trigger on the dynamically generated answer buttons.

  • Fix: Apply the event listener to the button container and add selector for the clicks only on the buttons in the container. Credit to StackOverflow

  • Bug: Multiple clicks on the same answer result function checkAnswer() being triggered multiple times resulting in erroneous score count and multiple displays of validation message for correct answers.

(Expand) Multiple clicks being registered on the same answer:
multiple_clicks_bug_preview.mp4
  • Fix: Each answer button is added an extra class when being generated and event listener for clicks on answers is targeting the class instead of the button element. When checkAnswer() function is triggered for the first time for each answer removes the class from the button preventing the event listener from registering extra clicks.

  • Bug: Unable to add assets to the portfolio that contain a space in their name.

  • Fix: Store assets in localStorage by ID instead of NAME and call API based on IDs instead of their names.

  • Bug: Method to generate random number to select an image from assets to display with each quiz question includes "0" while images names start from 1. Whenever 0 would be generated no image would be displayed and console would display the error:

GET http://127.0.0.1:5501/assets/img/quiz_img/quiz_0_min.jpg 404 (Not Found)

  • Fix: Add 1 to all random numbers generated.

Deployment

The website is hosted and deployed from Github. The steps taken for deployment were:

  1. Logged into my Github account,
  2. Selected the Repository,
  3. Go to Settings,tab on the horizontal menu,
  4. Go to Pages tab on the vertical sub-menu,
  5. Selected the Main Branch from the drop-down menu under Source,
  6. Selected the /(root) folder where my index.html was located,
  7. Clicked Save,
  8. Once the page was refreshed I was presented with the link to the live website as seen in the image below:

Published site

Steps to follow for cloning this repository:

  1. Log into your Github account,
  2. Select the Repository,
  3. Click on the drop-down menu title Code on the top right of the repository file tree,
  4. Copy the HTTPS address,
  5. In your Git Bash Terminal type "git clone" then paste the address.

Alternatively you can download the repository as ZIP or use Github Desktop to ge the repository on you local machine

Using the EmailJS API:

  1. Create an account/login on EmailJS Website.
  2. Go to Email Services and add an e-mail service of your choice.
  3. Got to Email Templates and create one.
  4. On the integration tab find User ID and Access Token.
  5. Update script with ID and token.
  6. Extra documentation on the API can be found Here.

Using the CoinGeko API:

  1. CoinGeko offers a free plan for the API that does not require signing up for it.
  2. Going on the documentation page provides information for each endpoint.
  3. Expand endpoint of interest and click "Try it out", fill in parameters that match your query and click "Execute".
  4. Use the generated URL to make the call to the API.
  5. Along with the URL a response body preview and headers are also available to view in the description.
(Expand) CoinGeko API Test

Endpoint Test

(Expand) CoinGeko API response

Endpoint Response

Credits

I have followed dozens of projects and video tutorials trying to find the solutions that would fit this project. Some influenced my approach on how to build this site and others were specific to a particular issue I encountered. Any code that was borrowed has been modified and adapted to fit my particular needs.

JavaScript/Jquery code:

  • Expression to validate if the input is in the form of an e-mail address from StackOverflow.
  • To be able to find a building approach for the quiz I watched videos from Brian Design, Florin Pop, Web Dev Simplified. The latter has been the most influential as it was the closest to what I was aiming for.
  • The stopwatch feature in the quiz was built based on Crypters Infotech 6-part tutorial.
  • For using localStorage/sessionStorage which I used for the portfolio and the theme switch I followed dcode, LogRocket.
  • Approach in iterating localStorage from StackOverFlow.
  • The approach in building the cryptocurrency portfolio from Creepto and there are definite traces of his code in repo.
  • Closest() method to target the entire row for removal in the portfolio I found on Codepedia.
  • Syntax for generating dynamic elements with custom CSS from StackOverFlow.
  • Method for randomizing questions from Web Dev Simplified.

HTML/CSS

  • Using CSS Variables Fireship.
  • CSS style for the Theme Switch checkbox was taken from Online Tutorials.
  • For the Quiz Info Modal I watched Florin Pop.
  • CSS for the custom buttons was inspired from CSS Scan.
  • The pop-up in the e-mail form for invalid entries was taken from W3 Schools in combination with PreTagTeam for positioning it on each input.

Media

Code Institute colleagues who's work I followed for guidance:

Paul Meeneghan.

Tara Rhoseyn.

Acknowledgements

  • Special thanks to my mentor Mo Shami for his suggestions and guidance.
  • My family for their encouragement and support.
  • Special thanks to Neil from Student Care for helping me through a tough time and everyone else in the Student Care Team that touched bases making sure I am on track.
  • The Code Institute team for all the effort and energy they put into creating and curating the content for this programme.

Disclaimer

This project is for educational use only and was created as a Milestone Project for the Code Institute Module of Interactive Frontend Development

Developed by Cristian Buca

About

Interactive Frontend Milestone Project for Code Institute

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published