From 3271f9c82cf671d9b1378942eca3dc8d0effc2a2 Mon Sep 17 00:00:00 2001 From: nelsonic Date: Sat, 8 Jun 2024 11:51:28 +0100 Subject: [PATCH] add orgs, stars & follows schema links #13 --- BUILDIT.md | 13 +++++++++---- lib/app_web/templates/layout/root.html.heex | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/BUILDIT.md b/BUILDIT.md index 9652ef2..598eb68 100644 --- a/BUILDIT.md +++ b/BUILDIT.md @@ -425,13 +425,16 @@ COV FILE LINES RELEVANT MISSED # 2. Create Schemas to Store Data -This app stores data in two schemas: +This app stores data in **five** schemas: -1. `users` - https://docs.github.com/en/rest/users/users -2. `repos` - https://docs.github.com/en/rest/repos/repos +1. `users` - https://docs.github.com/en/rest/users/users - the GitHub [**`users`**](https://dwyl.github.io/book/auth/07-notes-on-naming.html). +2. `orgs` - https://docs.github.com/en/rest/orgs/orgs - organizations which can have `users` as members and `repositories`. +3. `repositories` - https://docs.github.com/en/rest/repos/repos - the repositories of code on GitHub. +4. `stars` - [https://docs.github.com/en/rest/activity/starring](https://docs.github.com/en/rest/activity/starring?apiVersion=2022-11-28#list-stargazers) - the `stars` (on `repositories`) associated with each `user`. +5. `follows` - https://docs.github.com/en/rest/users/followers - List the `people` a `user` follows For each of these schemas we are storing -a subset of the data; only what we need right now. +a _subset_ of the data; only what we need right now. We can always add more later as needed. @@ -443,7 +446,9 @@ commands: ```sh mix phx.gen.schema User users login:string avatar_url:string name:string company:string bio:string blog:string location:string email:string created_at:string two_factor_authentication:boolean followers:integer following:integer + mix phx.gen.schema Repository repositories name:string full_name:string owner_id:integer description:string fork:boolean forks_count:integer watchers_count:integer stargazers_count:integer topics:string open_issues_count:integer created_at:string pushed_at:string + ``` At the end of this step, diff --git a/lib/app_web/templates/layout/root.html.heex b/lib/app_web/templates/layout/root.html.heex index 46a685b..7038850 100644 --- a/lib/app_web/templates/layout/root.html.heex +++ b/lib/app_web/templates/layout/root.html.heex @@ -5,8 +5,8 @@ - <.live_title suffix="- MyApp"> - <%= assigns[:page_title] || "Welcome" %> + <.live_title suffix="- Who?"> + <%= assigns[:page_title] || "Welcome!" %> <%= render("icons.html") %>