This is an SOA app and needs both this repo (back end) AND (front end) in order to be fully functioning.
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.
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.
- Rails 7.0.6
- Ruby 3.2.2
To get a local copy, follow these simple instructions
- Fork the Project
- Clone the repo
git clone [email protected]:In-The-Field/In_The_Field_BE.git
- Install the gems
bundle install
- Create the database
rails db:{create,migrate,seed}
- Add Figaro
bundle exec figaro install
-
Get API keys from Kindwise
Kindwise -
Add your keys to your
application.yml
like this:
KINDWISE_API: <your_api_key_here>
- Create your Feature Branch
git checkout -b feature/AmazingFeature
- Commit your Changes
git commit -m 'Add some AmazingFeature'
- Push to the Branch
git push origin feature/AmazingFeature
- Open a Pull Request
- Endpoint
POST /graphql
{
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
}
}
mutation{ saveUserMushrooms(input:{ userId: 13 mushroomId: 162 }) { userMushroom{ id isSaved } user{ id name email } mushroom { id commonName latinName apiId } } }
- 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
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
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!