lab 4 movie database
ITMD 442/542 Lab 4 Objective In this lab you practice the concepts of the CRUD operations (create, read, update, delete) in a Node JS Express application that uses MongoDB Atlas to store the data. The objective of this assignment is to make a Node JS Express application that acts as a movie database and allows the user to create, edit, view, or delete individual movie records. Requirements • • • • • • • • • • Build a movie database application in Node JS and Express This application will be very similar to the Lab 2 assignment with a different data model. No authentication on this application this time since we haven’t discussed that. You should use express-generator to create your project for you, make use you update all dependencies with npm-check-updates as show in class demos before you start. Follow examples from class demos. Initialize this project directory as a new git and github repository. Do not commit your node_modules directory to your repository so exclude it with a .gitignore file. GitHub Requirements o New Lab 4 Repository and it must be a Private Repository o Add Instructor and TA as collaborators under the repo settings. ▪ Our GitHub ids are briantbailey and vkatta316 o Initial commit should be just the code generated by express-generator and your empty readme file. o Every time you get something working you should make a commit. We expect to see many commits with incremental progress in your repository. Error on too many commits over too few for this exercise. o Your commit messages should be a short sentence that describes the commit. o Commit your code to the repo often as you implement features. I do not want to see the project go from nothing to finished in one commit. That is a warning sign that you did not do all the work yourself. Use whatever template/view engine you like but I would recommend pug. Use standard HTML templates and forms vs any front-end JavaScript. You may use any CSS frameworks or libraries you like if you want. Database Requirements o Use MongoDB Atlas for data storage. o You should use the mongodb module to interact with your database from Express. o Create a free MongoDB Atlas account and create free cluster/database to use. o We discussed these steps in a previous class but here is the Mongo help docs. • • • • ▪ https://www.mongodb.com/docs/atlas/getting-started/ o Use the node dotenv module to protect your atlas credentials or connection string as we demonstrated in class. o Do not include your .env file in your repository. Make sure to add it to your gitignore file since it has your password in it. o Make sure to submit your .env file to blackboard along with your application git repository url. A movie should consist of the following data: o ID (Unique identifier to use as a key, not user entered/changeable/viewable on page, generated in DB) o Title (text – Required) o Director (text – Required) o Year (text – Required) o Notes (textarea – Not Required) REST Route Requirement o The index route ( / ) of your application should just be an introduction page to the application and a link/button to “View Movies Database”. On this introduction page include a title, some intro info about the application/lab, and your contact info. o Make your URLs follow a RESTful pattern as much as possible. The main list view of all contacts should be at /movies. o On the main all movies page ( /movies ) you may display the list of contacts as a table or any other HTML structure you like to use. The only data I want to see on the all movies list page is Title, Director, Year and a way to get to the single movie detail view page. o The single movie view page ( /movies/id ) should show the details of the single movie selected. Including Title, Director, Year, and Notes, and ways to edit or delete the movie. Make sure you label each data field, so the user knows what it is. o The create and edit contact form pages will look similar. Make sure you label all fields, so it is clear to the user what is being entered. The user does not enter/edit a contact id it should be generated by MongoDB. Make sure you show validation error messages for required fields. o Do not use GET methods for any operations that could modify data. Those must go through POST methods. o Make sure you validate required fields in your code, don’t just rely on a required attribute on the html input field. Remove all leading or trailing whitespace in any form field. Sanitize user input, do not allow the user to inject HTML/CSS/JavaScript into any form field. PUG will escape any output text for you if you use the templates syntax correctly so this shouldn’t be too difficult. Make sure to add CSS to your pages so they do not look like default HTML formatting. Clone your repository to a new location and test your application to be sure it is working and you have given the proper instructions in your readme file. Graduate Additional Requirements If you are involved in any section of 542 you need to complete the additional requirements listed here. • • • Use HTML/CSS to present the application nicely (bootstrap or another CSS framework is ok). I expect it to not just look like plain basic html in the browser. CSS expectations will be much higher for 542 students. You must break up your application logic routes in separate module files like express generator will set up for you. Do not put everything in the main app.js file. Applications will be graded to a higher standard and more critically if you are in a 542 section. README File Produce a README file in your project that describes some components of this assignment. The readme doesn’t have to be long but should include a few things. The readme should be either a plain text (README.txt) file or a markdown (README.md) file. The readme should be in the root of your repository. • Your Name • Your Email • The Class and Assignment Numbers • Git repository URL • The following sections o Project Description – Brief introduction describing the project in your own words. o Development Environment – Description of your development environment. Include things like computer OS, Node JS version number, editors used, and any other details you think you should include about your environment o Installation/Running Instructions – Include any instructions on how to get the project up and running. Assume someone that doesn’t know how to run an Express or Node JS application. Give the steps from a cloned repository to install dependencies and start the application. o Insights and Results – Include here things you learned, challenges or problems you faced, and any details about the results you received. If you couldn’t get something working this would be the place to describe what you tried and what wouldn’t work. Feel free to embed screenshots for working and non-working features. o References (if needed)– Any resources you need to cite of that you might have used for assistance. Not an excuse to copy and paste but if you need to cite a source, do it here. Due Date / Late Policy This assignment is due Saturday April 6, 2024 11:59 PM Chicago Time. Late assignments will receive a 10% per day deduction starting at 1 minute late. We may discuss this in the following class so no assignments will be accepted as of class (6:25pm) that night if we do. See syllabus for full late policy. No Extensions. Submission Guidelines You must upload your submission, to the blackboard assignment by the due date. The submission must be in the following format and structure. If you do not submit your assignment exactly as specified, you will receive an immediate 10% deduction. Submission Format Specification: Commit all files used to a GitHub Repository and submit to the Blackboard assignment the URL to your GitHub repository where this project is hosted and the .env file that has your atlas credentials. Make sure your repo readme file includes all instructions to download and run your app including what npm commands I need to run to start your application. I will expect to be able to clone down your repository, run npm i to install dependencies, copy your .env file to the project, and run your application without problems so you should test this yourself before submitting.
Collepals.com Plagiarism Free Papers
Are you looking for custom essay writing service or even dissertation writing services? Just request for our write my paper service, and we'll match you with the best essay writer in your subject! With an exceptional team of professional academic experts in a wide range of subjects, we can guarantee you an unrivaled quality of custom-written papers.
Get ZERO PLAGIARISM, HUMAN WRITTEN ESSAYS
Why Hire Collepals.com writers to do your paper?
Quality- We are experienced and have access to ample research materials.
We write plagiarism Free Content
Confidential- We never share or sell your personal information to third parties.
Support-Chat with us today! We are always waiting to answer all your questions.
