GitHub CMS 0.1 is a proof of concept to demonstrate use of GitHub as a content managment system.
It is a ASP.NET applications that uses GitHub Repository Content API to fetch content for a file, render it in an editor and allow use to save edits.
- Uses GitHub auth to log user in.
- When user's request comes to the server (in this case it is ASP.NET, could be Node app as well), it determines if user is logged in or not.
- If not, it will redirect user to github.com login page.
- Once logged in, consent form will be presented by GitHub.com to ask user for permissions this POC requires). Conceptually this is like AAD consent form.
- Ability to verify if authenticated user is a "contributor" on repository or not.
User shown Readme.md file from public repo above.
- Ability to create a commit URL that helps user verify edits by going to GitHub diff page
- Error handling: If there is an error while committing, show user the error message
- This all code is written using ASP.NET controller framework.
- Workflow where user have a choice to create a pull request or fork instead of committing directly to master. I haven’t explored API's
- Ability to log user out and/or handling token expiry
- Ability to show history of file commits
- Ability to persist user/commits info in our own store - this could be beneficial if data persisted on github.com is insufficient for our purposes. An example could be 'owner/writer' per file in a repo. This could assist in "routing pull requests" to writer. ( I am just making this requirement up at this time to make a point)
- Content discover-ability: Ability to render find content of interest via TOC, breadcrumbs or search. This POC only allows to edit "Readme.md" file in "github_cms_test_project" repo