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

Publish metadata files to GitHub #4

Open
vemonet opened this issue Apr 16, 2021 · 0 comments
Open

Publish metadata files to GitHub #4

vemonet opened this issue Apr 16, 2021 · 0 comments
Assignees
Labels
TypeScript/React Project using TypeScript and React to build web interfaces

Comments

@vemonet
Copy link
Member

vemonet commented Apr 16, 2021

Contact: Vincent Emonet

We would like to add options to directly push RDF files to GitHub repositories.

How it will work: After the user login we get an access token, and we can use this token to query GitHub API to add and commit a file in the repository selected by the user

I think it will mainly require to:

  • add some UI components in React
  • connect with GitHub APIs

Build a component that allow the user to easily select in which repository he wants to push his file, then find out how we can add/commit/push a file from our website to the GitHub repository

  1. Check the readme to install and run it https://github.com/MaastrichtU-IDS/projects
  2. The react website is in the website folder (so everything about the react website is here) https://github.com/MaastrichtU-IDS/projects/tree/main/website
  3. Most code is in src
  4. The GitHub login button is in the NavBar https://github.com/MaastrichtU-IDS/projects/blob/main/website/src/NavBar.tsx it just send a query to our "micro-github" service which automatically handle the GitHub login then send us back an access_token
  5. The access_token is retrieved in the main page: https://github.com/MaastrichtU-IDS/projects/blob/main/website/src/ProjectsDashboard.tsx#L87

And that's it! We can now:

  • use this token to query GitHub API (e.g. request all repository of the logged user, so that we can build a components that allows him to visually choose which repo he wants to upload the file to)
  • find a proper way to save this access_token (in the state could work to start, but we will need to find better way to avoid needing to login regularly, maybe using a cookie? But a bit unsafe). And
@vemonet vemonet changed the title Publish metadata files to GitHub Publish metadata files to GitHub with TypeScript/React Apr 30, 2021
@vemonet vemonet added the TypeScript/React Project using TypeScript and React to build web interfaces label Apr 30, 2021
@vemonet vemonet removed their assignment Apr 30, 2021
@vemonet vemonet changed the title Publish metadata files to GitHub with TypeScript/React Publish metadata files to GitHub Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TypeScript/React Project using TypeScript and React to build web interfaces
Projects
None yet
Development

No branches or pull requests

2 participants