Skip to content

dpackaz/gamifying-giving

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GivDex, the Charity Index

Description

This application is meant to make it easier for people to donate to charitable causes by providing them with a place where they can keep track of their favorite charities and see what charities their friends support

License: MIT

Table of Contents

Overview of the application

Technologies Used

Front end:

  • HTML / CSS / JavaScript
  • Fetch / AJAX
  • Pledge API
  • Bootstrap
  • Local Storage
  • AM Maps

Back End:

  • GraphQL
  • Apollo
  • Node
  • NPM
  • Express
  • MongoDB
  • Mongoose
  • JWT

Code Snippets

The following code snippet demonstrates key data that is retrieved from our local database and the Pledge API through our Users Query.

export const QUERY_USERS = gql`
  query users {
    firstName
    lastName
    email
    password
    friends {
      firstName
      lastName
    }
    charities {
      address
      causes
      charityID
      logo_Url
      mission
      name
      pledge_Url
      website_Url
    }
  }
`;

This next snippet displays the client-side event listener that calls the Pledge API to return the charity data.

if (!data.charity) {
      fetch("https://api.pledge.to/v1/organizations/" + orgId, {
        method: "GET",
        mode: "cors",
        headers: {
          Authorization: "Bearer " + process.env.PLEDGE_API_KEY,
        },
      })
        .then((response) => {
          console.log(response);
          if (response.ok) {
            response.then((json) => {
              let charityResponse = {
                address: json.street1 + ", " + json.city + " " + json.region,
                causes: [],
                charityID: json.id,
                logo_url: json.logo_url,
                mission: json.mission,
                name: json.name,
                pledge_Url: json.website_url,
              };
              setCharity(charityResponse);
              console.log(charityResponse);
            });
          } else {
            console.log("Error with request");
          }

Usage

Simply visit the site using the following link!

GivDex

How to Contribute to This Repository:

Contact one of us via email

Questions

If you have any questions about this project, feel free to reach out to one of us at:

[email protected]
[email protected]
[email protected]
[email protected]

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •