Act as a Developer

Task: To generate code for the below requirements with file names.

We will run `npm install` followed by `npm run build-db` and `npm run start` to run your project. Please ensure that your project runs from these commands alone without need for further compilation or installation of dependencies.

Tech Stack: EJS, ExpressJS, NodeJs, SQLite3, SQLite, Bootstrap


Requirements:
Implement these basic features fully to achieve a passing grade.
Author - Home Page:
This is where the Author can create, review and edit articles. The minimum requirements for
the page are as follows:
● It should be accessed through a URL which is distinct from the Reader Home Page
● It should display the blog title, subtitle, and author name
● It should have a second heading which makes it clear that this is the author page
● It should have a link which points to the settings page
● It should have a “Create new draft” button
○ When pressed this should create a new draft article and redirect to it’s edit
page
● It should display a dynamically populated list of published articles
○ The list should display useful information about the articles such as when they
were created, published, and last modified, and number of likes
○ For each article the list should display a sharing link which points to the
relevant Reader - Article Page
○ For each article there should be a delete button for the article. When pressed
this should:
■ Remove the article from the database
■ Reload the page to display the updated information
● It should display a dynamically populated list of draft articles
○ The list should display useful information about the articles such as when they
were created, published, and last modified
○ Each article in the list should be accompanied by a link which points to its edit
page
○ For each article there should be a publish button. When pressed this should:
■ Update the article’s state from draft to published
■ Timestamp the publication date
■ Reload the page to display the updated information
○ For each article there should be a delete button.
Author - Settings Page:
This is where the Author can change the blog title , subtitle and author name. The minimum
requirements for the page are as follows:
● A title which indicates that this is the settings page
● A form with text inputs for Blog title, subtitle, and author name.
○ The form should be dynamically populated with the current settings for the
page
○ The form should have a submit button which updates the settings with the
new values and redirects to the Author - Home Page.
○ Form validation should be used to ensure that all fields have been completed
ahead of submission.
● A back button which points to Author - Home Page.
Author - Edit Article Page:
This is where the author writes, amends and publishes individual articles. The minimum
requirements for the page are as follows:
● Data about the article (Eg. created, last modified)
● A form containing the following input fields and controls:
○ Article title
○ Article subtitle
○ Article text
○ A submit changes button
● The form should be populated with the current article data
● When changes are submitted the article’s last modified date should be changed
● A back button which points to Author - Home Page.
Reader - Home Page:
This is the front page which readers use to access the blog site. The minimum requirements
for the page are as follows:
● It should be accessed through a URL which is distinct from the Author - Home Page
● It should display the blog title, subtitle, and author name
● A list of published articles
○ The article title and publication date should be visible for each item
○ Articles should be ordered by publication date with the latest publication
appearing at the top
○ Clicking on an item in the list should take the user to the Reader - article page
for that particular article
Reader - Article Page:
This is where the reader can read and interact with individual articles. The minimum
requirements for the page are as follows:
● It should display a single article determined by the url
● It should display information about the article including, article title and subtitle,
publication date, number of likes
● It should display the text of the article
● There should be a like button to react to the article
● There should be form for adding a comment to the article containing
○ a text input for the comment.
○ A submit comment button
● When the user submits a comment the page should be reloaded so that their
comment appears in the list.
● There should be a list of previous reader comments which should be ordered by the
date when they were written
● There should be a back button which redirects the user to the Reader - Home Page