diff --git a/src/SUMMARY.md b/src/SUMMARY.md index c20d9c5..a69ed9f 100644 --- a/src/SUMMARY.md +++ b/src/SUMMARY.md @@ -12,4 +12,6 @@ - [Generate Auth Schema](auth/06-mix-gen-auth.md) - [Notes on Naming](auth/07-notes-on-naming.md) - [Modals Are An _Antipattern_](auth/08-modals-antipattern.md) - - [Encrypt Personal Data](auth/09-encrypt-data.md) \ No newline at end of file + - [Encrypt Personal Data](auth/09-encrypt-data.md) +- [MVP](mvp/README.md) + - [Lists][mvp/15-lists.md] \ No newline at end of file diff --git a/src/mvp/15-lists.md b/src/mvp/15-lists.md new file mode 100644 index 0000000..0b07459 --- /dev/null +++ b/src/mvp/15-lists.md @@ -0,0 +1,47 @@ +# Lists + +Our **MVP `App`** already has +much of the basic functionality we need/want +but it's lacking a way to organize +`items` into distinct projects/areas. +Let's fix that by introducing `lists`! + +## Quick Recap + +Until this point we've _deliberately_ kept the `MVP` +as lean as possible to avoid complexity. +The ERD is currently just: + +![erd-before-lists](https://user-images.githubusercontent.com/194400/231414683-6fce1fd8-aead-471d-8789-a4a0111f7ce8.png) + +Just the handful of tables +you've already seen in the previous sections. + +Our reasons for adding `lists` now are: +**a)** Separate `lists` for different areas of life/work is on our +[product roadmap](https://github.com/dwyl/product-roadmap).
+**b)** We want to use `lists` as the basis for organising and +[re-ordering `items`](https://github.com/dwyl/mvp/issues/145).
+**c)** `lists` will unlock other functionalty we have planned +that will make the `App` more _useful_. + + +## Create `Lists` Schema + +Create the `lists` and `list_items` database schemas +with the following +[**`mix phx.gen.schema`**](https://hexdocs.pm/phoenix/Mix.Tasks.Phx.Gen.Schema.html) +commands: + +```sh +mix phx.gen.schema List lists person_id:integer status:integer text:string person_id:integer +mix phx.gen.schema ListItems list_items item_id:references:items list_id:references:lists position:integer person_id:integer +``` + + +At the end of this step, +we have the following database +[Entity Relationship Diagram](https://en.wikipedia.org/wiki/Entity%E2%80%93relationship_model) +(ERD): + +![mvp-erd-list_items](here) diff --git a/src/mvp/README.md b/src/mvp/README.md new file mode 100644 index 0000000..5a4cc61 --- /dev/null +++ b/src/mvp/README.md @@ -0,0 +1,15 @@ +# Minimum Viable Product (MVP) + +_All_ Apps start with an MVP. +In our case we created a _separate_ repository: +[github.com/dwyl/**mvp**](https://github.com/dwyl/mvp) +so that the most _basic_ version of our `App` +could be used as a reference by other people building MVPs. + +# TODO: + +Lift the contents of +[github.com/dwyl/mvp/BUILDIT.md](https://github.com/dwyl/mvp/blob/7c0a29cfe71582a9aada531af339afdd2734b809/BUILDIT.md?plain=1) +and split it into separate files here in `book`. +See: +[dwyl/mvp/**issues/350**](https://github.com/dwyl/mvp/issues/350) \ No newline at end of file