The Inspirational Quotes Project

This project utilizes the inspirational-quotes library to develop an API service between server and client.

You can add your own quotes here inspirational quote web interface

Setup

Clone the repo and install npm library inspirational-quotes

Prerequisites

  1. VS Code
  2. A good understanding of API and Html, Css, and Javascript.

Installation

For this particular project, there are no specific installation requirements.

Deployment

This project is hosted on Github.

Built with

Authors

License

Attribution 4.0 International (CC BY 4.0)

Acknowledgements




#Updates 03/08/2020 I used NedB and created a databse for this inspirational quotes. The process is quite simple for me.

I ran into problems with it first since the json file I worked with has two elements in one object. But then I tried to use the console.log to trouble shoot and it worked great.

One thing it didn't work was due to me not installing the nedb. nedb-install

I used several methods from db to find, update, and remove specific items.

I tried to find "Chinese Proverb" in the from variable in the database and succeeded. chinese-proverb

I also deleted my test quotes by deleting the _id.

deleting-the-id

Notes & Process

I wanted to create a website where users can contribute to the existing database. I chose inspirational-quotes since it is well documented. I followed the examples in the files when I installed the library.

Although it took me quite a while to understand the code, I am glad I figured most of the things out and I did the coding project by myself and with the help of Google.

Process & Documentation

I followed the tutorials of the Back-end-foundation-workbook since I couldn't really follow in class. The extra time spent on doing the exercises is worth it. But this week, I spent an extreme amount in learning the back end. It is quite harder than the front end that I am more familiar with.

Challenges & Struggles

I ran into several bugs during this project:

  1. Due to the wrong src for client.js, the console keeps telling me the window is undefined.

  2. I used Postman to figure out what I should do to send an object of quote and author. But it really took me a long time to figure it out.

sending-request-through-POSTMAN

  1. At first, when I try to POST anything, it only shows null or undefined.

screenshot-of-coding-error

  1. In my console, it prints out the whole object without parsing out the text and from.

screenshot-of-coding-error

  1. I couldn't add my textInput to the existing array upon mouse click.

screenshot-of-not-able-to-add-content-to-the-array

  1. When I wanted to console.log the array content, it shows me the position of the element instead.

inspirational-quote-web-interface

Questions

I am still confused about using the function from another js file. In the example I saw, they used "module.exports".

References