Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
5e75fc6
update locally
capricieuxV Sep 28, 2022
328a3c8
update json
capricieuxV Sep 28, 2022
513d4eb
updated index
capricieuxV Sep 28, 2022
c304a3f
update favicon
capricieuxV Sep 28, 2022
57f845d
updated html
capricieuxV Sep 28, 2022
0307159
change role
capricieuxV Sep 28, 2022
645f497
change ui
capricieuxV Sep 28, 2022
eb5e870
change css
capricieuxV Sep 28, 2022
f2b9333
update messenger
capricieuxV Sep 28, 2022
207595a
updated a3
capricieuxV Sep 29, 2022
c1a26de
done
capricieuxV Sep 29, 2022
701f897
done
capricieuxV Sep 29, 2022
6e945e9
add log out
capricieuxV Sep 29, 2022
be937b0
updated login
capricieuxV Sep 29, 2022
86a9895
Create CNAME
capricieuxV Sep 29, 2022
5060d72
Update CNAME
capricieuxV Sep 29, 2022
32af5fb
Delete CNAME
capricieuxV Sep 29, 2022
eb7b894
Create CNAME
capricieuxV Sep 29, 2022
5cf204a
Delete CNAME
capricieuxV Sep 29, 2022
6a58385
ignore node_modules
capricieuxV Sep 29, 2022
e13ff9a
delete package-lock.json
capricieuxV Sep 29, 2022
5be26e3
?
capricieuxV Sep 29, 2022
25c1584
change server name
capricieuxV Sep 29, 2022
77bf013
add json lock
capricieuxV Sep 29, 2022
399f9bc
update
capricieuxV Sep 29, 2022
a609e21
Update README.md
capricieuxV Sep 30, 2022
dd35d32
Update README.md
capricieuxV Sep 30, 2022
770a6db
Update README.md
capricieuxV Sep 30, 2022
1e75011
Update README.md
capricieuxV Sep 30, 2022
76bcab3
Update README.md
capricieuxV Sep 30, 2022
7d37237
Update README.md
capricieuxV Sep 30, 2022
34a4fe9
Update README.md
capricieuxV Sep 30, 2022
9997f19
Update README.md
capricieuxV Sep 30, 2022
114504e
Update README.md
capricieuxV Sep 30, 2022
b3ac2ff
Update README.md
capricieuxV Sep 30, 2022
3019f57
Update README.md
capricieuxV Sep 30, 2022
e62ea78
Update README.md
capricieuxV Sep 30, 2022
bd02c4b
update placeholder
capricieuxV Sep 30, 2022
e389e74
Update README.md
capricieuxV Sep 30, 2022
3c8d0b1
Merge branch 'main' of github.com:capricieuxV/a3-persistence
capricieuxV Sep 30, 2022
7ef9e7f
run tester
capricieuxV Sep 30, 2022
1f76c0a
Update README.md
capricieuxV Sep 30, 2022
6971685
Update README.md
capricieuxV Sep 30, 2022
9d1a0a7
Update README.md
capricieuxV Sep 30, 2022
7cc1e7f
Update README.md
capricieuxV Sep 30, 2022
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
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions .idea/.gitignore

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

5 changes: 5 additions & 0 deletions .idea/.gitignore 2

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

1 change: 1 addition & 0 deletions .idea/.name

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

14 changes: 14 additions & 0 deletions .idea/a3-persistence 2.iml

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

14 changes: 14 additions & 0 deletions .idea/a3-persistence.iml

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

7 changes: 7 additions & 0 deletions .idea/jsLibraryMappings 2.xml

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

7 changes: 7 additions & 0 deletions .idea/jsLibraryMappings.xml

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

8 changes: 8 additions & 0 deletions .idea/modules.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs 2.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

167 changes: 55 additions & 112 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,116 +1,59 @@
Assignment 3 - Persistence: Two-tier Web Application with Database, Express server, and CSS template
===

Due: September 22nd, 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.
- 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.

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/cs4241-19a/a2-shortstack) for reference.

Node.js:
- A server using Express, at least five pieces of Express middleware, 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. A good potential starting point is to use the "hello-express" project template inside of Glitch; this appears as an option when you hit the "New Project" button. Use the work you did in the last assignment as a reference to implement functionality.
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, 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.
## Messenger

Digital Ocean: http://165.227.253.229/

