Partio-ohjelma frontend
Website for Partio-scout Finland
- Gatsby app hosted in Gatsby cloud
- Staging environment:
https://pof-backend-testing.azurewebsites.net/admin/
- Production environment:
https://pof-backend-production.azurewebsites.net/admin/
- Staging environment:
- Strapi as a CMS
- Written with ReactJs
- Backend hosted in Azure Algolia as a search engine
Gatsby uses graphql as its data query language, and it creates the schema for it automatically base on the data that it has. This doesn't work well for Strapi data, since unpopulated fields are not returned from the REST-API which the plugin gatsby-source-strapi
uses to fetch the data. This leads to unpopulated starpi fields not ending up in the schema, and we don't want that. This problem has been fixed by defining the schema for Strapi data statically, in the file configs/typeDefs.gql
. If you need to define something else manually, add those definitions to the same file.
- Install dependencies with
yarn install
For development, add the following variables into file: .env.development
.
Required environment variables:
GATSBY_API_URL
: The address of the Strapi APIGATSBY_ALGOLIA_APP_ID
: Id of the Algolia applicationGATSBY_ALGOLIA_API_KEY
: API-KEY for the Algolia applicationGATSBY_ALGOLIA_ENVIRONMENT
: the environment used in AlgoliaGA_TRACKING_ID
: Google Analytics tracking-id (not needed in development)GATSBY_COOKIEBOT_ID
: Cookiebot Id (not needed in development) Optional environment variables:GATSBY_UPDATE_SCHEMA_SNAPSHOT
: Set this to true to update the graphql schema onyarn develop
ENABLE_GATSBY_REFRESH_ENDPOINT
: Set this to true to enable Gatsby's refresh-endpoint onyarn develop
. Useful when running a preview server.GATSBY_CLOUD_ENV
: Set this tostaging
if you want a red banner at the top of the page to disclaim that the user is on the test site.
You can find the .env-file from LastPass.
TODO: Tests
yarn develop
If you're using development server as an API and the build fails for statuscode 403 - Forbidden, make sure that the public roles are correctly set. Go to localhost:1337/admin
-> General -> Settings -> USERS & PERMISSIONS PLUGIN -> Roles -> public -> Permissions. Check from production strapi what permissions to give.
http://localhost:8000/
Create a new branch when working with new feature or fixing a bug.
Create a pull request into staging
branch. There should be at least one reviewer for changes.
Test your changes and if everything is fine, merge staging branch to main
https://stage.partio-ohjelma.fi/
Merge a branch to staging, Gatsby cloud automatically deploys new changes to staging.
Check the build logs in Github actions and go to staging site, test if everything is working okay.
Deployment logs can be found from Gatsby cloud and Github.
https://partio-ohjelma.fi/
Merge staging branch to main, Gatsby cloud automatically deploys changes to production.
// TODO
// TODO
// TODO
// TODO
// TODO
// TODO