Skip to content

Commit

Permalink
update attendee schema to binary so we can encrypt all the fields
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Sep 24, 2023
1 parent f30f35c commit 8a8e031
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
11 changes: 7 additions & 4 deletions src/fields/01-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -158,4 +161,4 @@ you should see something similar to the following:
<img width="796" alt="image" src="https://github.com/dwyl/fields/assets/194400/891e890e-c94a-402e-baee-ee47fd3725a7">

That completes 2 minutes of "setup".
Let's add a schema!
Let's add a `schema` to store the data!
4 changes: 2 additions & 2 deletions src/fields/02-schema.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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:
Expand Down
28 changes: 22 additions & 6 deletions src/fields/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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** <br />
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)

</div>

<!--
# TODO: insert screenshot of working `fields-demo` app.
-->

## Why?

Expand All @@ -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.
Expand Down

0 comments on commit 8a8e031

Please sign in to comment.