Git Product home page Git Product logo

mem-admin's Introduction

mem-admin (MEM MMT)

ESM is a project of the Environmental Assessment Office in partnership with the OCIO DevOps Pathfinder.

MEM MMT is an offshoot derivative of the ESM application to support the Major Mines Transparency project of the Ministry of Energy and Mines.

This application is a tool to support the work of EAO staff, project proponents, and other stakeholders as environmental assessments are conducted.

Features

The features provided by the web-based ESM application include:

  • a public-facing view of documents related to proposed development projects
  • the ability to comment on projects
  • as tools to support EAO staff, proponents, and stakeholders in performing tasks related to the environmental review process.

Usage

Developer Requirements

mem-admin has been built using MongoDB, Express, AngularJS and NodeJS. See http://mean.js/ for more information on the project's development stack. Basic globally install requirements for Win32, OSX, or Linux are as follows:

  • node@ = 6.11.3
  • npm@ >= 2.15.1 (only for installing yarn)
  • mongodb-server@ >= 2.6.x
  • grunt@ >= 0.4.5
  • git
  • yarn >= 1.3.2

The following environment variables must be set in order for a Minio object storage instance to be used for document uploads:

  • MINIO_DEPLOYMENT_NAME - the URL pointing to a Minio instance (can be https://play.minio.io:9000)
  • MINIO_ACCESS_KEY - the minio access key to be used for authentication
  • MINIO_SECRET_KEY - the minio secret key to be used for authentication

Installation

yarn install

Development Mode

npm start

Production Mode

grunt build && NODE_ENV=production node server.js

After this you may open up a browser of your choice and navigte to http://localhost:4000/

Unit Tests

The unit tests are broken into two pieces: the client tests, and the server tests.

Client

Run npm run test-client

This will execute the unit tests using Karma and Jasmine. See the karma.conf.js

This will create a code coverage report at build/coverage/client.

Server

Run npm run test-server

This will execute the unit tests using Mocha. See the mocha_istanbul grunt task.

This will create a code coverage report at build/coverage/server.

Functional Tests

Run npm run e2e

Prerequisites

  • A Mongo DBMS must already be running as a service.

This will trigger the following steps, via the gruntfile:

  1. Create a new functional test database
  2. Start the functional test server
  3. Run the functional tests
  4. Drop the functional test database
  5. Shutdown the functional test server

Configurable Environment Variables

Environment Variable Default Value Description
FUNCTIONAL_HOST localhost location of the functional test server
FUNCTIONAL_PORT 3001 port of the functional test server
BASEURL http://localhost:3001 the url targeted by the functional tests
MONGODB_FUNC_HOST localhost location of the mongodb instance targeted by the functional test server
MONGODB_FUNC_PORT 27017 port of the mongodb instance targeted by the functional test server
MONGODB_FUNC_DATABASE mem-dev-func name of the database used by the functional test server

Extra

If running linux you should have grunt cli installed so that you take advantage of the automated kill/cleanup procedure provided by the grunt tasks.

Project Status

Goals/Roadmap

Getting Help or Reporting an Issue

Visual Studio Code

To use our Visual Studio Code extensions copy the contents of vscodeextensions.txt in the root directory and paste it into bash. If it doesnt work, make sure you have the Code CLI installed code --version and if it's not installed open the command palette (shift + command + p) and run Shell Command: install 'code' command in PATH.

How to Contribute

Feel free to create pull requests from the default "master" branch, click here to create one automatically: https://github.com/bcgov/mem-admin/pull/new/master.

License

Copyright 2015 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.

mem-admin's People

Contributors

actionanalytics avatar amoshaviv avatar asanchezr avatar benleather avatar bigmikestudios avatar bryan-gilbert avatar ccoldwell avatar codydaig avatar enkodellc avatar esune avatar fieranmason avatar igorauad avatar ilanbiala avatar jeznorth avatar liorkesos avatar lirantal avatar logancodes avatar luebken avatar marklise avatar maxwardle avatar michaeljcole avatar mleanos avatar nickphura avatar pangara avatar rhutchison avatar rpyyj avatar rschwabco avatar sheaphillips avatar simison avatar usingtechnology avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mem-admin's Issues

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 261 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 263 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

Solution to provide Angular app deployment flexibility

Routing information is being placed in at develop time in the Angular api service files. This makes deployment involve app code changes. Here are the hardcoded values:

case 'mem-mmt-dev.pathfinder.gov.bc.ca':

Background

This has been a challenge to address up to now in API backed Angular front-ends (architecture diagram) that are built using the s2i built approach (build diagram), which creates a high performance web server image but at the cost of extra build complexity.

Solution

Here is a simple pattern from Eagle EPIC that solves this in a few lines, meeting the https://12factor.net Factor III, "Store config in the environment" and allowing the app to be deployed based on settings alone. It handles the more complicated s2i builds (other projects that expose environment settings in a similar pattern like MDS use a much simpler build process).

Please see the following areas of code:

  1. Here's where the Angular app consumes the settings from the server and replaces the hardcoded routes
  2. Make sure this line gets placed in the HTML head as it needs to run prior to app load
  3. Create the landing point for the environment variables at server build time
  4. When the pod starts up, and on every subsequent redeployment, set the variables. Javascript was chosen over JSON as it's a direct plugin for the existing variables in api.ts without having to do overhead to handle the JSON. MDS uses JSON.
  5. Pass the environment variables along
  6. Settings exposed in OpenShift

You can check if your settings are exposed by (if you used the same pattern as above) visiting https://your-front-end-url/publicServerEnvironmentSettings.js

And remember to set your app to redeploy on environment variable change. That way your app will get new environment settings without needing a build.

Cheers!

PS. If you have a discrete admin site, the above solution uses the same pattern with slight variations on the path (/admin in the server build and image startup script but html stays the same). Note the use of uniquely named client-side variables to avoid collisions (public vs admin).

It's Been a While Since This Repository has Been Updated

This issue is a kind reminder that your repository has been inactive for 262 days. Some repositories are maintained in accordance with business requirements that infrequently change thus appearing inactive, and some repositories are inactive because they are unmaintained.

To help differentiate products that are unmaintained from products that do not require frequent maintenance, repomountie will open an issue whenever a repository has not been updated in 180 days.

  • If this product is being actively maintained, please close this issue.
  • If this repository isn't being actively maintained anymore, please archive this repository. Also, for bonus points, please add a dormant or retired life cycle badge.

Thank you for your help ensuring effective governance of our open-source ecosystem!

Add project lifecycle badge

No Project Lifecycle Badge found in your readme!

Hello! I scanned your readme and could not find a project lifecycle badge. A project lifecycle badge will provide contributors to your project as well as other stakeholders (platform services, executive) insight into the lifecycle of your repository.

What is a Project Lifecycle Badge?

It is a simple image that neatly describes your project's stage in its lifecycle. More information can be found in the project lifecycle badges documentation.

What do I need to do?

I suggest you make a PR into your README.md and add a project lifecycle badge near the top where it is easy for your users to pick it up :). Once it is merged feel free to close this issue. I will not open up a new one :)

