Skip to content

Commit

Permalink
outline mvp/lists.md for dwyl/app#271
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Apr 12, 2023
1 parent f276b07 commit ef924c7
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
- [Encrypt Personal Data](auth/09-encrypt-data.md)
- [MVP](mvp/README.md)
- [Lists][mvp/15-lists.md]
47 changes: 47 additions & 0 deletions src/mvp/15-lists.md
Original file line number Diff line number Diff line change
@@ -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). <br />
**b)** We want to use `lists` as the basis for organising and
[re-ordering `items`](https://github.com/dwyl/mvp/issues/145). <br />
**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)
15 changes: 15 additions & 0 deletions src/mvp/README.md
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit ef924c7

Please sign in to comment.