Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Create (GitHub) profile schema to store public profile data #85

Open
7 tasks done
nelsonic opened this issue Jun 19, 2023 · 6 comments
Open
7 tasks done

Feat: Create (GitHub) profile schema to store public profile data #85

nelsonic opened this issue Jun 19, 2023 · 6 comments
Assignees
Labels
chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue elixir Pull requests that update Elixir code enhancement New feature or enhancement of existing functionality priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1h Time Estimate 1 Hour

Comments

@nelsonic
Copy link
Member

nelsonic commented Jun 19, 2023

In order to enable all other features of this mini-app, we need to comprehensively capture profile data.

Todo

  • Map all the fields from the GitHub "User" object into a profile schema in this repo.
    • Use String for all values except:
      • "public_repos": 2, "public_gists": 1, "followers": 20, "following": 0, "id": 1 appear to be Int and
      • "hireable": false, "site_admin": false look like boolean
      • use appropriate date/time for "created_at": "2008-01-14T04:33:35Z", "updated_at": "2008-01-14T04:33:35Z" so that we can query this data.
    • Create sample data to test CRUD.

https://docs.github.com/en/rest/users/users?apiVersion=2022-11-28#get-a-user

{
  "login": "octocat",
  "id": 1,
  "node_id": "MDQ6VXNlcjE=",
  "avatar_url": "https://github.com/images/error/octocat_happy.gif",
  "gravatar_id": "",
  "url": "https://api.github.com/users/octocat",
  "html_url": "https://github.com/octocat",
  "followers_url": "https://api.github.com/users/octocat/followers",
  "following_url": "https://api.github.com/users/octocat/following{/other_user}",
  "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
  "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
  "subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
  "organizations_url": "https://api.github.com/users/octocat/orgs",
  "repos_url": "https://api.github.com/users/octocat/repos",
  "events_url": "https://api.github.com/users/octocat/events{/privacy}",
  "received_events_url": "https://api.github.com/users/octocat/received_events",
  "type": "User",
  "site_admin": false,
  "name": "monalisa octocat",
  "company": "GitHub",
  "blog": "https://github.com/blog",
  "location": "San Francisco",
  "email": "[email protected]",
  "hireable": false,
  "bio": "There once was...",
  "twitter_username": "monatheoctocat",
  "public_repos": 2,
  "public_gists": 1,
  "followers": 20,
  "following": 0,
  "created_at": "2008-01-14T04:33:35Z",
  "updated_at": "2008-01-14T04:33:35Z"
}
@nelsonic nelsonic added enhancement New feature or enhancement of existing functionality elixir Pull requests that update Elixir code discuss Share your constructive thoughts on how to make progress with this issue priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished chore a tedious but necessary task often paying technical debt T1h Time Estimate 1 Hour labels Jun 19, 2023
@nelsonic
Copy link
Member Author

@SimonLab as discussed on our call, if you have some time to do this it would be very helpful.
Ultimately our goal with tracking the people who are starring/watching/contributing to our projects is:

  1. Giving people credit for contributing by putting their names & avatar on the @dwyl website 👤
  2. Showing how many distinct people have starred our repos (vanity metric but good social proof)
  3. Showing how many people from well-known companies are using our code, again very good social proof.

The reason this 3rd one is relevant to you in your current "Job Search" is that you can put it on your profile SimonLab/SimonLab#1 to add some "proof" (help you stand out from the crowd) in a job application.

If you can write: "Code I've written is used by many companies you have heard of"
and provide a list with 100+ well-recognised logos, it's a lot more interesting to the recruiter/hiring manager
than just writing "I've written some code for a few projects ..."
It's more concrete and relatable.
You'll soon see from doing this that @dwyl code is used by most of the Fortune 500.
That sets you apart from 99% of devs.

@nelsonic
Copy link
Member Author

nelsonic commented Jan 6, 2025

Trying to send the profiles of the people (GitHub "users") to the Client as they are requested from the API.
So far Have tried using broadcast_from/4 but that doesn't work for whatever reason ...
So read: https://elixirforum.com/t/emulating-send-and-handle-info-with-live-components/44249

image

Now reading https://hexdocs.pm/phoenix_live_view/Phoenix.LiveView.html#send_update/3 👀

@nelsonic
Copy link
Member Author

nelsonic commented Jan 6, 2025

Not quite what I wanted ... 💭
I just want a way of sending data to the Client as it comes in ...

@nelsonic
Copy link
Member Author

nelsonic commented Jan 6, 2025

@nelsonic
Copy link
Member Author

nelsonic commented Jan 6, 2025

Figured out what was not working!!
Was using Endpoint.broadcast_from/4 instead of Endpoint.broadcast/3
which only sends the updates to the other clients, not the one that is in-focus.
i.e. having multiple browsers open helped me understand this was working just not in the browser I was focussed on!

@nelsonic
Copy link
Member Author

nelsonic commented Jan 7, 2025

Have this working on my branch: #207 :shipit:
It seems simple (and it is, really!) but I want to stream the API responses to the client as they come in. ⏳
Definitely over-complicating it, but the experience will be good. 👌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore a tedious but necessary task often paying technical debt discuss Share your constructive thoughts on how to make progress with this issue elixir Pull requests that update Elixir code enhancement New feature or enhancement of existing functionality priority-2 Second highest priority, should be worked on as soon as the Priority-1 issues are finished T1h Time Estimate 1 Hour
Projects
Status: No status
Development

No branches or pull requests

2 participants