{"id":17860218,"url":"https://github.com/garethlau/sunstang-docs","last_synced_at":"2026-01-20T05:33:07.543Z","repository":{"id":35879258,"uuid":"176798271","full_name":"garethlau/sunstang-docs","owner":"garethlau","description":"Currently deployed on Heroku at --\u003e https://sunstang-website.herokuapp.com/docs","archived":false,"fork":false,"pushed_at":"2022-12-09T16:31:41.000Z","size":10220,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-07T22:14:06.973Z","etag":null,"topics":["draft-js","gridfs-stream","multer","react","redux"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/garethlau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-20T18:54:16.000Z","updated_at":"2019-07-08T15:21:55.000Z","dependencies_parsed_at":"2023-01-16T08:30:30.300Z","dependency_job_id":null,"html_url":"https://github.com/garethlau/sunstang-docs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/garethlau/sunstang-docs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethlau%2Fsunstang-docs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethlau%2Fsunstang-docs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethlau%2Fsunstang-docs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethlau%2Fsunstang-docs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/garethlau","download_url":"https://codeload.github.com/garethlau/sunstang-docs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/garethlau%2Fsunstang-docs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28596438,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T02:08:49.799Z","status":"ssl_error","status_checked_at":"2026-01-20T02:08:44.148Z","response_time":117,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["draft-js","gridfs-stream","multer","react","redux"],"created_at":"2024-10-28T07:42:07.092Z","updated_at":"2026-01-20T05:33:07.529Z","avatar_url":"https://github.com/garethlau.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sunstang Docs\nOnline rich text editing and document managing solution built for Sunstang. Built with the MERN stack.\n\n# Dependencies\n- [create-react-app](https://github.com/facebook/create-react-app \"https://github.com/facebook/create-react-app\")\n- [redux](https://redux.js.org/ \"https://redux.js.org/\")\n- [react-beautiful-dnd](https://www.npmjs.com/package/react-beautiful-dnd \"https://www.npmjs.com/package/react-beautiful-dnd\")\n- [draft-js](https://draftjs.org/ \"https://draftjs.org/\") (and many plugins for draft-js)\n- [gridfs-stream](https://www.npmjs.com/package/gridfs-stream \"https://www.npmjs.com/package/gridfs-stream\")\n- [multer](https://www.npmjs.com/package/multer \" https://www.npmjs.com/package/multer\") and [multer-gridfs-storage](https://www.npmjs.com/package/multer-gridfs-storage \"https://www.npmjs.com/package/multer-gridfs-storage\")\n\n# Contributing to the Project\nThere's a lot of stuff that can be worked on. Feel free to pull this project and add to it!\n\n## Pulling the Project\nIn command terminal:\n```\n$ git clone https://github.com/garethlau/sunstang-website.git\n$ cd sunstang-website/\n```\n\n## Running the Project\nIn development, this project runs a backend and frontend server on localhost:5000 and localhost:3000 respectively. \n\nTo start both the frontend and backend, use ` npm run dev`.\n\nAny changes commited to master will be automatically deployed to Heroku. Heroku executes a build step for the client side source files.\n\n## Backend\nBackend server start script: `npm run server`. The entry point for this script is `index.js`. \n\n## Frontend\nFrontend server (client side) start script: `npm run client `. The client server has its own set of dependencies that need to be installed. If you are missing dependencies for the client server:\n```\n$ cd client\n$ npm install\n```\n\n# Client Side Development\n## Components\nPageDriver.jsx drives the viewing process of the documents. Some notable components that PageDriver renders:\n- ReadOnlyEditor: responsible for rendering the page content.\n- PageList: List of ordered pages. When the link is clicked, ReadOnlyEditor changes its render data and displays the new content.\n\nEditPagesDriver.jsx contains all the logic for editting \u003cb\u003eand creating\u003c/b\u003e pages. Reodering of pages can be done in EditPagesDriver (drag and drop). When a page link is clicked, the app will redirect to a new path that will render PageEditor.jsx.\n\nPageEditor is responsible for all the logic concerning the page content and persisting changse to the database.\n\n## Styling\nStyling is currently split between inline styling and CSS modules. Looking into packages like [Radium](https://formidable.com/open-source/radium/ \"Official Site\") ([Github Link](https://github.com/FormidableLabs/radium \"Radium on Github\")) to have consistent, inline styling. \n\n## State Management\nThis project uses [redux](https://redux.js.org/ \"https://redux.js.org/\") and [redux-thunk](https://github.com/reduxjs/redux-thunk \"Redux-Thunk on Github\") for state management. \n\n## Future Development\nMoving foward, components will be developed as functional components (instead of class based components) using [hooks](https://reactjs.org/docs/hooks-intro.html). \n\n\u003cb\u003e Might have to rethink Redux as more components switch over to being functional components.\u003c/b\u003e\n\nFor now, there will just be a happy mix of functional and class based components.\n\n# Backend Development\n## Authentication\nGoogle and Slack oauth using [Passport.js](http://www.passportjs.org/ \"http://www.passportjs.org/\"). All authentication logic can be found in `/routes/authRoutes.js`. For Google or Slack oauth to work, you will need to obtain a clientID and clientSecret. \u003cb\u003eI will add more links later.\u003c/b\u003e\n\n## APIs\nAPI paths can be found in `routes/index.js`\n\n## Auth\nThis app uses [Passport's Slack OAuth Strategy](http://www.passportjs.org/packages/passport-slack-oauth2/). You will have to generate your own Slack app credentials and enter them into `/config/dev.js`:\n\n``` javascript\nmodule.exports = {\n    slackClientID: 'YOURSLACKCLIENTID',\n    slackClientSecret: 'YOURSLACKCLIENTSECRET',\n    mongoURI: 'YOURMONGOURI',\n    mongoUser: 'YOURMONGOUSERNAME',\n    mongoPassword: 'YOURMONGOPASSWORD',\n    cookieKey: 'RANDOMKEY'\n};\n```\n## Database\nMongo is being used as the database. For development, you can:\n1) Host a local mongo database, connect it by creating a dev.js file in the config folder and exporting the config variables. \n2) Use [mlab](https://mlab.com/) and connect using the given config variables. (I would recomment this option.)\n\nIn either case, like with Slack credentials, your MLab credentials have to be pasted into `/config/dev.js`. \n\n# What's left?\n- Editting conflicts\n- Edit history\n- Code styling based on language\n- Keyboard shortcuts for styles\n- Mentions\n- Hashtags\n- Creating an effective search system\n- Links and embedded content\n- Lots and lots and lots of styling\n- Code clean up and comments!\n\n\u003cb\u003eThere's still lots and lots to do!\u003c/b\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarethlau%2Fsunstang-docs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgarethlau%2Fsunstang-docs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgarethlau%2Fsunstang-docs/lists"}