Skip to content

alexGrandolph/be_puptrainer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to the PupTrainer Back-End Application!

Table of Contents


Intro

This application is the back-end repository for PupTrainer , the front-end repository can be found HERE . The back-end application was built with a Ruby on Rails API using GraphQL. The front-end application was built with React using GraphQL. The back-end is also deployed to Heroku, and can be found HERE


Getting Started

This app uses Ruby version 2.7.2 and Rails version 5.2.8. To access the endpoints via localhost please ensure you have both of these versions installed locally. Clone the repo down to your machine. In your command line run `bundle install` next run `rails db:create` then `rails db:seed`. after that running `rails s` should start your local server (port 3000), and the endpoints will be available at localhost:3000/graphql. If you run into any issues, run `rails db:reset` then try `rails s` again. In your browser, if you visit localhost3000/graphiql, GraphQL's in-browser GUI will allow you to enter the queries and mutations and see the response.

Database

Our PostgreSQL database consists of four different tables. A Users table, a Dogs table, a DogSkills, and a DogSkills joins table. The Users table has columns for unique username, unique email, and timestamps. The Dogs table has columns for name, age, breed, and timestamps. A User can have many Dogs and a Dog belongs to a User. The Skills table has columns for level, name, description, criteria, youtube_link, and timestamps. A Dog can have many Skills through DogSkills, and Skills can have many Dogs through DogSkills.

Queries

All Queries can return any of the shown fields, or if the fields are not needed in the response, simply do not include them in the request. Our queries are set up to allow for any relationships to be returned in the response.

Fetch User by User ID

The fetchUser query can be sent with a user ID as an argument.


Fetch User by Email

The fetchUser query can also be sent with a user's email as an argument.


Fetch Dog

The fetchDog query takes an argument of a Dog's ID


Fetch Skill

The fetchSkill query takes an argument of a Skill's ID


Fetch Skills

The fetchSkils query returns all Skills in the database


Mutations

All Mutations can also return any of the shown fields, or if the fields are not needed in the response, simply do not include them in the request. Our Mutations are set up to allow for any relationships to be returned in the response.


Create User

The createUser mutation requires a unique email and a unique username. If a user already exists with the given email and username, the request will return that original user. The request can also include a users dogs and dog skills if put into the request.


Create Dog

The createDog mutation requires a name, age, and breed, all of which will be returned in the response. If the request includes a User and their attributes, those attributes will also come back in the response.


Add Dog Skill

The addDogSkill mutations takes three arguments, dogId, skillId, and passed. Passed should be set as false. This mutation is to add a skill to an individual dog, so the user can start the training process. The response includes all DogSKill attributes.


Pass Dog Skill

The passDogSkill mutation is used when a dog has 'passed' the skill given. The request takes two arguments, Dog ID and Skill ID. The response includes the dogSkill ID, the Dog's ID, and the Skill's ID


Tech


Ruby on Rails Ruby PostgreSQL GraphQL Git

🛠   Tools


Heroku Visual Studio Code Markdown Postman Slack

The Team ✨

Thanks go to these wonderful people (emoji key):


Joesph S. (he/him)


💻 ⚠️ 👀

Alex P. (he/him)


💻 ⚠️ 👀

Alex R. (he/him)


💻 ⚠️ 👀

Alicia W. (she/her)


💻 ⚠️ 👀

This project follows the all-contributors specification.

About

The back end repo for PupTrainer

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 99.6%
  • Other 0.4%