Posts

Showing posts from January, 2022

Building a Mood Tracker Single-Page App with a Rails Backend and Javascript Frontend

Image
  What is a Single-Page Application? Before diving into my project, I really wanted to explore what a single-page application even is. The main difference here is that compared to the traditional way of a web server loading a completely new page, SPApps operate by dynamically rewriting the page each time an Event is triggered. The user’s interface is supplemented with information provided by the webserver(the backend). This doesn’t refresh the page. Therefore maintaining the criteria to stay a single page application.  How do things get displayed though if the page is not refreshing? The frontend interface is controlled by Javascript via AJAX without page refreshes which translates data from the backend as JSON. Now instead of HTML being served from the server data is being sent via JSON rendering as the view. This was a little confusing to me at first because I didn’t know how JSON, which operates as a string can display data in an organized way. This is easily done however b...