JavaScript Project
victoriaehrbar
Posted on January 14, 2022
I finished my phase 4 project for Flatiron School! I created a single-page web application for my JavaScript project.
I created 2 separate repos for the front end and back end. The back end was fairly similar to the phase 3 Rails project, with controllers, models, and has_many relationships.
My project was a book review/tracker, where a user can input a title, author, description, and category/genre. A category has_many books and a book belongs_to a category.
While it was interesting to create a mini Rails project and review some old material, I was most interested in the front end JavaScript portion and refining what I learned in phase 4. I utilized the fetch method to get the book data to display on the page, display new posts, and to delete posts.
The back end part of the project required creating a Rails API, which was interesting as the phase 3 Rails project did not incorporate this. The front end JavaScript portion of this project communicates with the API for the front end and back end to work together.
In JavaScript, event listeners are used to create actions. For example, my project has an attachDeleteButtonListener, which lets the server know that when the delete button is clicked, that book entry should be removed from the page. There is also another event listener that lets the page know to create a new book when "submit" is clicked on the new book form.
Overall, the JavaScript project was a great fusion of Rails and JavaScript that allowed me to synthesize my JavaScript knowledge and create a fun single-page web application.
Posted on January 14, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 30, 2024