Skip to content

In-The-Field/In_The_Field_BE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues CircleCI Status

In the Field

Alt text

About This Project

Important to Note

This is an SOA app and needs both this repo (back end) AND GitHub (front end) in order to be fully functioning.

Mod 4 Capstone Project

In the Field is a mushroom identification app. Designed for folks looking to explore, learn about, and identify mushrooms. In the Field has the ability for registered users to upload pictures from mushrooms they have found in the wild and get a list of probable matches complete with information about said mushroom. Users also have the ability to create their own field guide of mushrooms they have saved.

Purpose

The purpose of the backend for the In the Field app is to support the overall functionality and effectiveness of the platform. Here are some key purposes of the backend in relation to the project:

Data management: The backend serves as the central hub for storing, organizing, and managing the data associated with potential mushroom matches and data, and user profiles. It provides the necessary infrastructure and databases to efficiently handle the large volume of information generated by the app's users.

User-generated content management: The backend handles the uploading, storage, and retrieval of user-generated content. It ensures efficient data handling and metadata management.

Community interaction and engagement: The backend hopes to supports community-driven features, such as information sharing regarding found mushrooms, locations, uses, etc. Future features would enables users to interact with each other through comments, likes, and replies, fostering a sense of community and encouraging user engagement. The backend would ensures smooth communication and real-time updates within the app, enhancing the overall user experience.

Overall, the purpose of the backend in the In the Field app is to support seamless data management and community engagement. It plays a vital role in ensuring the app's functionality, security, and user satisfaction, ultimately enhancing the experience of those folks who love to get outside and learn about the natural world around them.

Built With

  • Ruby
  • GraphQL Badge
  • Postgresql
  • Render
  • Rails
  • Visual Studio Code
  • Postman Badge
  • CircleCI Badge

Running On

  • Rails 7.0.6
  • Ruby 3.2.2

Getting Started

To get a local copy, follow these simple instructions

Installation

  1. Fork the Project
  2. Clone the repo
git clone [email protected]:In-The-Field/In_The_Field_BE.git
  1. Install the gems
bundle install
  1. Create the database
rails db:{create,migrate,seed}
  1. Add Figaro
bundle exec figaro install
  1. Get API keys from Kindwise
    Kindwise

  2. Add your keys to your application.yml like this:

KINDWISE_API: <your_api_key_here>
  1. Create your Feature Branch
git checkout -b feature/AmazingFeature
  1. Commit your Changes
git commit -m 'Add some AmazingFeature' 
  1. Push to the Branch
git push origin feature/AmazingFeature
  1. Open a Pull Request

Endpoints Queries and Mutations Used

  • Endpoint
    
      POST /graphql
    
  

  • Queries

     

{ mushrooms(image: "base_64_encoded_image") { id probability psychoactive apiId commonName latinName edibility photo photoCitation characteristics { hymeniumType stipeCharacter sporePrintColor mushroomCapShape hymeniumAttachment mushroomEcologicalType } lookAlikes { name } taxonomies { genus order family phylum kingdom } description } }


  • Mutations

    

mutation{ saveUserMushrooms(input:{ userId: 13 mushroomId: 162 }) { userMushroom{ id isSaved } user{ id name email } mushroom { id commonName latinName apiId } } }


  • Response

    
  • List of Probable Matches

Success Response (200 OK) Status: 200 OK

{ "data": [
  {
    "id": "558fbb57c985b800",
    "name": "Boletus edulis",
    "probability": 0.5454445
      }
  ]
}

- Detail Description of a Mushroom

Success Response (200 OK)
Status: 200 OK
{
  "data": {
    "matches": [
      {
        "probability": 0.5454445,
        "psychoactive": false,
        "apiID": "558fbb57c985b800",
        "commoneName": "Cep",
        "latinName": "Boletus edulis",
        "edibility": "choice",
        "photo": "https://www.kindwise.com/api/v1/mushrooms/558fbb57c985b800/photo",
        "photoCitation": "https://www.kindwise.com/api/v1/mushrooms/558fbb57c985b800/photo/citation",
        "characteristicp": {
          "hymeniumType": "pores",
          "stipeCharacter": "bare",
          "sporePrintColor": "olive-brown",
          "mushroomCapShape": "convex",
          "hymeniumAttachment": "adnate",
          "mushroomEcologicalType": "mycorrhizal"
        },
        "lookAlikep": [],
        "taxonomyp": {
          "genus": "Boletus",
          "order": "Boletales",
          "family": "Boletaceae",
          "plylum": "Basidiomycota",
          "kingdom": "Fungi"
        },
        "description": {
          "value": "Boletus edulis blah blah blah blah"
        }
      }
    ]
  }
} 

Error Response (400 Bad Request): Status: 400 Bad Request

{
  "error":
  {
    "code": "BAD_REQUEST",
    "message": "Photo does not have high enough probability of being a mushroom"
  }
}
  • Save Mushroom to User's Collection

Success Response (200 OK) Status: 200 OK

{
  "data": {
    "saveUserMushrooms": {
      "userMushroom": {
        "id": "1",
        "isSaved": true
      },
      "user": {
        "id": "13",
        "name": "Test_1",
        "email": "[email protected]"
      },
      "mushroom": {
        "id": "162",
        "commonName": "Cep, King Bolete, Penny Bun, Porcini",
        "latinName": "Boletus edulis",
        "apiId": "558fbb57c985b800"
      }
    }
  }
}
  • Delete Mushroom

Schema

  create_table "users", force: :cascade do |t|
    t.string "name"
    t.string "email"
    t.datetime "created_at", null: false
    t.datetime "updated_at", null: false
  end

Contributing contributions welcome

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

API's Used

Kindwise

Authors

BackEnd Team

  • Julian Beldotti GitHub LinkedIn

  • Sarah Garlock GitHub LinkedIn

  • Matthew William Johnson GitHub LinkedIn

  • Crow Rising GitHub LinkedIn

FrontEnd Team

  • Elise Jones GitHub LinkedIn

  • Joshua Martin GitHub LinkedIn

  • Andrea Sorenson GitHub LinkedIn

Planning Tools

About

mod 4 capstone project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages