Michael Frederick
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    ###### tags: `New Relic` # Opensource Website <!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> **Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* - [Opensource Website](#opensource-website) - [Data Definitions](#data-definitions) - [Project](#project) - [Data fetching](#data-fetching) - [Gatsby GraphQL](#gatsby-graphql) - [Github API v3](#github-api-v3) - [Github API v4](#github-api-v4) - [Component Mocks](#component-mocks) - [Landing page - V4](#landing-page---v4) - [Top 3 projects](#top-3-projects) - [Explore Projects](#explore-projects) - [Explore Projects - V4](#explore-projects---v4) - [Project Page - V2](#project-page---v2) - [Blog Listing](#blog-listing) - [Blog Article - V4](#blog-article---v4) <!-- END doctoc generated TOC please keep comment here to allow auto update --> ## Data Definitions ### Project We're designating a `Project` as an Open Source "Project". In Github this is more-so a`Repository` than a Github `Project`. ```json { "name": "nr1-workload-geoops", "fullName": "newrelic/nr1-workload-geoops", "slug": "newrelic-nr1-workload-geoops", "owner": { "login": "newrelic", "type": "Organization" }, "title": "New Relic One Workload Geoops", "supportUrl": "https://discuss.newrelic.com/t/workload-geoops-nerdpack/99478", "githubUrl": "https://github.com/newrelic/nr1-workload-geoops", "permalink": "https://opensource.newrelic.com/projects/newrelic/nr1-workload-geoops", "iconUrl": "https://github.com/newrelic/nr1-workload-geoops/blob/master/icon.png?raw=true", "shortDescription": "Manage workloads across geographies", "description": "New Relic One application for aligning Workload data (or other Entities) in a geographic management console. Think Point-of-Sale alignment of platform features.", "ossCategory": "new-relic-one-catalog-project", "primaryLanguage": "JavaScript", "projectTags": [ "nr1-app" ], "acceptsContributions": true, "website": { "title": "New Relic One Workload Geoops", "url": "https://github.com/newrelic/nr1-workload-geoops" }, "version": "0.1.0" } ``` Notes: `iconUrl` - we'll need to ensure we use something in Gatsby to rewrite the URL's from *.github.com to *.cdn.com, where CDN is wherever this ends up being hosted, whether that's a rewritten S3 url or a CDN. ### External Project Project metadata when the project is external (for instance: New Relic's involvement in the `OpenTelemetry` standard). ```json { "name": "open-telemetry", "fullName": "open-telemetry", "title": "OpenTelemetry", "slug": "open-telemetry", "owner": { "login": "open-telemetry", "type": "Organization" }, "excludeFromExploreProjects": true, "githubUrl": "https://github.com/open-telemetry", "permalink": "https://opensource.newrelic.com/open-telemetry", "iconUrl": "/images/open-telemetry.png", "shortDescription": "New Relic's involvement in OpenTelemetry short description", "description": "Bacon ipsum dolor amet chicken brisket shankle, flank filet mignon pork belly ribeye chuck ham venison pig. Spare ribs bresaola jowl chislic chuck. Pig hamburger cow ham hock buffalo picanha. Landjaeger venison pork, burgdoggen leberkas shank fatback shankle rump ham hock tenderloin pork loin. Chuck tongue buffalo landjaeger boudin sirloin. Short loin swine kevin, tail sausage tri-tip doner. Tail capicola jerky andouille turducken tri-tip bresaola boudin doner cow.", "projectTags": ["opentelemetry"], "contributors": [{ "name": "Octocat", "login": "octocat", "contributorType": "approver", "id": 1, "avatarUrl": "https://github.com/images/error/octocat_happy.gif", "url": "https://api.github.com/users/octocat", "htmlUrl": "https://github.com/octocat" },{ "name": "Octocat", "login": "octocat", "contributorType": "maintainer", "id": 1, "avatarUrl": "https://github.com/images/error/octocat_happy.gif", "url": "https://api.github.com/users/octocat", "htmlUrl": "https://github.com/octocat" }], "subProjects": ["open-telemetry-go", "open-telemetry-java"] } ``` `ossCategory` - one of a defined enum of values w/in New Relic OSS, [defined here](https://github.com/newrelic/open-source-office/blob/master/examples/categories/index.md) ```json "items": [ { "title": "New Relic Experimental", "slug": "newrelic-experimental", "description": "This code is not necessarily used in production but is being developed in the open. It is provided with no expectation of support, ongoing development, or maintenance." }, { "title": "Community Project", "slug": "community-project", "description": "This is an official New Relic open source community project, supported by a maintainer(s) within New Relic." }, { "title": "New Relic One Catalog Project", "slug": "new-relic-one-catalog-project", "description": "This code is a part of the New Relic One Catalog. It is available for installation and configuration via the New Relic One homepage. You can install it via the Catalog launcher in New Relic One." }, { "title": "Example Code", "slug": "example-code", "description": "This code is not meant for production deployment, but is provided as a working example of a concept. It comes with no ongoing support or maintenance, but you are welcome to submit issues and PR's to the repo." }, { "title": "Product delivered in Open Source", "slug": "product-delivered-in-open-source", "description": "This code is currently maintained by New Relic engineering teams and delivered here in Github. See the README for troubleshooting and defect reporting instructions." }, { "title": "Archived", "slug": "archived", "description": "This code has been moved into a read-only state. It is no longer supported and is available for cloning only." } ] ``` `projectType` = one of a defined enum of values w/in New Relic OSS ```json "items": [ { "title": "New Relic One App", "slug": "nr1-app" }, { "title": "Infrastructure Integration", "slug": "infrastructure-integration" }, { "title": "APM Agent", "slug": "apm-agent" }, { "title": "Utility", "slug": "utility" }, { "title": "Training", "slug": "training" } ] ``` `primaryLanguage` - maps to the value for a repository as returned by the [GitHub API](https://raw.githubusercontent.com/github/linguist/master/lib/linguist/languages.yml) ### Stats ```json { "version": "1.0.4", "issues": { "open": 14 }, "releases": 6, "commits": 245, "contributors": 6, "pullRequests": { "open": 2 }, "searchCategory": "good-first-issue", "cachedIssues": [{ "title": "Allow backoff times to be user content", "id":"26", "url": "https://github.com/newrelic/nr1-workload-geoops/issues/26", "createdBy": "breed-nr", "createdAt": 1586797934554, "comments": { "count": 2 } },{ "title": "Stuff here", "id":"45", "url": "https://github.com/newrelic/nr1-workload-geoops/issues/45", "createdBy": "tangollama", "createdAt": 1586797934559, "comments": { "count": 0 } }], "cachedContributors": [{ "name": "Octocat", "login": "octocat", "id": 1, "avatarUrl": "https://github.com/images/error/octocat_happy.gif", "url": "https://api.github.com/users/octocat", "htmlUrl": "https://github.com/octocat", "contributions": 32 }, { "name": "Joel Worrall", "login": "tangollama", "id": 154545, "avatarUrl": "https://github.com/images/error/octocat_happy.gif", "url": "https://api.github.com/users/tangollama", "htmlUrl": "https://github.com/tangollama", "contributions": 323 }] } ``` Notes: `issues` and `pullRequests` are objects to support future expansion of the tracking by status. `searchCategory` is the name of issue category we're searching for when we refresh the `cachedIssues` array. `cachedIssues` is an array of issue data that we need to generate a view into the issue list. `cachedContributors` is the list of top contributors for this project. The fields map in camel case to the current GitHub v3 API fields. ### Article A blog article > [name="Freddy"] Loosely stubbed here, dependent on Ghost + DevEx Team decisions around CMS ```json { "id": 1, "title": "foo title", "permalink": "https://opensource.newrelic.com/blog/brilliant-article-on-foo" } ``` ## Data fetching ### Gatsby GraphQL Build a schema out of our `projects/<foo-project>.json` files [Gatsby Data Fetching](https://www.gatsbyjs.org/docs/data-fetching/) [Hybrid Apps & Hydration](https://www.gatsbyjs.org/docs/adding-app-and-website-functionality/#hybrid-app-pages) ### Github API v3 - Accepts authenticated API requests - Accepts unauthenticated API requests #### Discussion: > [name="Freddy"] If we try to do client-side refreshes of stats, for unauthenticated API requests - are we going to hit a CORS issue? i.e. Can our website make API calls to Github on behalf of a user (IP address)? We won't run into this when we make these calls as part of our build process. https://developer.github.com/v3/#cross-origin-resource-sharing ### Github API v4 [Link to Github GraphQL Explorer](https://developer.github.com/v4/explorer/) > [name="Freddy"] For the uninitiated, when looking at Github's schema explorer, `edges` define relationships to other objects, and `nodes` define objects. Notes: - Accepts authenticated API requests only - Should be utilized as part of our build process to fetch data on relevant projects. **Examples** Repository Stats: ```graphql query RepositoryStats ($organizationId: ID) { foo } ``` ## Component Mocks ### Landing page - V4 #### Top 3 projects Gatsby GraphQL request to projects for top 3 marked with a tag of `HomePageHighlight` or `homepage-highlight` ```jsx <List> {projects.map(project => { return ( <Item> <Icon url={iconUrl}/> <p>{description}</p> <button onClick={() => this.navigateTo(githubUrl)}> <Footer> <LinkItem>View in Github</LinkItem> <LinkItem onClick={() => this.navigate(project.website.url)}> Go to {project.website.title} </LinkItem> </Footer> </Item> ); })} </List> ``` #### Explore Projects ```jsx <List> {projects.map(project => { return ( <Item> <Card> <Icon></Icon> <Title>{project.title}</Title> <span>{project.shortDescription}</span> </Card> </Item> ); })} </List> ``` #### Recent articles ```jsx <List> {articles.map(article => { const truncatedDescription = article.description; return ( <Card> <HeaderImage></HeaderImage> <h1>{article.title}</h1> <p>{truncatedDescription}</p> <Link to={article.permalink}>Read more</Link> </Card> ); })} </List> ``` ### Explore Projects - V4 ```jsx <Container> <Header> <NavBar></NavBar> </Header> <Body> <BodyHeader> <h1>Explore our projects</h1> <h5>Projects and products that we're developing in open source</h5> </BodyHeader> <Search> <SearchInput></SearchInput> <Filters> <CategoryFilter></CategoryFilter> <ProjectFilter></ProjectFilter> <SortBy></SortBy> </Filters> </Search> <TopProjectsList></TopProjectsList> <Projects> {highlightedProjects.map(project => { return ( <ProjectLargeCard> <Icon>{project.iconUrl}</Icon> <h3>{project.title}</h3> <p>{project.description}</p> <Button to={project.permalink}>View Project</Button> <CardFooter> <col>{project.ossCategory.title}</col> <col>Version {project.version}</col> </CardFooter> </ProjectLargeCard> ) })} {projects.map(project => { return ( <ProjectCard> <Icon>{project.iconUrl}</Icon> <h4>{project.title}</h4> <p>{project.description}</p> <CardFooter> <col>{project.ossCategory.title}</col> <col>Version {project.version}</col> </CardFooter> </ProjectCard> ); })} </Projects> </Body> </Container> ``` #### Discussion > [name="Freddy"] When a user searches for or filters projects, what happens to the enlarged top 3 cards? Will we need to intelligently pick a "top 3" from the results, or is this just the first 3 of the result set? ### Project Page - V2 ### Blog Listing ### Blog Article - V4

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully