Clone the project at https://github.com/flaviocopes/node-course-project-newsletter and implement the following coding challenges.

  • Design a nicer page to be sent when another user tries to reach /admin. You can use another browser to test it, or your browser in incognito/private mode.
  • Add the option to edit the emails subject
  • Right now when a user presses “Send”, the email is sent as-is. Filter and validate the email body in the /send POST endpoint. Require at least 10 characters and remove any script tag.
  • When sending the email, there is no direct feedback. The user can click the button twice or more. Immediately mark it as disabled, and show a spinner.
  • Add an indication of how many emails were sent, and how many remain. Consider the use of web sockets for this.
  • Disallow duplicates in email submission, send a custom error message from Node to the frontend, and display an “email already registered” message to the user.
  • Handle double opt-in for forms. Send an email when a new email is entered, with a confirmation link.
  • Acknowledge and fix the problem with CSRF and JWT. Reference this blog post Where to Store JWTs - Cookies vs HTML5 Web Storage

You can do those challenges later after you completed the other projects in the course, as it might take more time than you can currently dedicate (and some might also be too advanced right now)


Go to the next module