RPG Game APIs and Schemas
RPG schemas
RPG diagram
RPG Players-related
Column | Type | Description |
---|---|---|
id | INT | Primary key for the player |
username | VARCHAR(50) | The player's username |
password | VARCHAR(50) | The player's hashed password |
VARCHAR(50) | The player's email address |
Characters
Column | Type | Description |
---|---|---|
id | INT | Primary key for the character |
player_id | INT | Foreign key to Players.id |
name | VARCHAR(50) | The character's name |
appearance | VARCHAR(50) | The character's appearance details |
stats | JSON | The character's attributes and stats |
equipment | JSON | The character's current equipment |
Quests
Column | Type | Description |
---|---|---|
id | INT | Primary key for the quest |
player_id | INT | Foreign key to Players.id |
objectives | VARCHAR(50) | The quest's objectives |
rewards | VARCHAR(50) | The quest's rewards |
difficulty | INT | The quest's difficulty level |
Achievements
Column | Type | Description |
---|---|---|
id | INT | Primary key for the achievement |
player_id | INT | Foreign key to Players.id |
name | VARCHAR(50) | The achievement's name |
description | VARCHAR(50) | The achievement's description |
Skills
Column | Type | Description |
---|---|---|
id | INT | Primary key for the skill |
name | VARCHAR(50) | The name of the skill |
description | VARCHAR(50) | A brief description of the skill |
PlayerAchievements
Column | Type | Description |
---|---|---|
id | INT | Primary key for the achievement |
player_id | INT | Foreign key to Players.id |
achievement_id | INT | Foreign key to Achievements.id |
earned_at | DATETIME | The date and time the achievement was earned |
PlayerQuests
Column | Type | Description |
---|---|---|
id | INT | Primary key for the quest |
player_id | INT | Foreign key to Players.id |
quest_id | INT | Foreign key to Quests.id |
completed_at | DATETIME | The date and time the quest was completed |
PlayerSkills
Column | Type | Description |
---|---|---|
id | INT | Primary key for the skill |
player_id | INT | Foreign key to Players.id |
skill_id | INT | Foreign key to Skills.id |
acquired_at | DATETIME | The 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