FOM projects (proposals for logging, essentially) are submitted to FOM and made available for public review and comment. The submitting organization then needs to address the comments before submitting the project to the ministry.
Technology Stack: Angular, Node.js, PostgresSQL with PostGIS running in OCP v4
This repo is for the Node.js API backend.
- Development
- Production/Maintenance
See ministry Confluence site: https://apps.nrs.gov.bc.ca/int/confluence/pages/viewpage.action?pageId=83560736
- Install node and docker desktop (with WSL2 on Windows 10)
- npm install -g ts-node
- npm install -g typeorm
- git clone https://github.com/bcgov/nr-fom-api.git
- npm install
- docker-compose up -d db
- npm run typeorm:migrate
- npm run start:api
- Navigate to http://localhost:3333/api
- docker build -f docker/api/Dockerfile.local -t api .
- docker run -d --name api -p 3333:3333 -u 1001 --read-only -e DB_PASSWORD=test -e DB_NAME=api-db -e DB_USERNAME=postgres -e DB_HOST=localhost -e DB_TYPE=postgres -e DB_PORT=5432 api
- WARNING: Currently doesn't work - fails with Error: connect ECONNREFUSED 127.0.0.1:5432
- Install dbeaver or pgadmin
- Ensure database is running (docker-compose up -d db && npm run typeorm:migrate)
- Create PostGRES connection to local database using connection information as defined in docker-compose.yml
- docker-compose down
- docker volume rm nr-fom-api_ms-postgres-data
- docker-compose up -d db
- npm run db:migrate-main
- npm run db:migrate-test
- (Although migrations are also run when starting the API component)
This project uses the Nest API framework and the Nx monorepo platform / cli tools. Nx is used to manage this repository and generate Nest components. See FRAMEWORK.md for nrwl nx documentation.
Notes:
- We use a custom OpenApi template when generating the frontend api clients from our Api
- The
.fetch-template
bash script that does the clone and patch is in theapps/api/openapi
dir - To generate the API client execute
npm run gen:client-api
- The generated client api library is located in
libs/client
See OpenShift Readme
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.
Copyright 2021 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.