<commit_before>---
layout: post
title:      "Javascript: Project Mode"
date:       2020-02-24 21:47:44 +0000
permalink:  javascript_project_mode
---


So I've been learning Javascript for a few months now and it's been pretty interesting. After learning Ruby on Rails, learning Javascript has made it a bit easier to learn. The syntax is definitely different, but I'm getting used to it. The idea for my project is to be able to track and budget things that you've purchased. I got this idea because I've been purchasing a lot of makeup products specifically and don't have the time to use them. 

The first things I've done was to create a Rails API. By typing this into the terminal: rails new makeup-api --api, this allowed me to create the backend for this project. API - application programming interface. This API allows us to connect to the internet and send data to a server. The server receives the data and proceeds with the correct actions and presents it back to the user. After doing creating the API, I had started started to work on the rails porition of the backend. By creating migrations I was able to develop a database for the products and reviews. I created routes so that JS knew where to grab data from. CORs is another feature that represents cross origin resources. It's important to know because it allows a HTTP request to execute a resource that has a different origin. 

In another folder I had created Javascript Front End to have HTML and JS connect with the backend. By running the backend server, this is how I got it connected with the front end of the project. We have to use a fetch in order to grab the information from a JSON file. It was interesting because every DOM element that is attached, I was able to see it happen right before my eyes. I also split the javascript files in order to have access to each separate class. 

I was having a huge issue with the reviews not showing up on my page. I had console.log all my variables and the reviews container to see if it was appending to the page. It showed in my console, but for some reason it wasn't showing on the page. I was able to discover why, it was because I needed to manually to display the container. It's amazing how console.log can be a great debugging tool. 

It took me a while to complete the styling of the website. It has taught me how HTML and CSS works collectively. It has been a while that I've used HTML and CSS, but I learned that you need to write the correct ID's and classes in order to show the styles on the page. 
<commit_msg>Updating my blog post.<commit_after>---
layout: post
title:      "Javascript: Project Mode"
date:       2020-02-24 16:47:45 -0500
permalink:  javascript_project_mode
---


So I've been learning Javascript for a few months now and it's been pretty interesting. After learning Ruby on Rails, learning Javascript has made it a bit easier to learn. The syntax is definitely different, but I'm getting used to it. The idea for my project is to be able to track and budget things that you've purchased. I got this idea because I've been purchasing a lot of makeup products specifically and don't have the time to use them. 

The first things I've done was to create a Rails API. By typing this into the terminal: rails new makeup-api --api, this allowed me to create the backend for this project. API - application programming interface. This API allows us to connect to the internet and send data to a server. The server receives the data and proceeds with the correct actions and presents it back to the user. After doing creating the API, I had started started to work on the rails porition of the backend. By creating migrations I was able to develop a database for the products and reviews. I created routes so that JS knew where to grab data from. CORs is another feature that represents cross origin resources. It's important to know because it allows a HTTP request to execute a resource that has a different origin. 

In another folder I had created Javascript Front End to have HTML and JS connect with the backend. By running the backend server, this is how I got it connected with the front end of the project. We have to use a fetch in order to grab the information from a JSON file. It was interesting because every DOM element that is attached, I was able to see it happen right before my eyes. I also split the javascript files in order to have access to each separate class. 

I was having a huge issue with the reviews not showing up on my page. I had console.log all my variables and the reviews container to see if it was appending to the page. It showed in my console, but for some reason it wasn't showing on the page. I was able to discover why, it was because I needed to manually to display the container. It's amazing how console.log can be a great debugging tool. 

It took me a while to complete the styling of the website. It has taught me how HTML and CSS works collectively. It has been a while that I've used HTML and CSS, but I learned that you need to write the correct ID's and classes in order to show the styles on the page. 

{'fraction_non_alphanumeric': 0.030362389813907934, 'fraction_numerical': 0.007051909892262488, 'mean_word_length': 3.872137404580153, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '365627', 'n_tokens_mistral': 1237, 'n_tokens_neox': 1140, 'n_words': 911}