From 8a8e03190e99662cb9c2a9b61ef01b3ea03cf101 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sun, 24 Sep 2023 05:18:39 +0100 Subject: [PATCH] update attendee schema to binary so we can encrypt all the fields --- src/fields/01-setup.md | 11 +++++++---- src/fields/02-schema.md | 4 ++-- src/fields/README.md | 28 ++++++++++++++++++++++------ 3 files changed, 31 insertions(+), 12 deletions(-) diff --git a/src/fields/01-setup.md b/src/fields/01-setup.md index 374a31a..043d2d4 100644 --- a/src/fields/01-setup.md +++ b/src/fields/01-setup.md @@ -19,9 +19,12 @@ Create a New Phoenix App: mix phx.new fields_demo --no-mailer --no-dashboard --no-gettext ``` -> **Note**: We don't need to send email, -> have a fancy dashboard or translation in this `demo`. -> All these _advanced_ features are covered later. +> **Note**: The "flags" (e.g: `--no-mailer`) +> after the `fields_demo` app name +> are there to avoid adding bloat to our app. +> We don't need to send `email`, +> have a fancy `dashboard` or `translation` in this `demo`. +> All these _advanced_ features are all covered in depth later. ## 2. Setup Coverage @@ -158,4 +161,4 @@ you should see something similar to the following: image That completes 2 minutes of "setup". -Let's add a schema! \ No newline at end of file +Let's add a `schema` to store the data! \ No newline at end of file diff --git a/src/fields/02-schema.md b/src/fields/02-schema.md index 2484e79..31b524f 100644 --- a/src/fields/02-schema.md +++ b/src/fields/02-schema.md @@ -1,6 +1,6 @@ # Create `attendee` schema -The goal is to allow `people` attending **_Awesome_ Conf** +The goal is to allow `people` attending **_Awesome_ Conf** - the ***`attendees`*** - to submit the following data: + `first_name` - how we greet you. Will appear on your conference pass. @@ -24,7 +24,7 @@ Using the command, run: ```sh -mix phx.gen.live Accounts Attendee attendees first_name:string last_name:string email:string phone_number:string address_line_1:string address_line_2 postcode:string gender:string diet_pref:string website:string desc:string feedback:string +mix phx.gen.live Accounts Attendee attendees first_name:binary last_name:binary email:binary phone_number:binary address_line_1:binary address_line_2:binary postcode:binary gender:binary diet_pref:binary website:binary desc:binary feedback:binary ``` You should expect to see output similar to the following: diff --git a/src/fields/README.md b/src/fields/README.md index 82414e3..0af8475 100644 --- a/src/fields/README.md +++ b/src/fields/README.md @@ -2,16 +2,18 @@ # `Fields` Guide -A **complete beginner's guide** -to building a **`Phoenix` Web App** +This chapter is a **complete beginner's guide** +to building a fully-functional **Web Application**
+in **`Phoenix`** using **`fields`** to **_appropriately_ store personal data**. -![awesome-header-image](https://github.com/dwyl/fields-demo/assets/194400/a87a35ab-409d-4204-8b9f-8d4725b505f0) + ## Why? @@ -25,14 +27,28 @@ Most beginner's guides gloss over the steps we are about to take together. If you care about your _own_ privacy - and you should! - -don't skip this chapter. +follow along +and see how _easy_ it is to do the _right_ thing. + +### Why Build This Demo App _First_? + +Simple: to showcase how straightforward it is +to transparently validate, encrypt and decrypt +sensitive personal data +in an ultra-basic but fully-functional web app. + +We will then _use_ these techniques +to build something more advanced. ## What? -The `fields-demo` App +The **`fields-demo`** App showcases a **registration form** for a (fictitious) conference called "**_Awesome_ Conf**". -It shows you all the steps necessary + +![awesome-header-image](https://github.com/dwyl/fields-demo/assets/194400/a87a35ab-409d-4204-8b9f-8d4725b505f0) + +It covers all the steps necessary to build the form using the `fields` package to securely store personal data.