Add missing topics

TL;DR

Topics greatly improve the discoverability of repos; please add the short code from the table below to the topics of your repo so that ministries can use GitHub's search to find out what repos belong to them and other visitors can find useful content (and reuse it!).

Why Topic

In short order we'll add our 800th repo. This large number clearly demonstrates the success of using GitHub and our Open Source initiative. This huge success means its critical that we work to make our content as discoverable as possible; Through discoverability, we promote code reuse across a large decentralized organization like the Government of British Columbia as well as allow ministries to find the repos they own.

What to do

Below is a table of abbreviation a.k.a short codes for each ministry; they're the ones used in all @gov.bc.ca email addresses. Please add the short codes of the ministry or organization that "owns" this repo as a topic.

add a topic

That's in, you're done!!!

How to use

Once topics are added, you can use them in GitHub's search. For example, enter something like org:bcgov topic:citz to find all the repos that belong to Citizens' Services. You can refine this search by adding key words specific to a subject you're interested in. To learn more about searching through repos check out GitHub's doc on searching.

Pro Tip ๐Ÿค“

  • If your org is not in the list below, or the table contains errors, please create an issue here.

  • While you're doing this, add additional topics that would help someone searching for "something". These can be the language used javascript or R; something like opendata or data for data only repos; or any other key words that are useful.

  • Add a meaningful description to your repo. This is hugely valuable to people looking through our repositories.

  • If your application is live, add the production URL.

Ministry Short Codes

Short Code Organization Name
AEST Advanced Education, Skills & Training
AGRI Agriculture
ALC Agriculture Land Commission
AG Attorney General
MCF Children & Family Development
CITZ Citizens' Services
DBC Destination BC
EMBC Emergency Management BC
EAO Environmental Assessment Office
EDUC Education
EMPR Energy, Mines & Petroleum Resources
ENV Environment & Climate Change Strategy
FIN Finance
FLNR Forests, Lands, Natural Resource Operations & Rural Development
HLTH Health
FLNR Indigenous Relations & Reconciliation
JEDC Jobs, Economic Development & Competitiveness
LBR Labour Policy & Legislation
LDB BC Liquor Distribution Branch
MMHA Mental Health & Addictions
MAH Municipal Affairs & Housing
BCPC Pension Corporation
PSA Public Safety & Solicitor General & Emergency B.C.
SDPR Social Development & Poverty Reduction
TCA Tourism, Arts & Culture
TRAN Transportation & Infrastructure

NOTE See an error or omission? Please create an issue here to get it remedied.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.