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