Skip to content

Enabling SMEs to quickly and easily measure their carbon footprint.

License

Notifications You must be signed in to change notification settings

normative-io/business-carbon-calculator-public

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Business Carbon Calculator

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").

Development

🚧 Warning

It is currently not possible for developers not associated with Normative to start this project as it requires access to protected resources.

Setup

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.

Local server

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).

Testing

Unit tests use Jest and are strongly encouraged throughout the codebase, with the ability to run the full suite via npm.

$ npm test

Linting

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

Architecture

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.

Accounting services

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.

Styleguide (aka. Shared components)

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.

Repo structure

.
├── .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

Contributing

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!

License

Copyright (c) Meta Mind AB. All rights reserved.

Licensed under the Apache-2.0 license