diff --git a/README.md b/README.md index 9d91f0a..a4da7f1 100644 --- a/README.md +++ b/README.md @@ -10,12 +10,6 @@ First, run the development server: ```bash npm run dev -# or -yarn dev -# or -pnpm dev -# or -bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. @@ -28,7 +22,8 @@ This project uses [`next/font`](https://nextjs.org/docs/app/building-your-applic In order to allow collaborators to update the content of the site, this project utilizes [DecapCMS](https://decapcms.org/docs/intro/). This tool allows content editors to make commits to the site repository without touching code or learning Git. When an editor "publishes" a change, -they are making a push to the specified branch (in this project's case, main). +they are making a push to the specified branch (in this project's case, cms). A Github workflow checks for changes over a specified +period of time and pushes the cms branch to main after a period of inactivity, which triggers a App Hosting rollout. All configuration options for Decap CMS are specified in a ```config.yml``` file, in the public folder. In order to connect to Github for authentication without using Netlify's proprietary API, we must specify an authentication endpoint within the @@ -37,13 +32,24 @@ config's backend section: ```yaml name: github repo: brown-ccv/mmp-next - base_url: https://mmp-docker-974587953292.us-central1.run.app/ + base_url: https://mmp-lamp.research.brown.edu/ auth_endpoint: api/auth ``` Within the api folder of the project, we have an auth script and a callback script which utilize [simple-oauth2](https://www.npmjs.com/package/simple-oauth2) -in order to authenticate to Github. This connects to a Github Oauth App created within github's developer settings. Within -this app, the callback url is set to the route of the callback script (https://mmp-docker-974587953292.us-central1.run.app/api/callback). +in order to authenticate to Github. This connects to a Github Oauth App created within github's developer settings. + +### Github Oauth App + +[Gihub Oauth App Docs](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps) + +In order for the web app to authenticate to Github, we utilize a Github Oauth App set up for MMP. Within +this app, the callback url must be set to the route of the callback script (https://mmp-lamp.research.brown.edu/api/callback). + +This callback url is accessing the web project's /api route. For the Nextjs pages router, this means accessing the page in +the ```src/pages/api``` folder. + +For a user to successfully authenticate, the user must have write access to the mmp-next Github repo. ## Learn More