Refuge refuge logo

Step into a realm of hope and connection with Refuge! Inspired by the global effort to support displaced communities, this platform is crafted for those who aspire to bridge gaps and foster unity. Bringing together aid providers and seekers, Refuge stands as a testament to the power of solidarity in challenging times.

Refuge - AidConnect/RefugeeAid emerges as a platform addressing the challenge of efficiently connecting aid workers and compassionate citizens with refugee camps or organizations. It ensures that assistance meets the refugees, asylees, and migrants' current and specific needs in an engaging, real-time feed. This initiative is a Capstone Project made in October, 2023 at the Turing School of Software and Design.

This repository is the Backend API. You can view the Frontend application's repository here and interact with a live demo here.

📋 Table of Contents

🔨 Installation

Install all necessary gem files:

bundle install

Create, migrate, and seed the PostgresQL database:

bundle exec rails db:{create,migrate,seed}

Run the test suite to verify that everything works:

bundle exec rspec

✍️ GraphQL Queries

organization

Returns details from a single Organization using its unique id.

✍️ Example Query 🧩 Example Variables
query ($id: ID!) {
  organization(id: $id) {
    id
    name
    contactPhone
    contactEmail
    streetAddress
    website
    city
    state
    zip
    latitude
    longitude
    shareAddress
    sharePhone
    shareEmail
    aidRequests {
      id
      organizationId
      aidType
      language
      description
      status
    }
  }
}
{
  "id": 2
}
📦 Example Response
🟢 Status 200 : Successful Response
{
  "data": {
    "organization": {
      "id": "2",
      "name": "Dream Safe Haven",
      "contactPhone": "1-676-635-1273",
      "contactEmail": "breann.erdman@watsica-durgan.example",
      "streetAddress": "85946 Miller Burg",
      "website": "http://heaney.test/almeta",
      "city": "Philadelphia",
      "state": "PA",
      "zip": "07501-9726",
      "latitude": 40.16353072947562,
      "longitude": -75.29320837398994,
      "shareAddress": true,
      "sharePhone": true,
      "shareEmail": true,
      "aidRequests": [
        {
          "id": "393",
          "organizationId": 2,
          "aidType": "language",
          "language": "Javanese",
          "description": "Dolorem vero maxime quisquam.",
          "status": "pending"
        },
        {
          "id": "891",
          "organizationId": 2,
          "aidType": "legal",
          "language": "Tagalog",
          "description": "Quo et voluptas amet.",
          "status": "active"
        },
        {
          "id": "1006",
          "organizationId": 2,
          "aidType": "language",
          "language": "Romanian",
          "description": "Ea ut qui quos.",
          "status": "active"
        },
        {
          "id": "2350",
          "organizationId": 2,
          "aidType": "medical",
          "language": "Tagalog",
          "description": "Molestiae cumque quisquam quis.",
          "status": "active"
        }
      ]
    }
  }
}

organizations

Returns all organizations operating within the provided city and state.

✍️ Example Query 🧩 Example Variables
query ($city: String!, $state: String!) {
  organizations(city: $city, state: $state) {
    id
    name
    city
    state
    website
    aidRequests {
      id
      aidType
      language
      description
      status
    }
  }
}
{
  "city": "Denver",
  "state": "CO"
}
📦 Example Response
🟢 Status 200 : Successful Response
{
  "data": {
    "organizations": [
      {
        "id": "63",
        "name": "Emerald Oasis Shelter",
        "city": "Denver",
        "state": "CO",
        "website": "http://kub-larkin.test/ramon",
        "aidRequests": [
          {
            "id": "2181",
            "aidType": "other",
            "language": "Hindi",
            "description": "Labore dignissimos deleniti nam.",
            "status": "pending"
          }
        ]
      },
      {
        "id": "97",
        "name": "Life Renewal Refuge",
        "city": "Denver",
        "state": "CO",
        "website": "http://stroman-paucek.example/claudette",
        "aidRequests": [
          {
            "id": "281",
            "aidType": "other",
            "language": "Romanian",
            "description": "Culpa voluptas dolor accusantium.",
            "status": "pending"
          },
          {
            "id": "1333",
            "aidType": "legal",
            "language": "Marathi",
            "description": "Voluptatibus et consequatur laudantium.",
            "status": "active"
          },
          {
            "id": "1527",
            "aidType": "legal",
            "language": "Tagalog",
            "description": "Eos earum nihil commodi.",
            "status": "fulfilled"
          },
          {
            "id": "2993",
            "aidType": "language",
            "language": "Arabic",
            "description": "Modi dolores enim molestiae.",
            "status": "fulfilled"
          }
        ]
      },
      ...
    ]
  }
}

aidRequests

Returns all aidRequests from a provided city and state.

Examples

✍️ Example Query 🧩 Example Variables
query ($city: String!, $state: String!) {
  aidRequests(city: $city, state: $state) {
    id
    aidType
    language
    description
    status
    organization {
      name
      city
      state
    }
  }
}
{
  "city": "Denver",
  "state": "CO"
}
📦 Example Response
🟢 Status 200 : Successful Response
{
  "data": {
    "aidRequests": [
      {
        "id": "2181",
        "aidType": "other",
        "language": "Hindi",
        "description": "Labore dignissimos deleniti nam.",
        "status": "pending",
        "organization": {
          "name": "Emerald Oasis Shelter",
          "city": "Denver",
          "state": "CO"
        }
      },
      {
        "id": "281",
        "aidType": "other",
        "language": "Romanian",
        "description": "Culpa voluptas dolor accusantium.",
        "status": "pending",
        "organization": {
          "name": "Life Renewal Refuge",
          "city": "Denver",
          "state": "CO"
        }
      },
      {
        "id": "1333",
        "aidType": "legal",
        "language": "Marathi",
        "description": "Voluptatibus et consequatur laudantium.",
        "status": "active",
        "organization": {
          "name": "Life Renewal Refuge",
          "city": "Denver",
          "state": "CO"
        }
      },
      ...
    ]
  }
}

Types

Types Description
Organization The entity requesting aid.
AidRequest The aid an organization is requesting.

Organization

type Organization {
  id: ID!
  name: String
  contactEmail: String
  contactPhone: String
  website: String
  streetAddress: String
  city: String
  state: String
  zip: String
  latitude: Float
  longitude: Float
  shareAddress: Boolean
  shareEmail: Boolean
  sharePhone: Boolean
  aidRequests: [AidRequest]
}

AidRequest

type AidRequest {
  id: ID!
  organizationId: Integer
  aidType: String
  language: String
  description: String
  status: String
  organization: Organization!
}

🧑‍🤝‍🧑 Authors

Refugee Aid is a student project built in October, 2023 for the Backend Program of the Turing School of Software and Design.

Ethan Black - Back-End Developer LinkedIn || GitHub
GitHub Avatar for Ethan Black
Artemy Gibson - Back-End Developer LinkedIn || GitHub
GitHub Avatar for Artemy Gibson
Davis Weimer - Back-End Developer LinkedIn || GitHub
GitHub Avatar for Davis Weimer
Renee Pinna - Front-End Developer LinkedIn || GitHub
GitHub Avatar for Renee Pinna
Parvin A. Sattorova - Front-End Developer LinkedIn || GitHub
GitHub Avatar