04 Web APIs: Personal Blog

Your Task

In this challenge, you'll create a two-page website where users will input and view blog posts. It includes building a content form, dynamically rendering blog posts, and implementing a light/dark mode toggle. As you code, you'll gain practical JavaScript experience, explore the Document Object Model's power, and set the stage for more advanced tasks.

User Story

AS A marketing student,
I WANT a personal blog
SO THAT I can showcase my thoughts and experiences.

Acceptance Criteria

GIVEN a personal blog
WHEN I load the app,
THEN I am presented with the landing page containing a form with labels and inputs for username, blog title, and blog content.
WHEN I submit the form,
THEN blog post data is stored to localStorage.
WHEN the form submits,
THEN I am redirected to the posts page.
WHEN I enter try to submit a form without a username, title, or content,
THEN I am presented with a message that prompts me to complete the form.
WHEN I view the posts page,
THEN I am presented with a header, with a light mode/dark mode toggle, and a "Back" button.
WHEN I click the light mode/dark mode toggle,
THEN the page content's styles update to reflect the selection.
WHEN I click the "Back" button,
THEN I am redirected back to the landing page where I can input more blog entries.
WHEN I view the main content,
THEN I am presented with a list of blog posts that are pulled from localStorage.
WHEN I view localStorage,
THEN I am presented with a JSON array of blog post objects, each including the post author's username, title of the post, and post's content.
WHEN I take a closer look at a single blog entry in the list,
THEN I can see the title, the content, and the author of the post.
WHEN I view the footer,
THEN I am presented with a link to the developer's portfolio.

Getting Started

Your file structure should look like the following:

my-blog
├── assets
│   ├── css
│   │   ├── blog.css
│   │   ├── form.css
│   │   └── styles.css
│   └── js
│       ├── blog.js
│       ├── form.js
│       └── logic.js
├── index.html
├── blog.html
└── README.md

Mock-Up

The following animation demonstrates the application functionality:

A user adds a blog through a form, then the post appears on the following page.

Grading Requirements

Note: If a Challenge assignment submission is marked as “0”, it is considered incomplete and will not count towards your graduation requirements. Examples of incomplete submissions include the following:

  • A repository that has no code

  • A repository that includes a unique name but nothing else

  • A repository that includes only a README file but nothing else

  • A repository that only includes starter code

This Challenge is graded based on the following criteria:

Technical Acceptance Criteria: 40%

  • Satisfies all of the preceding acceptance criteria.

Deployment: 32%

  • Application deployed at live URL.

  • Application loads with no errors.

  • Application GitHub URL submitted.

  • GitHub repository contains application code.

Application Quality: 15%

  • Application user experience is intuitive and easy to navigate.

  • Application user interface style is clean and polished.

  • Application resembles the mock-up functionality provided in the Challenge instructions.

Repository Quality: 13%

  • Repository has a unique name.

  • Repository follows best practices for file structure and naming conventions.

  • Repository follows best practices for class/id naming conventions, indentation, quality comments, etc.

  • Repository contains multiple descriptive commit messages.

  • Repository contains quality readme file with description, screenshot, and link to deployed application.

Review

You are required to submit BOTH of the following for review:

  • The URL of the functional, deployed application.

  • The URL of the GitHub repository, with a unique name and a readme describing the project.


© 2024 edX Boot Camps LLC. Confidential and Proprietary. All Rights Reserved.