diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..b2de4d7
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,138 @@
+# Contributing
+
+Contributions to jupyter-power-usage are highly welcome! It follows closely the [Jupyter contributor guide](https://docs.jupyter.org/en/latest/contributing/content-contributor.html).
+
+## Setting up a development environment
+
+We recommend using [pipenv](https://docs.pipenv.org/) to make development easier.
+
+Alternatively, you can also use `conda` or `mamba` to create new virtual environments.
+
+Clone the git repository:
+
+```bash
+git clone https://github.com/mahendrapaipuri/jupyter-power-usage
+```
+
+Create an environment that will hold our dependencies:
+
+```bash
+cd jupyter-power-usage
+pipenv --python 3.8
+```
+
+With conda:
+
+```bash
+conda create -n jupyter-power-usage -c conda-forge python
+```
+
+Activate the virtual environment that pipenv created for us
+
+```bash
+pipenv shell
+```
+
+With conda:
+
+```bash
+conda activate jupyter-power-usage
+```
+
+Do a dev install of jupyter-power-usage and its dependencies
+
+```bash
+pip install --editable '.[dev]'
+```
+
+## JupyterLab extension
+
+The JupyterLab extension for `jupyter-power-usage` follows the common patterns and tooling for developing extensions.
+
+```bash
+# activate the environment (conda, pipenv)
+
+# install the package in development mode
+python -m pip install -e ".[dev]"
+
+# link your development version of the extension with JupyterLab
+jupyter labextension develop . --overwrite
+
+# Rebuild extension Typescript source after making changes
+jlpm run build
+```
+
+You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
+
+```bash
+# Watch the source directory in one terminal, automatically rebuilding when needed
+jlpm run watch
+# Run JupyterLab in another terminal
+jupyter lab
+```
+
+With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
+
+To check the extension is correctly installed, run:
+
+```bash
+jupyter labextension list
+```
+
+It should show something like the following:
+
+```bash
+JupyterLab v3.6.6
+/path/to/env/share/jupyter/labextensions
+ @mahendrapaipuri/jupyter-power-usage v0.1.0 enabled OK
+```
+
+## Estimating emission factor
+
+Currently only French real time emission factor is implemented in the extension to estimation eCO2 emissions based on power usage. For the rest of the countries a constant emission factor that can be configurable is used.
+
+API requests for the emission factor is made from the frontend extension rather than backend server. The rationale is that the machine where backend server is running might not have internet connectivity. Also, these sort of API requests are rate limited and hence, making requests from individual user browser is more appropriate.
+
+In order to add support for other countries, users need to make changes in the file [emissionsHandler.ts](./src/emissionsHandler.ts) as follows:
+
+- Create a new namespace with name of the country.
+- Add all the necessary logic to get the emission factor in g/kWh for the country in its namespace.
+- Finally, modify `getEmissions` function in [emissionsHandler.ts](./src/emissionsHandler.ts) to get the emission factor of the country.
+
+We need to add the country code in the enum section of `countryCode` object in [plugin.json](./schema/plugin.json). This enables users to use this country specific emission factor to estimate emissions.
+
+
+## pre-commit
+
+`jupyter-power-usage` has adopted automatic code formatting so you shouldn't need to worry too much about your code style.
+As long as your code is valid,
+the pre-commit hook should take care of how it should look. Here is how to set up pre-commit hooks for automatic code formatting, etc.
+
+```bash
+pre-commit install
+```
+
+You can also invoke the pre-commit hook manually at any time with
+
+```bash
+pre-commit run
+```
+
+which should run any autoformatting on your code
+and tell you about any errors it couldn't fix automatically.
+You may also install [black integration](https://github.com/ambv/black#editor-integration)
+into your text editor to format code automatically.
+
+If you have already committed files before setting up the pre-commit
+hook with `pre-commit install`, you can fix everything up using
+`pre-commit run --all-files`. You need to make the fixing commit
+yourself after that.
+
+## Tests
+
+It's a good idea to write tests to exercise any new features,
+or that trigger any bugs that you have fixed to catch regressions. `pytest` is used to run the test suite. You can run the tests with in the repo directory:
+
+```bash
+python -m pytest
+```
diff --git a/README.md b/README.md
index 3144013..9a1d184 100644
--- a/README.md
+++ b/README.md
@@ -1,61 +1,87 @@
-# jupyterlab-topbar-message
+# jupyter-power-usage
-A banner message to display on the Jupyterlab Topbar. It is similar to [jupyterlab-topbar-text](https://github.com/jupyterlab-contrib/jupyterlab-topbar-text) project. The difference is that the message is immutable and it can be set in the backend server.
+![Screencast for power usage](./doc/power-usage.gif)
-It is mostly useful if the sysadmins want to disply a specific message to the users while spawning the JupyterLab servers using JupyterHub. They can implement the logic in the spawner and needs to set a environment variable `JUPYTERLAB_TOPBAR_MESSAGE` in the spawner environment.
+The objective of this extension is to display power usage of the CPU and/or GPU on which jupyter server is running. Power usage is estimated using [Running Average Power Limit (RAPL)](https://web.eece.maine.edu/~vweaver/projects/rapl/) metrics that are available on Intel processors manufactured after 2012 (since broadwell). It is available on latest AMD processors as well. For the case of GPUs, currently only nVIDIA GPUs are supported and power usage is gathered from `nvidia-smi` tool.
-For instance, it can be as simple as adding a welcome message to a user, `bob` as `JUPYEERLAB_TOPBAR_MESSAGE="Welcome Bob"`.
+Additionally, the extension is capable of estimating equivalent CO2 emissions. Emissions are estimated based on the current power usage and a emission factor that gives equivalent grams of CO2 power consumed. Currently, a [real time emission factor](https://www.rte-france.com/en/eco2mix/co2-emissions) is implemented for France and for the rest a constant configurable factor of 475 gCO2.eq/kWh is used.
-## Requirements
+The metrics are displayed in the top bar of JupyterLab and are updated at a configurable interval. The default interval is 5 seconds. RAPL can enforce power limit so as nVIDIA GPUs. If those power limits are enabled and available, they will be displayed in the indicators.
-- JupyterLab >= 3.0
+---
+**NOTE**
-## Install
+The extension works only on Linux that exposes RAPL metrics. Starting from kernel 5.4, RAPL metrics are accessible [only for root](https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v5.4.77&id=19f6d91bdad42200aac557a683c17b1f65ee6c94). In this case, the user needs to add read permissions on `/sys/fs/powercap` directory to be able to display power usage indicators in JupyterLab.
-```bash
-pip install git+https://gitlab.com/idris-cnrs/jupyter/jupyterlab/jupyterlab-topbar.git#subdirectory=packages/message-extension
-```
+If the JupyterLab is running inside a container or VM, ensure that `/sys/fs/powercap` file system exists. If it does not, extension will not work.
-## Contributing
+The extension is not available for Notebook < 6. It supports JupyterLab >= 3 and Notebook >= 7.
-### Development install
+The extension's architecture closes follows the [jupyter-resource-usage](https://github.com/jupyter-server/jupyter-resource-usage) extension and all the credit goes to the contributors and maintainers of the above stated extension.
-Note: You will need NodeJS to build the extension package.
+---
-The `jlpm` command is JupyterLab's pinned version of
-[yarn](https://yarnpkg.com/) that is installed with JupyterLab. You may use
-`yarn` or `npm` in lieu of `jlpm` below.
+## Installation
-```bash
-# Clone the repo to your local environment
-# Change directory to the jupyterlab-toolbar-buttons directory
-# Install package in development mode
-pip install -e .
-# Link your development version of the extension with JupyterLab
-jupyter labextension develop . --overwrite
-# Rebuild extension Typescript source after making changes
-jlpm run build
-```
+### JupyterLab 3.x
-You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.
+You should install the version `<1.0.0` for JupyterLab 3.x compatibility.
```bash
-# Watch the source directory in one terminal, automatically rebuilding when needed
-jlpm run watch
-# Run JupyterLab in another terminal
-jupyter lab
+pip install 'jupyter-power-usage<1.0.0'
```
-With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).
+### JupyterLab 4.x and Notebook 7.x
-By default, the `jlpm run build` command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:
+You should install the latest version for JupyterLab 4.x and Notebook 7.x compatibility.
```bash
-jupyter lab build --minimize=False
+pip install jupyter-power-usage
```
-### Uninstall
+The extension **does not support** Notebook < 7.
+
+## Configuration
+
+### Server side config
+
+#### Measurement Scope
+
+Currently the extension supports different measurement scopes:
+
+- `process`: Power usage for current process and its children will be reported
+- `user`: Power usage for current user processes will be reported
+- `system`: Power usage for entire system will be reported.
+
+By default `process` scope is used. The user can change it by CLI flag `--PowerUsageDisplay.measurement_scope` to `jupyter lab` command. Alternatively, it can be configured in `jupyter_server_config.json` in [Jupyter config directory](https://docs.jupyter.org/en/latest/use/jupyter-directories.html#configuration-files).
+
+### Frontend extension config
+
+![Frontend extension settings](./doc/frontend-settings.png)
+
+The frontend extension settings can be accessed by `Settings -> Advanced Settings -> Power Usage Monitor` in JupyterLab. Important settings are:
+
+- `Refresh Rate`: Frequency at which power usage is updated in the JupyterLab. Do not use too small intervals as it will end up making too many API calls to update metrics.
+
+- `CPU label` and `GPU label` settings are self explanatory.
+
+**Emissions Estimation Settings**
+
+- `Country code`: Currently only data for France is supported. The realtime emission factor from [RTE eCO2 mix](https://www.rte-france.com/en/eco2mix/co2-emissions). We encourage users to add support for other countries. Please check [`CONTRIBUTING.md`](CONTRIBUTING.md) on how to do it. If your country is not available in the list, leave it blank.
+
+- `Refresh rate`: This defines how often the emission factor is updated in ms. For [RTE eCO2 mix](https://www.rte-france.com/en/eco2mix/co2-emissions) data, it is updated every 30 min and has a rate limit of 50000 API requests per month.
+
+- `Emission factor`: This constant emission factor is used in the estimation of emissions when country specific data is unavailable.
+
+## Contributing
+
+If you would like to contribute to the project, please read the [`CONTRIBUTING.md`](CONTRIBUTING.md). The `CONTRIBUTING.md` file
+explains how to set up a development installation and how to run the test suite.
+
+## Uninstall
```bash
-pip uninstall jupyterlab_topbar_message
+pip uninstall jupyter_power_usage
```
+
+This will uninstall python package and all the frontend related assets.
diff --git a/RELEASE.md b/RELEASE.md
new file mode 100644
index 0000000..7359f1e
--- /dev/null
+++ b/RELEASE.md
@@ -0,0 +1,6 @@
+# Making a new release of `jupyter-resource-usage`
+
+## Automated Releases with `jupyter_releaser`
+
+The recommended way to make a release is to use
+[`jupyter_releaser`](https://jupyter-releaser.readthedocs.io/en/latest/).
diff --git a/doc/frontend-settings.png b/doc/frontend-settings.png
new file mode 100644
index 0000000..2837271
Binary files /dev/null and b/doc/frontend-settings.png differ
diff --git a/doc/power-usage.gif b/doc/power-usage.gif
new file mode 100644
index 0000000..7ca0c40
Binary files /dev/null and b/doc/power-usage.gif differ
diff --git a/style/base.css b/style/base.css
index 63c97bb..369750d 100644
--- a/style/base.css
+++ b/style/base.css
@@ -42,4 +42,4 @@ sub {
bottom: 0;
line-height: 1;
font-size: .5em;
-}
\ No newline at end of file
+}