Welcome to the back end repository for EverUse! EverUse is a web application built for the Turing School of Software and Design's Mod 4 Capstone project. Read more about project requirements:https://mod4.turing.edu/projects/capstone/
Table of Contents
Everuse partners with gyms, retailers, and manufacturers throughout the climbing industry to collect and upcycle used climbing rope into high-quality products. We aim to reduce waste, extend the lifespan of climbing rope, and minimize the environmental footprint of the climbing industry. By offering sustainable products, we strive to become the go-to brand for climbers who are passionate about both their sport and the planet. We aim to form partnerships and provide funding to organizations that are dedicated to maintaining access, restoration, and safety in climbing.
The back end application is an API built with the Rails framework and PostgreSQL database. It exposes one endpoint utilizing GraphQL /graphql
and is responsible for receiving requests, querying the internal database, and formatting JSON responses to send data to the front end application.
Website is available here
Github repositories:
Video Walkthrough of App:
everuse.mov
EverUse uses these integrations:
To demo EverUse on your local machine, follow these steps:
- Get a free SendGrid API key here
- Clone this repo
git@github.com:EverUse/EverUse-BE.git
- Navigate to the local repository:
cd EverUse-BE
- Run:
bundle install
- Run:
rails db:{create,migrate}
- Add
SENDGRID API_KEY
to rails application - Run:
rails s
to start Rails server - Visit: http://localhost:3000/
- Clone the front end here
- Follow instuctions in the front end repo
README
- ruby 3.2.2
- Rails Version 7.0.6
bundle exec rspec
will run the entire test suite. All tests passing at time of writing.
POST get all products/graphql
{
"data": {
"products": [
{
"category": "Jewelry",
"color": "moss",
"description": "Elevate your style with a touch of adventure and sustainability. Our upcycled climbing rope bracelets are not just accessories, but a statement of your commitment to the environment. Each bracelet we craft carries a piece of climbing history, woven into a unique design that captures the spirit of exploration. With a blend of colors and patterns, no two bracelets are alike. Please select from our rotating selection of available patterns.",
"id": "65",
"image": "https://live.staticflickr.com/65535/53141436793_15e6a62821.jpg",
"name": "bracelet",
"price": 15,
"quantity": 10,
"size": "small"
},
{
"category": "Jewelry",
"color": "moss",
"description": "Elevate your style with a touch of adventure and sustainability. Our upcycled climbing rope bracelets are not just accessories, but a statement of your commitment to the environment. Each bracelet we craft carries a piece of climbing history, woven into a unique design that captures the spirit of exploration. With a blend of colors and patterns, no two bracelets are alike. Please select from our rotating selection of available patterns.",
"id": "66",
"image": "https://live.staticflickr.com/65535/53141436793_15e6a62821.jpg",
"name": "bracelet",
"price": 15,
"quantity": 10,
"size": "medium"
},
...
{
"category": "Soft Goods",
"color": "lime",
"description": "Give your furry companion the ultimate adventure accessory – an upcycled climbing rope dog leash! Each leash is a blend of durability, style, and environmental responsibility. From city strolls to mountain hikes, it's a leash that stands up to the rigors of outdoor life while supporting your commitment to responsible consumption and conservation.",
"id": "96",
"image": "https://live.staticflickr.com/65535/53141442338_6cc0cceeed.jpg",
"name": "dogLeash",
"price": 30,
"quantity": 10,
"size": "onesize"
}
]
}
}
POST get products by attribute /graphql
{
"data": {
"product": [
{
"category": "Soft Goods",
"color": "moss",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "17",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "normal"
},
{
"category": "Soft Goods",
"color": "moss",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "18",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "slim"
},
{
"category": "Soft Goods",
"color": "orangePlaid",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "19",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "normal"
},
{
"category": "Soft Goods",
"color": "orangePlaid",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "20",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "slim"
},
{
"category": "Soft Goods",
"color": "bluePlaid",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "21",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "normal"
},
{
"category": "Soft Goods",
"color": "bluePlaid",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "22",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "slim"
},
{
"category": "Soft Goods",
"color": "lime",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "23",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "normal"
},
{
"category": "Soft Goods",
"color": "lime",
"description": "EverUse collects and upcycles used climbing rope into high-quality crafts and products. As two fellow rock climbers, we are passionate about both the sport and planet.",
"id": "24",
"image": "https://live.staticflickr.com/65535/53141175634_e2fc6ee6ee.jpg",
"name": "beerKoozie",
"price": 25,
"quantity": 10,
"size": "slim"
}
]
}
}
POST mutation to send email /graphql
{
"data": {
"createOrderForm": {
"message": "Hello #{customer}, your order submission was successful! An order request confirmation will be sent to #{email} shortly. If you don't receive that email please reach out to us at contact@everuseproducts.com"
}
}
}
As part of the Capstone project requirements, the EverUse backend team challenged ourselves to stretch technologies during the 14-day design and development process. We selected the following based on the challenges we anticipated facing while building out our MVP, and adjusted our choices to reflect our individual and team learning goals as well as blockers that came up during the course of working on the project.
- Challenge: An ecommerce site can have hundreds if not thousands of inventory items that vary by size, color, and more. And using REST APIs often means numerous API calls to request specific items based on specific conditions, which can result in unnecessary data transfer and decreased efficiency and performance.
- Solution: With GraphQL the frontend has the flexibility to fetch exactly the data they need from just one endpoint
/graphql
, reducing the number of network requests and improving performance. In total, we have provide three GraphQL operation responses to the frontend -- one query response with all products, one query to response with only products by a given attribute (such as name), and one mutation response to let the user know that an order request email submission was successful.
- Challenge: When a user on the frontend submits an order request form, it sends a post mutation query to the backend. The challenge here was to find an API that we could utilize to send emails to the customer to ensure that order details were received and that the company had a way to get in touch with the customer about their order.
- Solution: Twilio's Sendgrid email API along with ActionMailer allows us to send an email styled with HTML/CSS to the customer with the order details they filled out in their request form.
Additional features, functionality, and potential refactors:
- Future considerations for features include the potential to add an admin portal for the company to log in, manage orders and inventory, and directly fulfill orders.
- Additionally, implementing a payment solution that would allow the user to directly pay for the items through the app.
Distributed under the MIT License. See LICENSE.txt
for more information.