Open Carbon Watch
We monitor greenhouse gases emission reports published by organizations, along with their legal obligations and their own commitments, and track them over time.
https://github.com/OpenCarbonWatch/Website
Category: Emissions
Sub Category: Emission Observation and Modeling
Keywords
carbon-emissions database laravel opendata vuejs
Last synced: about 15 hours ago
JSON representation
Repository metadata
Source code (back-end and front-end) of our main website, which monitors greenhouse gases emissions reports by organizations
- Host: GitHub
- URL: https://github.com/OpenCarbonWatch/Website
- Owner: OpenCarbonWatch
- License: agpl-3.0
- Created: 2019-11-02T09:22:52.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-15T08:10:11.000Z (about 2 years ago)
- Last Synced: 2024-10-29T19:57:34.776Z (6 months ago)
- Topics: carbon-emissions, database, laravel, opendata, vuejs
- Language: PHP
- Homepage: https://opencarbonwatch.org
- Size: 1.54 MB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 5
- Releases: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
Website
Resources used to build our main website
Installation of the database server
Database
We use PostgreSQL on Ubuntu 18.04.
sudo su postgres
psql -c "CREATE USER ocw_user PASSWORD 'secret_password';"
psql -c "CREATE DATABASE ocw OWNER ocw_user ENCODING 'UTF-8';"
Import data
sudo su postgres
psql -d ocw -c "TRUNCATE activities, cities, legal_types, assessment_organization, assessments, organizations;"
psql -d ocw -c "DROP INDEX IF EXISTS idx_organizations_name;"
psql -d ocw -c "COPY activities FROM '/home/data/activities.csv' CSV HEADER;"
psql -d ocw -c "COPY cities FROM '/home/data/cities.csv' CSV HEADER;"
psql -d ocw -c "COPY legal_types FROM '/home/data/legal_types.csv' CSV HEADER;"
psql -d ocw -c "COPY assessments FROM '/home/data/assessments.csv' CSV HEADER;"
psql -d ocw -c "COPY organizations FROM '/home/data/organizations.csv' CSV HEADER;"
psql -d ocw -c "COPY assessment_organization FROM '/home/data/assessment_organization.csv' CSV HEADER;"
psql -d ocw -c "CREATE INDEX idx_organizations_name ON organizations USING gin (name gin_trgm_ops);"
Installation of the application server
We install the application layer on an Ubuntu 22.04 server.
Packages
Start by installing the underlying software packages, including PHP, Composer, Node.JS and Yarn.
sudo apt update
sudo apt -y upgrade
sudo apt install -y php8.1 php8.1-{cli,curl,fpm,common,pgsql,intl,xml,mbstring,zip,soap,gd,gmp}
sudo apt -y install composer
wget -qO- https://deb.nodesource.com/setup_16.x | sudo -E bash
sudo apt-get install -y nodejs
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install -y yarn
Application
sudo git clone https://github.com/OpenCarbonWatch/Website.git /srv/ocw
cd /srv/ocw
sudo cp .env.example .env
sudo composer install
sudo php artisan key:generate
Configure the .env
file (mostly with the connection information towards the database).
Install the application
sudo php artisan migrate
sudo yarn install
sudo yarn run prod
sudo chown -R www-data:www-data ocw
Nginx
Uninstall Apache and install Nginx
sudo systemctl disable --now apache2
sudo apt remove -y apache2
sudo apt install -y nginx
sudo systemctl start nginx
Create a configuration file /etc/nginx/sites-available/ocw
with the following content
server {
if ($host = opencarbonwatch.org) {
return 301 https://$host$request_uri;
}
listen 80;
server_name opencarbonwatch.org;
return 301 https://$host$request_uri;
}
server {
listen 443 ssl http2;
server_name opencarbonwatch.org;
client_max_body_size 100M;
gzip on;
gzip_types text/plain text/css application/javascript application/xml;
root /srv/ocw/public;
index index.php index.html index.htm index.nginx-debian.html;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
# Cache header
location ~* \.(?:css|js|svg|ico)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php/php8.1-fpm.sock;
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PHP_VALUE "memory_limit = 2G";
}
access_log /var/log/nginx/ocw_access.log;
}
Then run
sudo ln -s /etc/nginx/sites-available/ocw /etc/nginx/sites-enabled/
sudo rm /etc/nginx/sites-enabled/default
sudo systemctl restart nginx
sudo apt -y install certbot python3-certbot-nginx
sudo certbot
GitHub Events
Total
Last Year
Committers metadata
Last synced: 7 days ago
Total Commits: 139
Total Committers: 1
Avg Commits per committer: 139.0
Development Distribution Score (DDS): 0.0
Commits in past year: 0
Committers in past year: 0
Avg Commits per committer in past year: 0.0
Development Distribution Score (DDS) in past year: 0.0
Name | Commits | |
---|---|---|
Open Carbon Watch Admin | 5****n | 139 |
Committer domains:
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 1
Total pull requests: 27
Average time to close issues: N/A
Average time to close pull requests: 3 months
Total issue authors: 1
Total pull request authors: 1
Average comments per issue: 0.0
Average comments per pull request: 0.89
Merged pull request: 0
Bot issues: 0
Bot pull requests: 27
Past year issues: 0
Past year pull requests: 0
Past year average time to close issues: N/A
Past year average time to close pull requests: N/A
Past year issue authors: 0
Past year pull request authors: 0
Past year average comments per issue: 0
Past year average comments per pull request: 0
Past year merged pull request: 0
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- OpenCarbonWatchAdmin (1)
Top Pull Request Authors
- dependabot[bot] (27)
Top Issue Labels
- enhancement (1)
Top Pull Request Labels
- dependencies (27)
- javascript (21)
- php (6)
Dependencies
- @babel/core ^7.8.7 development
- @babel/plugin-proposal-class-properties ^7.8.3 development
- axios ^0.21.1 development
- bootstrap-scss ^4.4.1 development
- cross-env ^7.0.2 development
- css-loader ^5.2.2 development
- laravel-mix ^6.0.0 development
- laravel-mix-purgecss ^6.0.0 development
- postcss ^8.3.6 development
- resolve-url-loader ^3.1.1 development
- sass ^1.32.10 development
- sass-loader ^11.0.1 development
- vue ^2.6.12 development
- vue-loader ^15.9.6 development
- vue-template-compiler ^2.6.12 development
- webpack ^5.0.0 development
- 764 dependencies
- barryvdh/laravel-debugbar ^3.2 development
- facade/ignition ^2.0 development
- mockery/mockery ^1.0 development
- nunomaduro/collision ^4.1 development
- phpunit/phpunit ^9.0 development
- doctrine/dbal ^2.10
- erusev/parsedown ^1.7
- ext-gmp *
- ext-json *
- fideloper/proxy ^4.0
- laravel/framework ^7.0
- laravel/tinker ^2.0
- laravelcollective/html ^6.0
- mcamara/laravel-localization ^1.4.0
- php ^7.2
- vinkla/hashids ^8.1
- 106 dependencies
Score: 2.70805020110221