This application acts as a companion for the tabletop rpg game: Star Wars: Edge of the Empire. The companion app allows you to keep track of and store your in-game characters. You may also connect and communicate with your friends and party up so that everyone can witness the dice rolls that will unfold the story in their legendary campaign.
This is the backend repository that is responsible for sending API responses to our frontend application.
- User may create a new character that contains their information, characteristics, features
- Dice rolls can be be configured with actual dice animation
- All of your characters can be seen in one place
- Ruby 2.7.2
- Rails 5.2.6
Testing: factory-bot_rails, faker, pry, shoulda-matchers, simplecov
GRAPHQL API: graphql, graphiql-rails, rack-cors
These instructions will give you a copy of the project up and running on your local machine for development and testing purposes.
- Fork and Clone the repo
- Install gem packages:
bundle install
- Setup the database:
rails db:create
- Run migrations:
rails db:migrate
Our GraphQL endpoints fall into three categories: queries, mutations, and filter queries.
To make live queries to the GraphQL endpoint and see live schema information, setup the back-end by running rails s
in the terminal and access GraphiQL at http://localhost:3001/graphiql. Use the screenshots as reference when formatting your queries and compare against the expected response.
Enpoints
finds specific character in database by id.
query{
character(id: 1) {
age
build
career
eyes
hair
height
id
name
specialization
species
}
{
"data": {
"character": {
"age": 15,
"build": "Ezra Legros",
"career": "Shonna Gleichner",
"eyes": "Roxann Murray",
"hair": "Rudolf Goyette II",
"height": "Jaleesa Mann",
"id": "1",
"name": "Gov. Sook Kuhlman",
"specialization": "Ellsworth Powlowski",
"species": ""Larhonda Dietrich"
}
finds specific user in database by id.
query{
user(id: 1) {
username
}
{
"data": {
"user": {
"username": "Boops McGoops"
}
}
}
finds skills specific to character
query{
skill(characterId: 1) {
astrogation
athletics
brawl
charm
coercion
computers
cool
coordination
coreWorlds
deception
discipline
education
gunnery
id
leadership
lore
mechanics
medicine
melee
negotiation
outerRim
perception
piloting
pilotingSpace
rangedHeavy
rangedLight
resilience
skulduggery
stealth
streetWise
survival
underworld
vigilance
xenology
}
}
{
"data": {
"skill": {
"astrogation": 3,
"athletics": 3,
"brawl": 4,
"charm": 4,
"coercion": 3,
"computers": 4,
"cool": 2,
"coordination": 5,
"coreWorlds": 2,
"deception": 5,
"discipline": 2,
"education": 2,
"gunnery": 3,
"id": "1",
"leadership": 4,
"lore": 4,
"mechanics": 5,
"medicine": 2,
"melee": 5,
"negotiation": 2,
"outerRim": 1,
"perception": 3,
"piloting": 1,
"pilotingSpace": 5,
"rangedHeavy": 2,
"rangedLight": 5,
"resilience": 5,
"skulduggery": 3,
"stealth": 4,
"streetWise": 2,
"survival": 1,
"underworld": 1,
"vigilance": 5,
"xenology": 3
}
}
}
finds motivation specific to character
query {
motivation(characterId: 1){
moType
}
}
{
"data": {
"motivation": {
"moType": "Dung Bartoletti"
}
}
finds obligations specific to character
query{
obligation(characterId: 1){
obType
magnitude
}
}
{
"data": {
"obligation": {
"obType": "sturdy",
"magnitude": 5
}
}
}
finds equipment logs specific to character
query{
equipmentLog(characterId: 1){
credits
weapons
armor
personalGear
}
}
{
"data": {
"equipmentLog": {
"credits": "Christia Kessler",
"weapons": "Veta Collier DDS",
"armor": "Nakia McDermott",
"personalGear": "Hoa Kuhic"
}
}
}
finds critical injuries specific to character
query {
criticalInjury(characterId: 1){
severity
result
}
}
{
"data": {
"criticalInjury": {
"severity": 5,
"result": "Antone Carroll"
}
}
}
finds talents specific to character
query{
talent(characterId: 1){
name
pageNumber
abilitySummary
}
}
{
"data": {
"talent": {
"name": "Sid Kessler",
"pageNumber": 3,
"abilitySummary": "Rocco Bernhard"
}
}
finds weapons specific to character
query{
weapon(characterId: 1){
skill
special
damage
range
critical
}
}
{
"data": {
"weapon": {
"skill": "Jose Thiel",
"special": "Ms. Angel Thiel",
"damage": 1,
"range": 5,
"critical": 4
}
}
}
finds all of the characters for a user by user id.
query{
user(id: 1) {
username
characters {
age
build
career
eyes
hair
height
id
name
specialization
species
}
}
}
{
"data": {
"user": {
"username": "Prof. Rosalyn Rodriguez",
"characters": [
{
"age": 80,
"build": "Cruz Renner",
"career": "Libby Gorczany DO",
"eyes": "Milford Daniel DC",
"hair": "Belkis Quitzon DC",
"height": "Lynda Abbott",
"id": "1",
"name": "Jack Cummings",
"specialization": "Sara Hudson",
"species": "Rev. Manual Hackett"
},
{
"age": 83,
"build": "Mimi Toy",
"career": "Dennis Prohaska II",
"eyes": "Marcelle Lubowitz III",
"hair": "Collette Bartell LLD",
"height": "Roxann Kilback",
"id": "2",
"name": "Meda Miller",
"specialization": "Dr. Jasmin Bailey",
"species": "Guadalupe Fritsch"
},
{
"age": 17,
"build": "Shiela Nader",
"career": "Alexis Legros",
"eyes": "Katelynn Braun DC",
"hair": "Andrea Stiedemann",
"height": "Jaunita Effertz",
"id": "3",
"name": "Randy Russel",
"specialization": "Renato Heaney",
"species": "Ray Larkin"
},
{
"age": 80,
"build": "Robin Ritchie",
"career": "Trinidad West",
"eyes": "Debera McLaughlin",
"hair": "Corey Wolff",
"height": "Isreal Kunze",
"id": "4",
"name": "Hector Thiel",
"specialization": "Jalisa Gutmann DVM",
"species": "Monty Corkery"
},
{
"age": 87,
"build": "Carlos Quigley",
"career": "Msgr. Leota Nitzsche",
"eyes": "Everett Ernser",
"hair": "Ayesha O'Reilly",
"height": "Rosetta Armstrong",
"id": "5",
"name": "Marianne Gislason JD",
"specialization": "Clarence Upton IV",
"species": "Kera Funk"
}
]
}
}
}
creates new character in database.
mutation {
createCharacter(
input:{
userID: "1"
name: "Boops McGoops"
age: 47
build: "small but mighty"
career: "bounty hunter"
eyes: "yellow"
hair: "magenta"
height: "4ft 3in"
species: "cool alien"
specialization: "assasin"
}) {
age
build
career
eyes
hair
height
id
name
specialization
species
}
}
{
"data": {
"character": {
"age": 47,
"build": "small but mighty",
"career": "bounty hunter"
"eyes": "yellow"
"hair": "magenta"
"height": "4ft 3in"
"id": "6"
"name": "Boops McGoops"
"specialization": "assassin"
"species": "cool alien"
}
}
}
creates new characteristics for a given character in database.
mutation {
createCharacteristic(
input:{
agility: 2
brawn: 2
characterId: 2
charPresence: 2
cunning: 2
intellect: 2
willpower: 3
}) {
agility
brawn
characterId
charPresence
cunning
id
intellect
willpower
}
}
{
"data": {
"characteristic": {
"agility": 2
"brawn": 2
"characterId": 2
"charPresence": 2
"cunning": 2
"id": "6"
"intellect": 2
"willpower": 3
}
}
}
creates new skillset for given character in datasbase.
mutation {
createSkill(
input:{
characterId: 1
astrogation: 1
athletics: 1
brawl: 1
charm: 1
coercion: 1
computers: 1
cool: 1
coordination: 1
coreWorlds: 1
deception: 1
discipline: 1
education: 1
gunnery: 1
leadership: 1
lore: 1
mechanics: 1
medicine: 1
melee: 4
negotiation: 1
outerRim: 1
perception: 1
piloting: 1
pilotingSpace: 1
rangedHeavy: 2
rangedLight: 3
resilience: 4
skulduggery: 5
stealth: 2
streetWise: 2
survival: 1
underworld: 1
vigilance: 1
xenology: 1
}) {
astrogation
athletics
brawl
charm
coercion
computers
cool
coordination
coreWorlds
deception
discipline
education
gunnery
id
leadership
lore
mechanics
medicine
melee
negotiation
outerRim
perception
piloting
pilotingSpace
rangedHeavy
rangedLight
resilience
skulduggery
stealth
streetWise
survival
underworld
vigilance
xenology
}
}
{
"data": {
"skill": {
"astrogation": 1,
"athletics": 1,
"brawl": 1,
"charm": 1,
"coercion": 1,
"computers": 1,
"cool": 1,
"coordination": 1,
"coreWorlds": 1,
"deception": 1,
"discipline": 1,
"education": 1,
"gunnery": 1,
"id": "9",
"leadership": 1,
"lore": 1,
"mechanics": 1,
"medicine": 1,
"melee": 4,
"negotiation": 1,
"outerRim": 1,
"perception": 1,
"piloting": 1,
"pilotingSpace": 1,
"rangedHeavy": 2,
"rangedLight": 3,
"resilience": 4,
"skulduggery": 5,
"stealth": 2,
"streetWise": 2,
"survival": 1,
"underworld": 1,
"vigilance": 1,
"xenology": 1
}
}
}
creates new weapon for a given character in database.
mutation {
createWeapon(
input:{
characterId: 2
skill: "charm"
special: "betrayal"
damage: 10
range: 3
critical: 12
}) {
skill
special
damage
range
critical
}
}
{
"data": {
"createWeapon": {
"skill": "charm",
"special": "betrayal",
"damage": 10,
"range": 3,
"critical": 12
}
}
}
creates new critical injury for a given character in database.
mutation {
createCriticalInjury(
input: {
characterId: 2
severity: 1
result: "damaged"
}) {
severity
result
}
}
{
"data": {
"createCriticalInjury": {
"severity": 1,
"result": "damaged"
}
}
}
updates any/all of the skills for a specified character.
mutation {
updateSkill(input: {
astrogation: 5,
athletics: 5,
brawl: 5,
characterId: 1,
charm: 5,
coercion: 5,
computers: 5,
cool: 5,
coordination: 5,
coreWorlds: 5,
deception: 5,
discipline: 5,
education: 5,
gunnery: 5,
id: 1,
leadership: 5,
lore: 5,
mechanics: 5,
medicine: 5,
melee: 5,
negotiation: 5,
outerRim: 5,
perception: 5,
piloting: 5,
pilotingSpace: 5,
rangedHeavy: 5,
rangedLight: 5,
resilience: 5,
skulduggery: 5,
stealth: 5,
streetWise: 5,
survival: 5,
underworld: 5,
vigilance: 5,
xenology: 5
}) {
astrogation
athletics
brawl
characterId
charm
coercion
computers
cool
coordination
coreWorlds
deception
discipline
education
gunnery
id
leadership
lore
mechanics
medicine
melee
negotiation
outerRim
perception
piloting
pilotingSpace
rangedHeavy
rangedLight
resilience
skulduggery
stealth
streetWise
survival
underworld
vigilance
xenology
}
}
{
"data": {
"updateSkill": {
"astrogation": 5,
"athletics": 5,
"brawl": 5,
"characterId": 1,
"charm": 5,
"coercion": 5,
"computers": 5,
"cool": 5,
"coordination": 5,
"coreWorlds": 5,
"deception": 5,
"discipline": 5,
"education": 5,
"gunnery": 5,
"id": "1",
"leadership": 5,
"lore": 5,
"mechanics": 5,
"medicine": 5,
"melee": 5,
"negotiation": 5,
"outerRim": 5,
"perception": 5,
"piloting": 5,
"pilotingSpace": 5,
"rangedHeavy": 5,
"rangedLight": 5,
"resilience": 5,
"skulduggery": 5,
"stealth": 5,
"streetWise": 5,
"survival": 5,
"underworld": 5,
"vigilance": 5,
"xenology": 5
}
}
}