bcgov / digital.gov.bc.ca

Helping the digital government community deliver better digital services for the people and priorities of British Columbia.
https://digital.gov.bc.ca/
Apache License 2.0
13 stars 8 forks source link
citz

Repository Archived: Outdated Version

Important Notice

As of 2024-02-21, this repository has been moved to read-only mode. This change has been made because the repository contains the code for an outdated version of our site/application.

Why Is This Repository Archived?

Looking for the Latest Version?

If you're interested in the latest version of our site/application, please visit the new repository at: https://github.com/bcgov/wordpress-digimod

digital.gov.bc.ca

Learn how the Government of British Columbia is building teams and using modern technology to deliver better services.

Contents

What is happening here?

We are building the next version of Digital.gov.bc.ca based on user research and in alignment with directives to support the BC Public Service to improve service delivery using digital methods and tools.

The project is currently being maintained by the Digital Modernization and Acceleration team who continues to build this website and associated resources in collaboration with partners across the public service. We are taking an Agile Scrum product delivery approach.

You can see our backlog in the open by checking out our Jira and see our current sprint progress here. Any additional documentation can be found on Confluence

Contact the product owner, Arlen.Tees@gov.bc.ca, if you have questions.

Components

How to run the project locally

NOTE: For full local development see next section. NOTE 2: Often the first time these commands are run the images take too long to download and the commands can time out. You may need to run the build and up command multiple times to get everything working.

requires Docker (or Podman) and docker-compose

  1. Environment variables, adjust as necessary for your environment. At the root of the project run the following:
    cp .env.example .env
    cp strapi-app/.env.example strapi-app/.env

NOTE: for development on a computer using apple silicon chips, do the following:

cp apple-silicon.override.yml docker-compose.override.yml
  1. Build, (re)create, start and attach containers:

docker-compose up

NOTE: for development on a computer using apple silicon chips, add --build-arg applem1=1

To run without a console log (detached mode) add the -d flag. When new npm/yarn packages have been installed the project may need to be rebuilt using:

docker-compose build --no-cache
docker-compose up
  1. To stop and remove containers, networks and images created by up

docker-compose down

Local development

React Frontend

If docker-compose up was not run in the previous steps and the development preference is to install the frontend on bare metal, first ensure your Node version (node --version) matches what is used in react-frontend/Dockerfile and package.json and run the following:

docker-compose up mongo backend

Assuming docker-compose up was run previously :

docker stop digital_frontend

Open a new terminal:

cd react-frontend
npm install
npm start

Frontend tests can be now be run locally in the terminal/IDE.

Strapi

We will not document how to work with strapi here. The strapi docs are far more complete. They cover how to create graphql queries, how to create new content types, ets. We recommend following any one of the many tutorials or introductions to strapi found online to become comfortable with the development/configuration techniques used.

However two things must be done before the local strapi development environment can mimic the deployments in dev, test and prod.

Create the first admin user

When the strapi and react containers are all running, navigate to http://localhost:1337/admin/. You will be prompted to create a first admin user. The strapi app will prompt the steps to take.

Set the permissions on the content types

When creating content types the permissions for count, create, delete, find, findone, and update are set to false. You will need to set these before the front end is able to render them. To do this, navigate to settings->USERS & PERMISSIONS PLUGIN -> roles -> public. (Strapi docs go into more detail on these permissions). If you are unsure of which permissions are needed for the app to work properly, navigate to the same screen in thedev or test strapi instance and copy them.

TODO: These steps could be automated by creating a script to seed the local database.

Other docs

There is more documentation in the following places

Build, Deploy and Operation of this Project

Action docs