diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..99ddbd67 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules/* +.env \ No newline at end of file diff --git a/README.markdown b/README.markdown index de506211..9545a7bf 100644 --- a/README.markdown +++ b/README.markdown @@ -1,116 +1,38 @@ -Assignment 3 - Persistence: Two-tier Web Application with Database, Express server, and CSS template -=== +# My Digital Library -Due: September 20th, by 11:59 AM. +https://alex-kinley-a3-persistence-csgmg.ondigitalocean.app -This assignnment continues where we left off, extending it to use the most popular Node.js server framework (express), -a database (mongodb), and a CSS application framework / template of your choice (Boostrap, Material Design, Semantic UI, Pure etc.) +My Digital Library is a simple way to keep track of the books you own. +You enter the ISBN, location, and your rating of a book, and then it gets added to your list of books. (for testing purpoes abe books lists isbns of books ex: https://www.abebooks.com/book-search/author/ROALD-DAHL) +The app makes use of (openlibrary.org)[https://openlibrary.org/dev/docs/api/books] books API to get information about a book from its ISBN. -Baseline Requirements ---- +Authenticaion is done using Github OATUH2. Using passportjs with passport-github2 and following their example application this was fairly straightforward. -Your application is required to implement the following functionalities: +The app uses bootstrap 5 as the css framework. In some cases I wrote my own css styling for layout, particuarly for the login screen, and the header of the application. I suspect bootstrap could have done these, but it was going to be more effort to figure out how to do it with bootstrap alone. -- a `Server`, created using Express (no alternatives will be accepted for this assignment) -- a `Results` functionality which shows all data associated with a logged in user (except passwords) -- a `Form/Entry` functionality which allows users to add, modify, and delete data items (must be all three!) associated with their user name / account. -- Use of at least five [Express middleware packages](https://expressjs.com/en/resources/middleware.html). Explore! One of these five middleware -can be a custom function that you write yourself; if you choose to do this, make sure to describe what this function is in your README. -- Persistent data storage in between server sessions using [mongodb](https://www.mongodb.com/cloud/atlas) -- Use of a [CSS framework or template](https://github.com/troxler/awesome-css-frameworks). -This should do the bulk of your styling/CSS for you and be appropriate to your application. -For example, don't use [NES.css](https://nostalgic-css.github.io/NES.css/) (which is awesome!) unless you're creating a game or some type of retro 80s site. +The Express middlware used is: +- bodyparser - for parsing the data passed along with requests +- session - used by passportjs for managing session cookies +- passport.initialize - the basic form of passportjs for authentication +- passport.session - makes passportjs use sessions for persistant connections +- ensureAuthentication (custom function only used for some endpoints) - for endpoint that require login, this checks if the user is authentication, and if they are not, they are redirected to the login page, this just ensures that for pages and api calls that require the user to be logged in, that they are in fact authenticated. -Your application is required to demonstrate the use of the following concepts: +The main challenges I faced with this project were learning how to correctly use bootstrap, especially dealing with the modals was a non-trival endeavor. Additionally using external APIs is always a little bit of a challenge. -HTML: -- HTML input tags and form fields of various flavors (`