Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a3-ian-poulsen #53

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
131 changes: 25 additions & 106 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,114 +1,33 @@
Assignment 3 - Persistence: Two-tier Web Application with Database, Express server, and CSS template
===
## To Do List Application

Due: September 19th, by 11:59 AM.
http://a3-ian-poulsen.glitch.me

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.)
This application is a simple to do list created using Express and MongoDB.
Users can create accounts and log in to access their very own to do list.
It was challenging to implement authentication, but I went with the easiest option using cookies and plaintext credentials (yikes!).
It was also quite challenging to optimise the Lighthouse tests. I used the MVP CSS framework because I thought it looked nice.
I had to overwrite the color used for the buttons because there was not enough contrast to pass the accessibility requirements.
I only used two middleware packages: cookie-session and compression

Baseline Requirements
---
- Cookie-session is used to store the user session identifier.
- Compression is used to compress text to improve performance.

Your application is required to implement the following functionalities:

- 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.
- Persistent data storage in between server sessions using [mongodb](https://www.mongodb.com/cloud/atlas) (you *must* use mongodb for this assignment). You can use either the [official mongodb node.js library](https://www.npmjs.com/package/mongodb) or use the [Mongoose library](https://www.npmjs.com/package/mongoose), which enables you to define formal schemas for your database. Please be aware that the course staff cannot provide in-depth support for use of Mongoose.
- 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.

Your application is required to demonstrate the use of the following concepts:

HTML:
- HTML input tags and form fields of various flavors (`<textarea>`, `<input>`, checkboxes, radio buttons etc.)
- HTML that can display all data *for a particular authenticated user*. Note that this is different from the last assignnment, which required the display of all data in memory on the server.

Note that it might make sense to have two pages for this assignment, one that handles login / authentication, and one that contains the rest of your application.
For example, when visiting the home page for the assignment, users could be presented with a login form. After submitting the login form, if the login is
successful, they are taken to the main application. If they fail, they are sent back to the login to try again. For this assignment, it is acceptable to simply create
new user accounts upon login if none exist, however, you must alert your users to this fact.

CSS:
- CSS styling should primarily be provided by your chosen template/framework.
Oftentimes a great deal of care has been put into designing CSS templates;
don't override their stylesheets unless you are extremely confident in your graphic design capabilities.
The idea is to use CSS templates that give you a professional looking design aesthetic without requiring you to be a graphic designer yourself.

JavaScript:
- At minimum, a small amount of front-end JavaScript to get / fetch data from the server.
See the [previous assignment](https://github.com/cs-4241-23/shortstack) for reference.

Node.js:
- A server using Express and a persistent database (mongodb).

General:
- Your site should achieve at least 90% on the `Performance`, `Best Practices`, `Accessibility`, and `SEO` tests
using Google [Lighthouse](https://developers.google.com/web/tools/lighthouse) (don't worry about the PWA test, and don't worry about scores for mobile devices).
Test early and often so that fixing problems doesn't lead to suffering at the end of the assignment.

Deliverables
---

Do the following to complete this assignment:

1. Implement your project with the above requirements. I'd begin by converting your A2 assignment. First, change the server to use express. Then, modify the server to use mongodb instead of storing data locally. Last but not least, implement user accounts and login. User accounts and login is often the hardest part of this assignment, so budget your time accordingly.
2. If you developed your project locally, deploy your project to Glitch (unless completing the alternative server technical acheivement described below), and fill in the appropriate fields in your package.json file.
3. Test your project to make sure that when someone goes to your main page on Glitch (or an alternative server), it displays correctly.
4. Ensure that your project has the proper naming scheme `a3-yourfirstname-yourlastname` so we can find it.
5. Fork this repository and modify the README to the specifications below.
6. Create and submit a Pull Request to the original repo. Name the pull request using the following template: `a3-firstname-lastname`.

Acheivements
---

Below are suggested technical and design achievements. You can use these to help boost your grade up to an A and customize the
assignment to your personal interests, for a maximum twenty additional points and a maximum grade of a 100%.
These are recommended acheivements, but feel free to create/implement your own... just make sure you thoroughly describe what you did in your README,
why it was challenging, and how many points you think the achievement should be worth.
ALL ACHIEVEMENTS MUST BE DESCRIBED IN YOUR README IN ORDER TO GET CREDIT FOR THEM.

*Technical*
- (10 points) Implement OAuth authentication, perhaps with a library like [passport.js](http://www.passportjs.org/).
*You must either use Github authenticaion or provide a username/password to access a dummy account*.
Course staff cannot be expected, for example, to have a personal Facebook, Google, or Twitter account to use when grading this assignment.
Please contact the course staff if you have any questions about this. THIS IS THE HARDEST ACHEIVEMENT OFFERED IN WEBWARE. You have been warned!
- (5 points) Instead of Glitch, host your site on a different service like [Heroku](https://www.heroku.com) or [Digital Ocean](https://www.digitalocean.com). Make sure to describe this a bit in your README. What was better about using the service you chose as compared to Glitch? What (if anything) was worse?
- (5 points) Get 100% (not 98%, not 99%, but 100%) in all four lighthouse tests required for this assignment.

*Design/UX*
- (10 points) Make your site accessible using the [resources and hints available from the W3C](https://www.w3.org/WAI/), Implement/follow twelve tips from their [tips for writing](https://www.w3.org/WAI/tips/writing/), [tips for designing](https://www.w3.org/WAI/tips/designing/), and [tips for development](https://www.w3.org/WAI/tips/developing/). *Note that all twelve must require active work on your part*.
For example, even though your page will most likely not have a captcha, you don't get this as one of your twelve tips to follow because you're effectively
getting it "for free" without having to actively change anything about your site.
Contact the course staff if you have any questions about what qualifies and doesn't qualify in this regard.
List each tip that you followed and describe what you did to follow it in your site.
- (5 points) Describe how your site uses the CRAP principles in the Non-Designer's Design Book readings.
Which element received the most emphasis (contrast) on each page?
How did you use proximity to organize the visual information on your page?
What design elements (colors, fonts, layouts, etc.) did you use repeatedly throughout your site?
How did you use alignment to organize information and/or increase contrast for particular elements.
Write a paragraph of at least 125 words *for each of four principles* (four paragraphs, 500 words in total).

Sample Readme (delete the above when you're ready to submit, and modify the below so with your links and descriptions)
---

## Your Web Application Title

your glitch (or alternative server) link e.g. http://a3-charlie-roberts.glitch.me

Include a very brief summary of your project here. Images are encouraged, along with concise, high-level text. Be sure to include:

- the goal of the application
- challenges you faced in realizing the application
- what authentication strategy you chose to use and why (choosing one because it seemed the easiest to implement is perfectly acceptable)
- what CSS framework you used and why
- include any modifications to the CSS framework you made via custom CSS you authored
- the five Express middleware packages you used and a short (one sentence) summary of what each one does. If you use a custom function for *one* (and one alone) middleware please
add a little more detail about what it does.
**I am using my one late submission for A3**

## Technical Achievements
- **Tech Achievement 1**: I used OAuth authentication via the GitHub strategy

- **Technical Achievement 1**: Achieved 100% on all four lighthouse tests (see lighthouse.jpg)

### Design/Evaluation Achievements
- **Design Achievement 1**: I followed the following tips from the W3C Web Accessibility Initiative...

- **Design Achievement 1**: I followed the following ten tips from the W3C Web Accessibility Initiative:
- **Associate a label with every form control:** I put labels on all of my forms: login, signup, add, edit, delete, and the "Done" checkbox in the table.
- **Identify page language:** \<html lang="en"\>
- **Write code that adapts to the user’s technology:** I adapted the code to user technology using the line "name="viewport"content="width=device-width, initial-scale=1"
- **Provide sufficient contrast between foreground and background:** I overwrite the CSS to ensure that the buttons had an appropriate contrast ratio
- **Provide clear instructions:** When a user successfully signs up, the app then tells them "Registration successful, you can now log in." The labels for the log in, sign up, and table explain to the user what to do
- **Provide easily identifiable feedback:** Since the login and signup fields are required, the app tells the user "Please fill in this field"
- **Provide informative, unique page titles:** Page titles are "To Do List" and "Login – To Do List"
- **Make link text meaningful:** The link to my github has the text "Check out the GitHub repo for this app!"
- **Include alternative text for images &&**
- **Write meaningful text alternatives for images:** The smiley face image has the alternative text of "Smiling emoji giving a thumbs up"
Binary file added lighthouse.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
87 changes: 87 additions & 0 deletions main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="en" class="roboto-mono-basic">
<head>
<title>To Do List</title>
<meta
charset="utf-8"
name="viewport"
content="width=device-width, initial-scale=1"
/>
<meta name="description" content="A simple to-do list." />
<script src="js/main.js"></script>
<link rel="stylesheet" href="/css/mvp.css" defer />
<!-- get rid of favicon error -->
<link rel="icon" href="data:;base64,iVBORw0KGgo=" />
</head>
<body>
<button type="logout" id="logout">Logout</button>
<p></p>
<main>
<header>
<h1>To Do:</h1>
<p></p>
</header>
<section>
<form id="todoForm">
<input type="text" id="item" placeholder="Add an item to do!" />
<input type="text" id="notes" placeholder="Notes" />
<input type="date" id="deadline" placeholder="Deadline" />
<p></p>
<button type="submit" id="submit">submit</button>
</form>

<table class="tab">
<thead>
<tr>
<th style="width: 20%">Item</th>
<th style="width: 20%">Notes</th>
<th style="width: 20%">Deadline</th>
<th style="width: 20%">Priority</th>
<th style="width: 20%">Done</th>
</tr>
</thead>
<tbody id="body"></tbody>
</table>
</section>
<div id="editor" style="display: none">
<h2>Edit Entry</h2>
<form id="editForm">
<label for="editItem">Item:</label>
<input type="text" id="editItem" name="item" required /><br />
<label for="editNotes">Notes:</label>
<input type="text" id="editNotes" name="notes" required /><br />
<label for="editDeadline">Deadline:</label>
<input type="date" id="editDeadline" name="deadline" required /><br />
<input type="hidden" id="editId" />
<button type="submit">Save Changes</button>
<button type="button" onclick="closeEditor()">Cancel</button>
</form>
</div>
</main>
</body>
<footer
style="
display: flex;
justify-content: space-between;
align-items: center;
min-height: 60px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
"
>
<a
href="https://github.com/skypanther26/a3-skypanther26"
style="max-width: 400px; overflow: hidden"
>Check out the GitHub repo for this app!</a
>
<img
class="thumbsup-img"
src="https://cdn.glitch.global/735c8078-7a70-4d4d-bf4e-fd15243f7c04/thumbsup_resized%20(2).jpg?1726931988333"
alt="Smiling emoji giving a thumbs up"
width="50"
height="50"
style="flex-shrink: 0"
/>
</footer>
</html>
19 changes: 19 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "cs-4241-a3-pesistance",
"version": "1.0.0",
"description": "Assignment 3: Persistance",
"author": "Ian Poulsen",
"scripts": {
"start": "node server.js"
},
"dependencies": {
"express": "^4.17.1",
"mongodb": "4.16",
"mime": "^2.4.4",
"cookie-session": "^2.1.0",
"compression": "^1.7.4"
},
"engines": {
"node": "^16.x"
}
}
Loading