Skip to content

EverUse/EverUse-BE

Repository files navigation

Contributors Forks Stargazers Issues MIT License CircleCI


main page

EverUse

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
  1. About The Project
  2. Getting Started
  3. Testing
  4. DB Design
  5. Endpoints
  6. Technical Solutions
  7. Roadmap
  8. License
  9. Project Contributor Contact Info
  10. Acknowledgments

About The Project

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:

  • Front End: Github
  • Back End: Github

Video Walkthrough of App:

everuse.mov

(back to top)

Built With

  • Ruby
  • Rails
  • Postgres
  • Heroku
  • Circleci
  • Graphql
  • Twilio-Sendgrid
  • Postman
  • HTML
  • NewRelic

EverUse uses these integrations:

(back to top)

Getting Started

To demo EverUse on your local machine, follow these steps:

Back End Repository

  1. Get a free SendGrid API key here
  2. Clone this repo git@github.com:EverUse/EverUse-BE.git
  3. Navigate to the local repository: cd EverUse-BE
  4. Run: bundle install
  5. Run: rails db:{create,migrate}
  6. Add SENDGRID API_KEY to rails application
  7. Run: rails s to start Rails server
  8. Visit: http://localhost:3000/

Front End Repository

  1. Clone the front end here
  2. Follow instuctions in the front end repo README

Prerequisites

  • ruby 3.2.2
  • Rails Version 7.0.6

(back to top)

Testing

bundle exec rspec will run the entire test suite. All tests passing at time of writing.

(back to top)

DB Design

database design

(back to top)

Endpoints

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"
        }
    }
}

(back to top)

Technical Solutions:

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.

GraphQL

  • 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.

SendGrid

  • 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.

(back to top)

Roadmap

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.

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Project Contributor Contact Info

  • Ashley Plasket: Linkedin Github
  • Jimmy Jurado Linkedin Github
  • Alex Kiselich Linkedin Github

(back to top)

Acknowledgments

(back to top)

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •