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-chenxiiZ #58

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "msedge",
"request": "launch",
"name": "Launch Edge against localhost",
"url": "http://localhost:3001",
"webRoot": "${workspaceFolder}"
}
]
}
155 changes: 41 additions & 114 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,114 +1,41 @@
Assignment 3 - Persistence: Two-tier Web Application with Database, Express server, and CSS template
===

Due: September 19th, by 11:59 AM.

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.)

Baseline Requirements
---

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.

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

### Design/Evaluation Achievements
- **Design Achievement 1**: I followed the following tips from the W3C Web Accessibility Initiative...
## To-do List A3
I have an extension from professor Roberts
Glitch: https:https://a3-chenxiiz.glitch.me

Summary:
- the goal of the application is to make sure people can add tasks as a To-do List and it will show you how many days left before deadline.
- challenges I faced in realizing the application was it's important to be able to get the _id from MongoDb when tasks was submitted, so the delete button can associate with it and to delete tasks from backend too. It took me a couple of days to figure that out.
- I don't have a login for this assignment becasue I am still working on it.
- I have express and MongoDB setup
- I am able to delete task using the delete button to delete the tasks in the backend that shared the same Mongo id.
- I used Bulma as my CSS framework
- Applied a linear gradient background to the entire page
- Limited the width of the form to 50% of the viewport width to avoid it taking up too much space and ensured it's centered on the page.
- Set padding for the table cells and ensured the table headers (th) are bold for better readability.
- Used Flexbox for layout consistency, ensuring the form and table are centered both vertically and horizontally within the viewport.
- I used express.static() :Serves static files (like HTML, CSS, and JavaScript) from the public directory, allowing the client to access these resources directly.
- express.json() :Parses incoming requests with JSON payloads and makes the parsed data available via req.body. This is essential for handling form submissions and API requests.
- dontenv: Loads environment variables from a .env file into process.env, which allows for secure storage and retrieval of sensitive information (e.g., database credentials) without hardcoding them in the codebase.
- And my custom middleware app.use((req, res, next) => { : ensures that the MongoDB connection is established before handling requests. If the connection to the database is not available, the middleware sends a 503 Service Unavailable response to the client.

## Design/UX
W3C
- Descriptive Button Text: I changed the button labels from "Submit" to "Submit Task" and "Delete" to "Delete Task." This ensures that screen readers provide clear instructions about what each button does, making it easier for users with visual impairments or cognitive difficulties to understand the actions.

- Increased Font Size: I increased the font size to make the text more readable for users with low vision. This change ensures that users can comfortably read and interact with the content without needing to zoom in or use assistive technology.

- Sufficient Contrast Ratio (12.5:1): I tested the contrast between the background and text colors and confirmed it has a ratio of 12.5:1, which exceeds the minimum WCAG standard. This makes the text highly legible, ensuring that everyone, including users with visual impairments, can easily read the content.
CRAP principles


-Contrast:
On my to-do list website, the element that receives the most contrast is the header, which features a bold, larger-sized font compared to the rest of the content on the page. I used a darker font color for the title to ensure it stands out from the background, immediately drawing attention when a user visits the page. Additionally, the background gradient—a mix of soft blues, greens, and beige tones—creates a smooth contrast against the text, which is primarily a dark shade. Buttons are given an accent color (brownish tones, like #D2AC8A) to make them pop, especially when compared to the lighter background. This contrast ensures that users immediately know where the interactive elements are and helps them easily locate the key action points.

-Repetition:
Repetition is achieved through the consistent use of a singular font family (Montserrat) across the entire website. This maintains uniformity in the design and provides a polished, cohesive look. The use of consistent spacing and margin throughout both the form elements and the table ensures that the layout feels unified. The button design remains the same across all actions, with the same primary color and hover effect, reinforcing a sense of familiarity for the user. This repetition creates predictability in the interface, helping users feel more comfortable navigating the site, as they don’t have to guess where to click or how elements will behave based on inconsistent designs.

-Alignment:
Alignment is used to maintain a clean, organized layout. All content is center-aligned, which gives a symmetrical, balanced look to the site, helping it feel approachable and easy to navigate. The form elements are stacked vertically with consistent left alignment for the labels, ensuring clarity in user input areas. Meanwhile, the table of tasks is center-aligned to give a neat, organized feel, with columns arranged consistently across the page. This vertical and horizontal alignment creates an easy-to-follow structure, enabling users to find information quickly and ensuring that the design appears orderly, reducing any visual clutter.

-Proximity:
Proximity is used to group related elements together to enhance the user’s understanding of the interface. For instance, in the to-do form, the label and input fields for each task detail (e.g., task name, priority, creation date) are placed in close proximity, indicating they belong together and should be interacted with sequentially. Similarly, the table columns group related information (like task details) together, while actions like delete buttons are placed close to the respective task to clarify their function. This grouping helps users process information efficiently, as related elements are visually close, reducing cognitive load and making the interface more intuitive.
16 changes: 16 additions & 0 deletions node_modules/.bin/mime

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/mime.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions node_modules/.bin/mime.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading