Open nelsonic opened 5 years ago
@nelsonic I really like this idea and would love to help out with this 😄
If it's not immediately clear why this ER diagram fits the Reading Tracker app, don't worry, it will make sense soon enough. Trying to create a general purpose App that will be useful for the specific use case.
that feeling when you realise that you're working too hard?
There's a library of schemas that we're ignoring ...
https://schema.org/docs/full.html
Going to see how much of Schema.org I can use and link to.
Can I just say this is the best compendium of gifs I've seen in a while 😆
@iteles indeed. 😉
Aparently we can use both RDFa and Microdata in the same doc: https://stackoverflow.com/questions/8957902/microdata-vs-rdfa it's not pretty, but if our objective was to maximise parse-ability (SEO) then it could make sense.
Further reading:
human
- the human being using the App (AKA the "user") or referred to in the App (e.g: "author")
id
: Int
1inserted_at
: Timestamp
updated_at
: Timestamp
username
: Binary
(encrypted; personal data is never stored in plaintext)username_hash
: Binary
(salted & hashed for fast lookup during registration/login)firstname
: Binary
(encrypted)lastname
: Binary
(encrypted)email
: Binary
(encrypted)email_hash
: Binary
(salted & hashed for quick lookup)password_hash
: Binary
(encrypted)key_id
: String
- the ID of the encryption key used to encrypt personal data (NOT the key itself!)status
: Int
(FK status.id
) - e.g: "0: unverified, 1: verified", etc.kind
4: Int
(FK kind.id
) - e.g: "reader" or "author"
for our "Reading Tracker"person
- the person using the App
(AKA the "user")
or referred to in the reading tracker App (e.g: "author")
id
: Int
1inserted_at
: Timestamp
updated_at
: Timestamp
username
: Binary
(encrypted; personal data is never stored in plaintext)username_hash
: Binary
(salted & hashed for fast lookup during registration/login)givenName
: Binary
(encrypted) - first name of the personfamilyName
: Binary
(encrypted) - last or surname of the personemail
: Binary
(encrypted) - so we can contact the person by email duh.email_hash
: Binary
(salted & hashed for quick lookup)password_hash
: Binary
(encrypted)key_id
: String
- the ID of the encryption key used to encrypt personal data (NOT the key itself!) see: github.com/dwyl/phoenix-ecto-encryption-examplestatus
: Int
(FK status.id
) - e.g: "0: unverified, 1: verified", etc.kind
4: Int
(FK kind.id
) - e.g: "reader" or "author"
for our "Reading Tracker"all that has changed is that we have reverted to person
as the record type and using givenName
and familyName
(neither of which I am a particular fan of) for fields to match the Schema.org/Person
By changing the data type name to Person
we return to our original naming; that's a positive. 👍
But it means we need to update all instances of human_id:references:humans
to person_id:references:people
📝
Given that it's more hassle to manually change each instance of human_id
to person_id
and update file/module names, tests, etc. I'm thinking of just nuking the /lib
, /priv
and /test
directories and starting fresh. 🤔
Wipe the old app from the repo:
git rm lib priv test mix.exs mix.lock -r
Update Phoenix to 1.4.10
https://hexdocs.pm/phoenix/installation.html#phoenix
mix archive.install hex phx_new 1.4.10
Create new app from scratch:
mix phx.new app
Follow the create schema steps in: https://github.com/nelsonic/time-mvp-phoenix#create-schemas
Fetch and install dependencies? [Yn] y
We are almost there! The following steps are missing:
$ cd app
Then configure your database in config/dev.exs and run:
$ mix ecto.create
Start your Phoenix app with:
$ mix phx.server
You can also run your app inside IEx (Interactive Elixir) as:
$ iex -S mix phx.server
mix ecto.drop
mix ecto.create
mix ecto.migrate
This feature will be built as soon as the todo list feature is working ... see: time-mvp-phoenix/issues/3
A basic schema for storing book data based on see: time-mvp-phoenix/issues/11
author
(a person
with kind="author"
)datePublished
description
headline
(subtitle)image
(url)isbn
keywords
(csv)name
(name of the book e.g: "Deep Work")numberOfPages
publisher
thumbnailUrl
(tiny image used in mobile app)I know it's been a long time since I've looked at this ... ⏳ But recently finished putting together the Library Shelves https://github.com/dwyl/home/issues/179#issuecomment-1046326147 📚 🙌 So going to re-visit building a basic reading tracker app after https://github.com/dwyl/sleep/issues/53 🛌
Need to Transpose my notebook notes into issues/checklist.