Giter Club home page Giter Club logo

Litter Map

Humanity’s calling for the next hundred years is restoring natural beauty to Mother Earth. We believe that the planet is more of a being to be in communion with, rather than a resource to be extracted. To assist in this mission, we are providing a platform to help with global pollution and litter cleanup. This work belongs to the future of the human race, and therefore, we are using technology to provide community support for the cleanup effort. Its host of features is not just valuable to our users, but also to the planet itself.

Mission

We are advancing humanity’s mission of waste and plastic-pollution cleanup for the protection of Nature from harm and to improve the lives of human and non-human inhabitants. We provide a hub for the mission of cleaning up the planet for many different individuals and organizations, and we aim to be the ultimate resource and center of the cleanup effort.

Background

We are a team of deeply devoted environmentalists who have a passion for restoring natural beauty. The planet is our common home, we borrow it from our children, and we inherit it from our parents. Caring for our common home with all living things will call forth into the future a life with less war, famine, destruction, climate disaster, hate, and division.

Community

Software development live sessions happen on discord https://discord.gg/JvEQMSQaYr.

Litter Map is also a registered nonprofit organization with open board meetings on discord.

Technical Documentation

Web front-end for the Litter Map application.

Technologies

Get started

Set up the configuration file:

  • cp config-example.json config.json

Edit config.json and fill in necessary details.

Install the pnpm package manager for managing dependencies and running development scripts.

Install dependencies:

  • pnpm i

You can run a quick basic check on the configuration file with:

  • pnpm check-config

Build the app:

  • pnpm build

Start local server:

  • pnpm serve

In a separate terminal, start the proxy that combines the front-end and back-end services under one host URL:

  • pnpm proxy

The app should now be available at http://localhost:9999

If your browser complains about the self-signed SSL certificate, just bypass that warning.

Development

Build and then monitor source files for changes, which automatically trigger a rebuild:

  • pnpm watch

Dependencies

Install them with pnpm and just import them in the scripts. The build system is going to automatically roll everything into a self-contained bundle and insert it into the end product.

To check if new versions of packages exist:

  • pnpm outdated

To update the dependencies to the newest versions:

  • pnpm up --latest

Local testing

Use ngrok as an internet HTTPS proxy to the local HTTP proxy started with pnpm proxy for HTTPS support:

  • ngrok http 9999

For example, certain browsers may silently refuse to perform geolocation in an insecure context.

For Google Sign-in to work, the OAuth URL will need to be white-listed in the Google OAuth client profile settings (see backend documentation).

Testing on an Android device while serving from another machine

While the website can be loaded from another machine serving it over a network, Google Sign-in will refuse to log you in if the redirect URL is not from an approved domain. Google OAuth will refuse to white-list a local IP, so the solution is to specify localhost as the redirect target (which it does accept) and then to use a local forwarding proxy to fetch the website over the network.

  • Install termux from the F-Droid repository
  • Run pkg install nodejs openssl-tool
  • Run npm i -g https-proxy-cli
  • Run https-proxy -p 9999 -t https://<IP-OF-SERVER-MACHINE>:9999
  • Load website via https://localhost:9999

Tips

Check which packages depend on a node package:

  • pnpm ll --depth 999 <package>

Known issues

  • Firefox currently has a bug which prevents source maps from working for scripts inlined inside the HTML document

Caveats

  • The final JS and CSS from the build process are injected into the HTML after it is built from the Pug source. The project is at the moment using an experimental update to the gulp-inject plugin for gulp to do it. See: klei/gulp-inject#279

  • Since Windows uses back slashes (\) as path separators (which can be traced to a decision made in MS-DOS 2.0), the build script might need significant modifications to its path handling in order to run properly on Windows

Knowledge resources

General

User interface

Google Maps API

Build system

The build tasks are orchestrated with Gulp, which takes knowledge to master but enables a high level of flexibility and performance with a concise formulation.

License

Copyright (C) Litter Map contributors (see AUTHORS.md)

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see https://www.gnu.org/licenses/.

littermap's Projects

littermap icon littermap

Report litter on a global map -- (Join us on: https://discord.gg/JvEQMSQaYr)

littermap-aws-backend icon littermap-aws-backend

Cloud-native backend for the Litter Map application -- (Join us on: https://discord.gg/JvEQMSQaYr)

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.