GithubHelp home page GithubHelp logo

filipefranc0 / github-automated-repos Goto Github PK

View Code? Open in Web Editor NEW

This project forked from digoarthur/github-automated-repos

0.0 0.0 0.0 1.69 MB

The library that automates, in one place, the administration of your github projects on your website.

Home Page: https://github-automated-repos.vercel.app

License: MIT License

Shell 0.82% JavaScript 62.65% TypeScript 18.20% CSS 1.52% HTML 2.84% SCSS 13.96%

github-automated-repos's Introduction

Github-automated-repos

angular-logo
Github-automated-repos is the lib that gives you the power to manage the view of your projects
on your website in one place!

https://github-automated-repos.vercel.app

Contributing Guidelines

NPM Paackage CodeFactor GitHub Husky Eslint Prettier Husky

ReactJS Check ViteJS Check NextJS Check


skills About Library

This library automates the view your GitHub projects on your website in one place. But how? Make the code configuration only once in your application with github-automated-repos, and manage the view of your projects on GitHub in the Topics field. Choose which project will be seen on your website, and you can even customize your project card, for example, with a representative icon and show which stacks were used. All in one place!

Control your projects
image
Customize and represent through icons.
image
In one place
image

skills Library

Install

    npm install github-automated-repos
    yarn add github-automated-repos

Import

    import { useGithubAutomatedRepos, ProjectIcon, StackIcon } from 'github-automated-repos/index';

The package imports four elements:

  • ProjectIcon component that renders the icons of the projects that come from data returned from the dataGithubRepos function as the Topics property. Check the Project Icons tab!

  • StackIcon component that renders the icons of the stacks that come from data returned from the dataGithubRepos function as the Topics property. Check the Stack Icons tab!

  • IGithubRepos interface for the application in Typescript. Used to type the useState that will receive the array.

  • useGithubAutomatedRepos hook responsible for automating the repositories. It returns a function called dataGithubRepos, which takes two parameters: data (data that comes from the GitHub API) and the keyword (the latter responsible for showing the project on your website from the moment it is declared in the Topics field of the your Github repository). The dataGithubRepos returns, so optimized, an array of objects containing 6 properties: id, html_url, homepage, topics, name and description.

 const { dataReposGithub } = useGithubAutomatedRepos()

Fill in the fields in the github repository

  • id: repository identification number. used as parameter in the key tag. This field does not need to be filled in.
  • html_url: repository link. Used as the link of access. This field does not need to be filled in.
  • homepage: it's the access link to the built page, page deploy. About / Website of your GitHub.

image

  • topics: array that brings information about the icons in Project Icons and Stack Icons. Used in both ProjectIcon and StackIcon components. It is in this field that is passed the key configured in the hook. Refers to the field About / Topics of your GitHub.

image

name: This is the name of the repository. Refers to the field Settings / General / Repository name of your GitHub.

image

description: This is the description given to your repository. Refers to the About /Description field of your GitHub.

image

Code Example

❗❗ Don't forget to fill in the keyword fields (determined by you) and enter your github username.

 fetch('https://api.github.com/users/usernameGitHub/repos?sort=created&per_page=999')
 then(data => setRepository(dataReposGithub(data, 'keyword')))

Javascript

  import './App.css';
  import { useEffect, useState } from 'react';
  import { useGithubAutomatedRepos, ProjectIcon, StackIcon } from 'github-automated-repos/index';
  function App() {
                              {/*useGithubAutomatedRepos hook*/ }
    const { dataReposGithub } = useGithubAutomatedRepos()
    const [repository, setRepository] = useState([])

    useEffect(() => {
                                  {/*Put here your github Name*/ }
      fetch('https://api.github.com/users/usernameGitHub/repos?sort=created&per_page=999')
      .then(response => response.json())
      .then(data => setRepository(dataReposGithub(data, 'deploy'))); {/*<-- keyWord*/}
  }, [])

    return (
      <div className="App">
        {
          repository.map((item) => {
            return (
              <div key={item.id}>

                {/*Project Icon*/}
                {item.topics.map((icon) => {
                  return (
                    <ProjectIcon key={icon} className="project_Icon" iconItem={icon} />
                  )
                })}
                {/*html Url*/}
                <a href={item.html_url}>
                    {/*Name Project*/}
                    <h1>{item.name}</h1>
                </a>
                {/*Description*/}
                <p>{item.description}</p>

                {/*Homepage*/}
                <a href={item.homepage}>
                    <h3>Homepage</h3>
                </a>
                {/*Stacks Icon*/}
                {item.topics.map((icon) => {
                  return (
                    <StackIcon key={icon} className="stack_Icon" iconItem={icon} />
                  )
                })}

              </div>

            )
          })
        }
      </div>
    );

  }
  export default App;

Javascript

  import './App.css';
  import { useEffect, useState } from 'react';
  import { useGithubAutomatedRepos, ProjectIcon, StackIcon } from 'github-automated-repos/index';
  function App() {
                              {/*useGithubAutomatedRepos hook*/ }
    const { dataReposGithub } = useGithubAutomatedRepos()
    const [repository, setRepository] = useState<IGithubRepos[]>([])

    useEffect(() => {
                                  {/*Put here your github Name*/ }
      fetch('https://api.github.com/users/usernameGitHub/repos?sort=created&per_page=999')
      .then(response => response.json())
      .then(data => setRepository(dataReposGithub(data, 'deploy'))); {/*<-- keyWord*/}
  }, [])

    return (
      <div className="App">
        {
          repository.map((item) => {
            return (
              <div key={item.id}>

                {/*Project Icon*/}
                {item.topics.map((icon) => {
                  return (
                    <ProjectIcon key={icon} className="project_Icon" iconItem={icon} />
                  )
                })}

                {/*html Url*/}
                <a href={item.html_url}>
                    {/*Name Project*/}
                    <h1>{item.name}</h1>
                </a>

                {/*Description*/}
                <p>{item.description}</p>
    
                {/*Homepage*/}
                <a href={item.homepage}>
                    <h3>Homepage</h3>
                </a>

                {/*Stacks Icon*/}
                {item.topics.map((icon) => {
                  return (
                    <StackIcon key={icon} className="stack_Icon" iconItem={icon} />
                  )
                })}

              </div>

            )
          })
        }
      </div>
    );

  }
  export default App;

Framework Settings.

NextJS
└── My-app
    ├── ...
    ├── next.config.js
    ├── ...
/** @type {import('next').NextConfig} */
const nextConfig = {
  reactStrictMode: true,
  transpilePackages: ['github-automated-repos'],
}

module.exports = nextConfig

Love github-automated-repos? Give our repo a star ⭐ ⬆️.

based in: Api Github

by: @digoarthur

github-automated-repos's People

Contributors

digoarthur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.