- The goal of this application is to send message to receiver. For a similar use of note, user could view the detail information of the message they choose to send and be able to edit the corresponding messege and save witht the changes.
- The most challenge I've met is to host the application on the external site. I've tried heroku for the first time but I don't know why there's nothing shown on the site with everything built and run appropriatedly. I've tried to switched from github connection to CLI. I installed and configured the heroku CLI and tried to build a new project, with every configuration updated with running `npm install --save --save-exact`, but still nothing happened. Then I changed to ditial ocean. The application site is still having issue with the deployment. I've viewed the log and tried to fix it from the error it gave me, but things are not working as what I expected. So I changed to the droplet channel, and redo everything in the console, including the configurations. Then I had the ip address working well with `node server.js`. However, when I terminated the window, the application crashed. I've tried to do the doman things,and did a lot researches, tried _go_ _daddy_, _namecheap_. I've tried `tmux`, `screen`, and other sync methods to make everything working in background, but failed. At last, I've used pm2 to solve it. pm2 is a great application for keeping a node process running regardless of crashes, basically whenever a crash occurs it just restarts node using the same script.
- I chose password-based authentication(OAuth) strategy which is the most common one to me. Though using passport seems to be easier, I felt like passowrd-based authentication seems to be more appropriate to my app.
- I've used bootstrap for stylesheet since it is easy to manage and configure. The syntax could be simply found on the official lib.
- I've changed the _body_, _table_, _title_, _header_ etc. stuffs to be my assigned color and font.
- middleware
* cookieSession - Establish cookie-based sessions.
* body-parser - Parse HTTP request body.
* morgan - HTTP request logger.
* serve-favicon - Serve a favicon.
* serve-static - Serve static files.

## Lighthouse Score
![100](https://media.discordapp.net/attachments/1025448793862316124/1025448875638661160/Xnip2022-09-29_05-28-54.jpg?width=1872&height=936)

## Technical Achievements
- **Tech Achievement 1**: I used OAuth authentication via the GitHub strategy
- I used OAuth authentication via the GitHub strategy
- I host your site on Digital Ocean
- Get 100% in all four lighthouse tests

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


1. Provide informative, unique page titles
* I added page tile and corresponding favicon to inform about the page
2. Make link text meaningful
* I made each link followed url-friendly rule and are meaninngful to lead to
3. Provide clear instructions
* I have instructiona and alerts for each steps/mistakes user would ever made
4. Keep content clear and concise
* I have everything set up clearly and organized. Codes are written with `<div>` to stay in organized paragraph
5. Associate a label with every form control
* Having label for every form control and placeholder for instruction
6. Identify page language and language changes
* I identified the page language to be English
7. Provide sufficient contrast between foreground and background
* I have everything in off-white, and significant colors of interactive items
8. Ensure that interactive elements are easy to identify
* Buttons/Inputs/Links are easy to find with placeholder/labels/captions
9. Provide clear and consistent navigation options
* Have nice label/instruction on every element, having alearts to guide the users if they have misoperations
10. Ensure that form elements include clearly associated labels
* Form has label shows the detail info and placeholder for user to take as an example
11. Provide easily identifiable feedback
* I have pop-up feedback for actions users do
12. Use headings and spacing to group related content
* I have heading and spacing to be organized well for related content

</details>

- **Design Achievement 2**:
- I put the interactive element and all the infomation elements in their respective divisions, so that they can be simply identified. After logging in, the various sections of my messenger page are also very well organized, separated by columns. The alignment principle says that elements on a page should have a visual connection to other content on the page. On my login page, the username input, password input, submit button and create account button are all aligned with each other, in this step I used the alignment method in bootstap to make them the same width. On the message page, subject and receipt are aligned, just like how email is designed. The message box is on the right and has a relatively large height to align with the subject and receiver. The principle of repetition means that my important elements will be repeated. For example, the title of the messenger will be displayed very large on the running page of the entire system. The principle of contrast means that if two elements are not exactly the same, then they should look different. My reflection in this regard is mainly the contrast of page colors. Black and white are the most obvious contrasting colors, which I use on most of the body. And for buttons, different colors are arranged on buttons with different functions, which related to our common knowlege.
1 change: 1 addition & 0 deletions node_modules/.bin/mime

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

1 change: 1 addition & 0 deletions node_modules/.bin/mime 2

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

1 change: 1 addition & 0 deletions node_modules/.bin/nodemon

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

1 change: 1 addition & 0 deletions node_modules/.bin/nodemon 2

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

1 change: 1 addition & 0 deletions node_modules/.bin/nodetouch

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

1 change: 1 addition & 0 deletions node_modules/.bin/nodetouch 2

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

1 change: 1 addition & 0 deletions node_modules/.bin/nopt

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

1 change: 1 addition & 0 deletions node_modules/.bin/nopt 2

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

1 change: 1 addition & 0 deletions node_modules/.bin/semver

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

1 change: 1 addition & 0 deletions node_modules/.bin/semver 2

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

Loading