From 89d5a5e8956cf8ccc0b1d01ff21758f821092478 Mon Sep 17 00:00:00 2001 From: frikky Date: Sun, 26 Sep 2021 22:04:18 +0200 Subject: [PATCH] Added more info to the contribution docs --- .github/CONTRIBUTING.md | 11 ++++++- backend/app_sdk/build.sh | 2 +- backend/go-app/go.mod | 2 +- frontend/src/views/Docs.jsx | 60 +++++++++++++++++++++++++++++++++---- 4 files changed, 67 insertions(+), 8 deletions(-) diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index d3f66e5b..d22fd6f0 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -16,7 +16,7 @@ As with everything else, app creation for Shuffle is made as accessibl as possib Workflows are where the magic of Shuffle automation happens. Our current ones [are outlined here](https://github.com/frikky/security-openapis), and will be automatically imported into Shuffle instances in the future. They are split into Prepare and Response, but don't necessarily have to be. If you'd like to talk about workflow creation or use-cases in general, either Open a [new issue](https://github.com/frikky/shuffle-workflows/issues/new) or send us an email at [frikky@shuffler.io](mailto:frikky@shuffler.io) #### Documentation (Markdown) -Documentation is essential to any product, and Shuffle is no exception. Documentation in Shuffle uses markdown and is located in the [shuffle-docs](https://github.com/frikky/shuffle-docs/tree/master/docs) repository. These are then loaded into Shuffle when someone visits [https://shuffler/docs/about](https://shuffler/docs/about), then cached for later use. If you make an edit, expect it on our website in about an hour. +Documentation is essential to any product, and Shuffle is no exception. Documentation in Shuffle uses markdown and is located in the [shuffle-docs](https://github.com/frikky/shuffle-docs/tree/master/docs) repository. These are then loaded into Shuffle when someone visits [https://shuffler/docs/about](https://shuffler/docs/about), then cached for later use. If you make an edit, expect it on our website in about an hour. #### Frontend (ReactJS) The frontend of Shuffle is what everyone sees when they log in. Our goal here is to make it easy to get started and keep going with Shuffle - removing any blockers from the point of accessibility. If you'd like to get started, find [an issue](https://github.com/frikky/Shuffle/issues) and check the [installation guide](https://github.com/frikky/Shuffle/blob/master/install-guide.md#local-development-installation) for setting it up locally without Docker. @@ -24,6 +24,15 @@ The frontend of Shuffle is what everyone sees when they log in. Our goal here is #### Backend (Golang) The backend of Shuffle is our REST API Server that runs in the background, handling all the API-calls in general, whether from users or apps. If you'd like to get started, find [an issue](https://github.com/frikky/Shuffle/issues) and check the [installation guide](https://github.com/frikky/Shuffle/blob/master/install-guide.md#local-development-installation) for setting it up locally without Docker. +#### Scaling (Golang & Python) +Shuffle runs using Docker, and is built to scale. There are many areas that may revolve around scaling, but the main issues come down to how we use Docker in our [architecture](https://shuffler.io/docs/architecture). If you want to help by submitting Helm charts (K8s), Docker swarm configurations, blogposts, or talk about code changes that would help scaling - please reach out (or just start building!), and we can discuss the possibilities. Make sure to read about the architecture first :) + +#### Testing +Whether it's security testing, code testing or CI/CD, we could always need another hand. E.g. an example of CI/CD used for apps can be found [here](https://github.com/Shuffle/Shuffle-apps/blob/master/.github/workflows/ci.yaml), but we don't at all limit the scope to Github actions. If you find a security issue, whether open source or not, please contact [security@shuffler.io](mailto:security@shuffler.io) or [contact us on our website](https://shuffler.io/contact). + +#### Community +What is a product without a community? Want to help out? Whether it be through blogposts, videos or community management, don't hesitate to [reach out](https://shuffler.io/contact) if you would like to help, and get a more keen understanding of how we work. (PS: We're hiring) + ## Working on an issue **Shuffle** uses the [GitHub flow](https://guides.github.com/introduction/flow/index.html). All project changes are made through pull requests. diff --git a/backend/app_sdk/build.sh b/backend/app_sdk/build.sh index a3f6d877..85b1b238 100644 --- a/backend/app_sdk/build.sh +++ b/backend/app_sdk/build.sh @@ -3,7 +3,7 @@ ### DEFAULT NAME=shuffle-app_sdk -VERSION=0.9.16 +VERSION=0.9.19 docker rmi docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION --force docker build . -f Dockerfile -t frikky/shuffle:app_sdk -t frikky/$NAME:$VERSION -t docker.pkg.github.com/frikky/shuffle/$NAME:$VERSION -t ghcr.io/frikky/$NAME:$VERSION diff --git a/backend/go-app/go.mod b/backend/go-app/go.mod index 5165e520..431adaf0 100644 --- a/backend/go-app/go.mod +++ b/backend/go-app/go.mod @@ -2,7 +2,7 @@ module shuffle go 1.13 -//replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared +replace github.com/frikky/shuffle-shared => ../../../../git/shuffle-shared //replace github.com/frikky/kin-openapi => ../../../../git/kin-openapi diff --git a/frontend/src/views/Docs.jsx b/frontend/src/views/Docs.jsx index 597019aa..3b9f466b 100644 --- a/frontend/src/views/Docs.jsx +++ b/frontend/src/views/Docs.jsx @@ -5,7 +5,8 @@ import ReactMarkdown from 'react-markdown'; import {BrowserView, MobileView} from "react-device-detect"; import {Link} from 'react-router-dom'; -import {Divider, Button, Menu, MenuItem, Typography, Paper, List} from '@material-ui/core'; +import {Tooltip, Divider, Button, Menu, MenuItem, Typography, Paper, List} from '@material-ui/core'; +import {Edit as EditIcon} from '@material-ui/icons'; const Body = { maxWidth: '1000px', @@ -32,6 +33,8 @@ const Docs = (props) => { const [list, setList] = useState([]); const [, setListLoaded] = useState(false); const [anchorEl, setAnchorEl] = React.useState(null); + const [headingSet, setHeadingSet] = React.useState(false); + const [selectedMeta, setSelectedMeta] = React.useState({link: "hello", read_time: 2, }); const [baseUrl, setBaseUrl] = React.useState(serverside === true ? "" : window.location.href) function handleClick(event) { @@ -71,7 +74,7 @@ const Docs = (props) => { if (responseJson.success) { setList(responseJson.list) } else { - setList(["error"]) + setList(["# Error loading documentation. Please contact us if this persists."]) } setListLoaded(true) }) @@ -91,6 +94,10 @@ const Docs = (props) => { if (responseJson.success) { setData(responseJson.reason) document.title = "Shuffle "+docId+" documentation" + + if (responseJson.meta !== undefined) { + setSelectedMeta(responseJson.meta) + } } else { setData("# Error\nThis page doesn't exist.") } @@ -215,11 +222,48 @@ const Docs = (props) => { } function Heading(props) { - const element = React.createElement(`h${props.level}`, {style: {marginTop: 40}}, props.children) + const element = React.createElement(`h${props.level}`, {style: {marginTop: 50}}, props.children) + + var extraInfo = "" + if (props.level === 1) { + extraInfo = +
+
+ + + + + +
+ + {selectedMeta.read_time} minute{selectedMeta.read_time === 1 ? "" : "s"} to read + +
+
+ {selectedMeta.contributors === undefined || selectedMeta.contributors === null ? "" : +
+ {selectedMeta.contributors.slice(0,7).map((data, index) => { + return ( + + + {data.url} + + + ) + })} +
+ } +
+
+ } + return ( {props.level !== 1 ? : null} {element} + {extraInfo} ) } @@ -239,7 +283,12 @@ const Docs = (props) => {
- {list.map((item, index) => { + {list.map((data, index) => { + const item = data.name + if (item === undefined) { + return null + } + const path = "/docs/"+item const newname = item.charAt(0).toUpperCase()+item.substring(1).split("_").join(" ").split("-").join(" ") return ( @@ -294,7 +343,8 @@ const Docs = (props) => { open={Boolean(anchorEl)} onClose={handleClose} > - {list.map((item, index) => { + {list.map((data, index) => { + const item = data.name const path = "/docs/"+item const newname = item.charAt(0).toUpperCase()+item.substring(1).split("_").join(" ").split("-").join(" ") return (