NickAtUoA
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Lavender-Lions Final Project Report ========== ## Table of Contents [toc] ## Our Webapp - An Introduction Welcome to the blogging system set up by the Lavender Lions. With this blogging system you are able to create an account and compose blog articles. Composed blog articles can then be viewed by everyone whether they are logged in or not. Logged in users also have the ability to edit or delete their own content. They are also able to edit the details of their profile. ## Compulsory Features - What's Done ### New Accounts Created a handlebars view with a an html form. Form is rendered on the server side using a GET request. When form is submitted a POST request is sent with the data from the submission. This data is then sent to the SQL database via a Data Acces Object(DAO) template. ### Live Username Checks The username field when creating an account needs to check the database for whether the username entered exists or not. This required client side JavaScript code to retrieve data entered into the text field on 'keyup'. This sent a GET request to the server side. The server side route then fetched data from the SQL database via a DAO template. If the username exists then an error message is displayed and the user is unable to submit the form. If the username doesn't exist then the user is able to submit the form. ### Confirm Password There are two text fields for password input. The password field and the confirm password field. Client side JavaScript code was used to check whether data entered in the confirm password field matched data entered in the password field. If the data inputs did not match then an error message is displayed and the user is unable to submit the form. If the passwords match then a message is displayed stating that the passwords match and the user is able to submit the form. ### User Avatar Choice When the user makes their account, radio buttons give the user 5 avatar options. Once selected and submitted this infomation is stored in the database, associated with their unique ID. Whenever the user is logged on, this avatar is rendered in the navbar. The user can change their selected avatar by navigating to the 'change user details' page located under 'profile'. ### Login/Logout Capability Registered users are able to login/logout via the buttons presented in the navigation bar. While logged in, the pages will update accordingly, e.g. navbar will show "my profiles", "my articles" and "compose article"; commenting functions are activated, and users can delete articles from the "authors" page. ### Encrypted Passwords We were required to encrypt passwords and not store them as plain text inputs in the database. The encryption was achieved using the bcrypt package. Passwords entered as plain text by the user is hashed using bcrypt. Hashing turns the enterd password into a short string of letters and/or numbers using an encryption algorithm. Then using another bcrypt function we compare the enterd plain text password and hashed password to ensure that the user can still log in with the plain text password. ### Browsing All Articles & Authored Articles All visitors are able to view the full list of articles in the "articles" page. There is also a separate page that groups the articles written by all authors in the "authors" page. While logged in, authors can also view their own articles through the "my articles" link in the navbar. ### Add, Edit and Delete Articles While logged in, the user can compose articles. When a user is editing a article they composed, the articles will be loaded into the "edit article" page, and the user can easily modify them; if the user wants to delete an article, they can do so in the "my articles" page, which will prompt the users on whether they're *sure* they want to delete it. ### WYSIWYG Article Composition & Image storage Implemented a rich text editor called TinyMCE. This allows users to edit their responses in a textarea input field. They can add images and format their text input. This is initialised by adding a script in the head tag of the main handlebars layout. ### Editable Account Info When the user navigates to the 'My Account' page, they can change all of their personal infomation provided when they made their account. All of their information is rendered onto the page. If they change their username, the browser will inform the user if their selected username is available. If the username is taken, the user will not be able to submit the form because the submit button will be disabled. ### Consistent and Responsive Website Feel The use of handlebars layout allows a consistent navbar/footer in all the pages rendered. For repeated sections, the use of handlebar partials (or pieces) has been implemented. Certain minor repeated objects (e.g. submit buttons) has been made into a generic class in CSS and styled that way. "Flex" was used in many elements to allow automatic reshuffling of content. In other cases, a completely different layout has been used for smaller screens, e.g. Navbar adds a dropdown menu on screen sizes < 960px. ## Optional Features - What To Look Out For ### Forgot Password Feature The user can reset their password by clicking on the forgot password link on the login page. The password reset has three steps: 1. User inputs their username, which is automatically checked against the database. 2. User is prompted to input the answer to their security question 3. User enters a new password and confirms it. Client side js ensure that the passwords matches, and upon submitting the password will be updated. ### Random Article Cards At the end of each articles, as well as home page, there are cards of randomly chosen, non-repeating articles. The implementation of these cards were through the use of "partials" in Handlebars. ### Upload Image Functionality To supplement the articles card display, image upload functionality was implemented using the multer package. ### Content Warning Articles can be tagged with "contains sensitive content". When the page is opened, a content warning will placed over the content of the page (not affecting the navbar), and the content of the page will be blurred. This effect stays until the user clicks on a button or click on the blurred sections to dismiss it. As an additonal challenge, this modal was done purely on CSS. ### Commenting Functionality Commenting is available for any users that are logged in. Users may submit in similar fashion as composing articles (using tinymce). The comments are tied to each articles and the user who submitted it. Extra effort was made to add the user's avatar, comment date/time and user's name above the relevant comment. ### Confirmation for Deleting of Account & Messages Upon clicking on "delete account" or "delete article", a transition would occur where a second confirmation will show up to confirm that the deletion of the account/article was deliberate. As an additional challenge, this was done on purely CSS. ### Scrapped Optional Features: - Admin page - Tagging articles & filtering based on tags - Upvotes/likes on articles - User's favorite articles ## How to Setup ### Database File Instructions File should be named **"blogDB.db"** ### To-dos Before Running Our Webapp Simply run `npm install`, then `npm start` in the terminal. ### Example User Logins | Username | Password | | ---------- | -------- | | andrewMead | admin | | hviv036 | test | | nyel451 | test | | jsam970 | test | ## Other Comments Lavender Lion Team Members - Nicholas Kam - Rachel MacLachlan - Sunita Tharani - Noel Yeldos

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully