DEV Community

Curious Paul
Curious Paul

Posted on

Making The Earth Greener With Project Gaia

Overview

The Gaia project aims to help in the fight against global warming and deteriorating climate conditions; to help make the world "greener" and safer, by making it easier to engage "green" projects and foster growth for every project.

The platform aggregates a list of projects directly involved with making a Earth "greener", and allows users to donate to the cause of a project that they find interesting or believe in.

Gaia projects section

NGOs and other organisations with "green" projects can apply to create an account on Gaia, and raise the funding that they need to complete their project(s) in due time. This way we can help raise awareness about climate change, and make it easier for the average individual to be involved.

How We Built Gaia

We wanted Gaia to be user friendly, and easily accessible so some design considerations had to be taken into account from the beginning, before we even started writing code.

  • Once we had a user-interface we all agreed with, work commenced on the frontend interface for which the ReactJs web framwork was used.
  • The backend was written in python using the Flask web framework.
  • User data, and projects' information were stored on a serverless instance via MongoDB atlas. We employed the use of MongoDB's very famous python client library (with its rich documentation) - "PyMongo" to interact with the serverless instance of the MongoDB database. For example, with PyMongo, we could "seed" data into the database instance as follows:
projects = []
for card in cards_:
    project_url = requests.get(card.find('h3').find('a')['href']).text
    project_page = BeautifulSoup(project_url, 'html.parser')
    try:
        obj_ = {
            '_id':str(uuid.uuid4()),
            'project_headline': project_page.find('main').find('p').string,
            'paypal_value': card.find('form').find('input', attrs={'name': 'hosted_button_id'})['value'],
            "project_url": card.find('h3').find('a')['href'],
            "name": card.find('h3').find('a').string,
            "image_url": card.find('img')['src'],
            "paypal_url": card.find('form').get_attribute_list('action')[0]
        }
        db.project.insert_one(obj_)
        projects.append(obj_)
    except Exception:
        print(card, end="Has issue!")
Enter fullscreen mode Exit fullscreen mode

Submission Category:

"Custom Adventure"

Link to Code

Screenshots/demo

Gaia project page

Gaia projects section

Collaborators

Top comments (0)