This is the code base for the HEAL Data Fair website. healdatafair.org
Node/npm
This frontend relies on Next's Static Generation using Strapi as the data source. Make sure Strapi is running in parallel when you run this app.
pages/[[...slug]].js
This file generates all the app's route. First, it fetches all the pages entries in Strapi. Then, it creates one route per page found. These routes can look like this:
- yoursite.com
- yoursite.com/page
- yoursite.com/page/nested/route
Notice that the path of the page can be several layers deep, or it can be the root of the site. This is possible thanks to Next's optional catch-all routes.
To see how to build these nested routes, see the Strapi project's Readme.
In the project directory, you can run:
yarn dev
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any errors in the console.
yarn build
Builds the app for production to the .next
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
yarn start
Starts the application in production mode. The application should be compiled with `next build` first.
See the section in Next docs about deployment for more information.
Hosted on AWS with 4 days of database backup
- Super Admins must be signed in and approved as Super Admins
- Once approved you can sign in here https://api.healdatafair.org/admin
- Under COLLECTION TYPES on the left hand navigation panel choose "Pages"
- On the top right hand corner click the Add New Pages button
Fill in the required fields for
- ShortName (Page Name)
- MetaTitle (The text that is displayed on search engine result pages and browser tabs to indicate the topic of a webpage.)
- MetaDescription (An HTML element that describes and summarizes the contents of your page for the benefit of users and search engines)
- ShareImage (Select an existing image or upload your own)
- Status (Set to draft by default, in order to make the page live set this to published)
- Slug (Here enter the slug that you would like to point to the new webpage you are creating. Example: If you enter the word "about", your new page will be found at https://healdatafair.org/about. Make sure the same slug is not used across multiple pages. You can also extend the slug by prefixing the chosen slug with a directory name and a forward slash. Example: If you enter "resources/about" the new page will be found at https://healdatafair.org/resources/about. )
Though your page is now correctly configuered. It will not be avaliable until content sections have been added.
- Click the + button that will say ADD TO CONTENTSECTIONS when you hover above it. A box will open up that instructs you to Pick one component. Under Sections click on the desired component and once you have filled out the neccessary information for the chosen component or components if you are adding more than one, click the green save button on the top right hand corner of the page. Your page will not go live if you do not click save. More about individual components can be found below.
Fill in the desired options for the chosen component
- Page Heading
- Title (Title of page)
- Optionaldescription (Descriptive text to say a little more about the page)
Example of this component can be seen at the top of the resources page https://www.healdatafair.org/resources
To edit a page
- Under COLLECTION TYPES on the left hand navigation panel choose "Pages"
- Click any of the existing pages
- Make edits to existing sections/components. You can also delete existing sections/components or add new ones.
- Once you have made your required changes click the green save button on the top right hand corner.
To create a webinar event
- Select the purple category tag when creating the event.
- Done
To create a public event
- Leave the category tag with no selection.
- Done
In order to not send a welcome email after any edit.
- Switch the PreviouslyConfirmed button to on.
- Save
- Make desired changes
- Save
In the HEAL outlook calendar
- Create a new meeting
- On the meeting header search for the category tag
- Choose green category
- Save
In the HEAL outlook calendar
- Create a new meeting
- On the meeting header search for the category tag
- Choose yellow category
- Save
- Clone the repo
- run npm install
- create a .env.local file by copying the .env.local.example file found in the root folder
- Add the correct values to each variable in that env file (You can get these from your manager.)
- run npm install
- run npm run dev
- The application should be avaiable at localhost:3000
Heal is currently set up for automatic deployment through AWS. Any merges into the main branch on github will trigger the rebuild. The same applies for the staging build.
- Through the content manager or Backend Content API make your neccessary changes and make sure to save and publish.
- Once your updates have been made go to GENERAL > Settings > Webhooks
- Now find the webhook titled staging. (Note: This webhook should be enabled by default and if it is enabled there are no further steps to take. After your content changes were saved it would have automatically triggered a rebuild of the staging site.)
- After 15 minutes check that your new updates are showing up as they should on the staging site and once they are approved head back to GENERAL > Settings > Webhook.
- Find the webhook titled main and click into it. (Always leave it disabled)
- On the top right hand corner find the button that says "Trigger". This will trigger a rebuild of the production side.
- Wait 15 minutes and confirm that your changes have been applied to the production site.
- Create a new branch off of the staging branch and name it after the github issue the task belongs to. example. issue/46/navbar-links-fix
- All commits should be given a short description of what was done and why. Example: The external links component was opening on the same page, added target blank to open a new tab.
- When completed push up your new branch to the github repository.
- If this is a feature that needs approval by other team members follow these steps to deploy your branch.
- Sign into AWS
- Go to deployments
- Find your branch and hit deploy
- Make note of the link created so that you can share it
- Create a PR and tag the content team owner and two developers for code review.
- Never merge a PR until the code has been approved and the owner of the new feature gives us the green light to push into production.
- After approved and merged into staging, check the staging build to make sure everything looks good.
- Once staging is approved, create a PR to the main branch and notify the team that it is ready.