Bootstrap

Fake news (multipage, library)

The story so far

You have a BS template with some JS to load a navbar, and footer. You know how to make input fields, and buttons. You know how to tie JS code to events. You know how to validate. You know how to use variables to coordinate what happens across events. You know how to persist data, and erase persisted data when needed.

This lesson adds a few new things:

  • An app with multiple pages.
  • Generating HTML with JavaScript.
  • Adding a library of utility functions copied from the web

Requirements

Goals

Our app will make a fake news feed.

Security

The story so far

Groovy! We have all of the CRUD. We are the CRUDiest. CRUDtastic.

One thing left: security. More specifically, we'll talk about authorization, or user permissions. This is one part of security, but an important part.

Earlier, you learned how to add Edit and Delete buttons to every record. Trouble is, that lets anyone delete your data. They go to the right URL, and keep clicking the Delete button.

Remember, normally DBs are kept on servers, so if one persons deletes data, it's gone for everyone.

Let's add some authorization.

h2.

Coffee and chocolate (validation, localStorage)

The story so far

The piggy bank app persisted data to localStorage. localStorage stores string data, with string keys.

Let's make something like the piggy bank app, but a bit more complex

Requirements

Goals

Make an app that tracks your coffee and chocolate expenses. When you buy some coffee, you enter the amount you spend, and it gets added to a coffee total. Same for chocolate.

The totals are persistent.

You can try a partial version of it.