Skip to main content

RPG Game APIs and Schemas

RPG schemas

RPG diagram

ColumnTypeDescription
idINTPrimary key for the player
usernameVARCHAR(50)The player's username
passwordVARCHAR(50)The player's hashed password
emailVARCHAR(50)The player's email address

Characters

ColumnTypeDescription
idINTPrimary key for the character
player_idINTForeign key to Players.id
nameVARCHAR(50)The character's name
appearanceVARCHAR(50)The character's appearance details
statsJSONThe character's attributes and stats
equipmentJSONThe character's current equipment

Quests

ColumnTypeDescription
idINTPrimary key for the quest
player_idINTForeign key to Players.id
objectivesVARCHAR(50)The quest's objectives
rewardsVARCHAR(50)The quest's rewards
difficultyINTThe quest's difficulty level

Achievements

ColumnTypeDescription
idINTPrimary key for the achievement
player_idINTForeign key to Players.id
nameVARCHAR(50)The achievement's name
descriptionVARCHAR(50)The achievement's description

Skills

ColumnTypeDescription
idINTPrimary key for the skill
nameVARCHAR(50)The name of the skill
descriptionVARCHAR(50)A brief description of the skill

PlayerAchievements

ColumnTypeDescription
idINTPrimary key for the achievement
player_idINTForeign key to Players.id
achievement_idINTForeign key to Achievements.id
earned_atDATETIMEThe date and time the achievement was earned

PlayerQuests

ColumnTypeDescription
idINTPrimary key for the quest
player_idINTForeign key to Players.id
quest_idINTForeign key to Quests.id
completed_atDATETIMEThe date and time the quest was completed

PlayerSkills

ColumnTypeDescription
idINTPrimary key for the skill
player_idINTForeign key to Players.id
skill_idINTForeign key to Skills.id
acquired_atDATETIMEThe date and time the skill was acquired

API microservice

RPG Player Skills API service

Get all the skills of a character

  • Path: /characters/{character_id}/skills
  • Method: GET
  • Description: Returns a list of all the skills that the character with the specified ID has acquired, along with the date on which they were acquired.

Add a new skill to a character

  • Path: /characters/{character_id}/skills
  • Method: POST
  • Description: Adds a new skill to the character with the specified ID. The skill details (name, description, and acquired_at) are included in the request body as JSON.

Update a skill of a character

  • Path: /characters/{character_id}/skills/{skill_id}
  • Method: PUT
  • Description: Updates the details of a skill that the character with the specified ID has acquired. The skill details (name, description, and acquired_at) are included in the request body as JSON.

Delete a skill of a character

  • Path: /characters/{character_id}/skills/{skill_id}
  • Method: DELETE
  • Description: Deletes the specified skill from the character's list of acquired skills.

Get a list of all characters who have acquired a specific skill

  • Path: /skills/{skill_id}/characters
  • Method: GET
  • Description: Returns a list of all characters who have acquired the skill with the specified ID, along with the date on which they acquired it.
  • GET /characters - Retrieve a list of all characters
  • POST /characters - Create a new character
  • GET /characters/{id} - Retrieve a specific character by ID
  • PUT /characters/{id} - Update a specific character by ID
  • DELETE /characters/{id} - Delete a specific character by ID
  • GET /items - Retrieve a list of all items
  • POST /items - Create a new item
  • GET /items/{id} - Retrieve a specific item by ID
  • PUT /items/{id} - Update a specific item by ID
  • DELETE /items/{id} - Delete a specific item by ID
  • GET /quests - Retrieve a list of all quests
  • POST /quests - Create a new quest
  • GET /quests/{id} - Retrieve a specific quest by ID
  • PUT /quests/{id} - Update a specific quest by ID
  • DELETE /quests/{id} - Delete a specific quest by ID
  • GET /locations - Retrieve a list of all locations
  • POST /locations - Create a new location
  • GET /locations/{id} - Retrieve a specific location by ID
  • PUT /locations/{id} - Update a specific location by ID
  • DELETE /locations/{id} - Delete a specific location by ID
  • GET /npcs - Retrieve a list of all non-player characters
  • POST /npcs - Create a new non-player character
  • GET /npcs/{id} - Retrieve a specific non-player character by ID
  • PUT /npcs/{id} - Update a specific non-player character by ID
  • DELETE /npcs/{id} - Delete a specific non-player character by ID