The front-end for businesscarboncalculator.normative.io, powered by normative-io/accounting-services - allowing SMEs to quickly and easily measure their carbon footprint.
Note: The project was originally codenamed "starter" - so any references to this can be considered to be about the Business Carbon Calculator (aka. "BCC").
🚧 Warning
It is currently not possible for developers not associated with Normative to start this project as it requires access to protected resources.
In order to get started, you'll need to set up your environment and install dependencies. These first steps should only need to be completed once - after that, you can start a local server straight away.
In order to run this, ensure nvm
is installed and you're a member of npmjs.com/org/normative.
$ nvm use
$ nvm install-latest-npm
$ npm login # login to personal npm account
$ npm install
An environment.local.ts
file will need to be added in apps/starter/src/environments
before starting the local server - please reach out to another member of the project to get the latest recommended configuration.
A local server can be started simply via npm, that will interact with the accounting services configured during the environment setup.
$ nvm use
$ npm start # defaults to localhost:4200
Note: Other environments (as defined within the Angular configuration) can be run by adding their own environment file and started via
npx nx run starter:serve:$ENV
(with$ENV=dev|prod
).
Unit tests use Jest and are strongly encouraged throughout the codebase, with the ability to run the full suite via npm.
$ npm test
Code style is enforced via ESLint and Prettier, and can be checked via npm.
$ npm run lint
$ npm run format:check
If using Visual Studio Code, there are recommended extensions set in the workspace that will format on save and show linting warnings within the IDE - alternatively a npm script is available to fix and save format issues.
$ npm run format
The project is set up to use a structure generated by @nrwl/angular. The main application exists within apps/starter, with each route of businesscarboncalculator.normative.io having its own directory under apps/starter/src/app.
The back-end to this application is provided by normative-io/accounting-services. Find out more about the individual services and how to run it locally via their own readme.
Some branded assets are consumed from @normative/theme, however BCC-specific ui components have been implemented as a custom theme for @angular/material, the styles for which can be found at apps/starter/src/styles.
To view these shared components, a simplestyle guide can be enabled in the environment (by setting styleguide: true
) and then available to view at /styleguide
.
.
├── .vscode # shared settings/recommendations for visual studio code users
├── apps
│ └── starter # the main angular application
└── scripts # useful scripts/logic used outside of the main application
This project is maintained by Normative but currently not actively seeking external contributions. If you however are interested in contributing to the project please sign up here or come join us.
Thank you to all the people from Google.org who were critical in making this project a reality!
- Zachary Hynes (@zhynes)
- John Bartholomew (@johnbartholomew)
- Craig Rogers (@twentyrogersc)
- Megan Hopp (@meganhopp)
- Mishu Garg (@mishugarg09)
- Matt Pellegrini (@MattPellegrini)
Copyright (c) Meta Mind AB. All rights reserved.
Licensed under the Apache-2.0 license