This is a digital service built in partnership with the Ministry of Health and the Ministry of Agriculture which supports British Columbian farmers to apply for authorization from the BC Provincial Health Officer to receive temporary foreign workers and protect workers during the COVID-19 pandemic.
This application has been released and is stable.
This project includes the following features:
- Public web form for farm operators
- Ability to download a form submission as a PDF
- Admin portal with login
- Secure lookup of submissions
- Tracking notes and determinations associated with submissions and inspections
- Real-time analytics
To report bugs/issues/feature requests, please file an issue.
If you would like to contribute, please see our contributing guidelines.
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Make sure you have Docker and Docker-compose installed in your local environment. For instructions on how to install it, follow the links below:
To set up and run database, backend (server), and frontend (client) applications:
- Run
make localwithin the root folder of the project
To tear down your environment:
- Run
make close-local
To seed database, run:
make local-db-seed
To run server tests:
- Make sure containers are running
make local
- Shell into the server container by running
make local-server-workspacenpm test
- or by running
make local-server-tests
From both the client and the server folders, run npm i to install dependencies.
-
Add a hostname alias to your environment
-
- Edit your
/etc/hostsfilename
- Edit your
-
- Add
127.0.0.1 server
- Add
-
Run client:
npm startrun within client folder -
Start Database:
make run-local-db -
Once the DB is running,
npm run db:seedto seed the database -
Run server:
npm run watchfrom within the server folder -
Run server tests:
npm testfrom within the server folder
Communication from front end to back end is facilitated by the proxy field in client package.json.
- landing page for form submission
- allows an admin to login
- single input field to search for a form submission
- render a static version of a form submission
- /login [POST] validate login creds, isssue token
- /form [POST] submit new form
- /form/:id [POST] edits an existing form
- /form/:id [GET] retrieves an existing form
- In production: / [GET] serves the built client app
The application uses Amazon DocumentDB, a non-relational database, fully managed, that emulates the MongoDB 3.6 API and utilizes a distributed, fault-tolerant, self-healing storage system.
You can find more information at:
- https://aws.amazon.com/documentdb/
- https://docs.aws.amazon.com/documentdb/latest/developerguide/what-is.html
Keep in mind that DocumentDB does not support all MongoDB 3.6 features and APIs. Check the link below to explore the differences:
- https://docs.aws.amazon.com/documentdb/latest/developerguide/mongo-apis.html
- https://docs.aws.amazon.com/documentdb/latest/developerguide/functional-differences.html
For this project, there are 2 database clusters configured under private subnets inside a custom VPC. One to be used for development and staging environments and the other for the production environment.
For local development, a MongoDB 3.6 container is being used.
Copyright 2020 Province of British Columbia
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.