Welcome to the Epic-RPG Backend API documentation. This API is the backbone of an RPG game and allows you to perform various actions and interactions within the game.
- Introduction
- Getting Started
- Endpoints
- Database
- Authentication and Authorization
- Project Structure
- Contributing
The Epic-RPG Backend API is built using .NET 7 and C# Web API. It provides the functionality for managing user accounts, character creation and management, skills, weapons, and combat in the Epic-RPG game.
- .NET 7
- Entity Framework
- SQL Server or other compatible database
- Git
- Clone the repository:
git clone https://github.com/hafizmp/Epic-RPG-API.git
-
Navigate to the project directory and set up the database connection string.
-
Run the following command to create the database and apply migrations:
dotnet ef database update
- Start the API:
dotnet watch run
The API will be accessible at http://localhost:5200/
- POST
/api/Auth/Register
: User registration. - POST
/api/Auth/Login
: User login to obtain a JWT token.
- GET
/api/Character/GetAll
: Get all characters. - GET
/api/Character/{id}
: Get a specific character. - DELETE
/api/Character/{id}
: Delete a specific character. - POST
/api/Character
: Create a new character. - PUT
/api/Character
: Update a character. - POST
/api/Character/Skill
: Manage skills for a character.
- POST
/api/Fight/Weapon
: Use a weapon during a fight. - POST
/api/Fight/Skill
: Use a skill during a fight. - POST
/api/Fight
: Begin a fight. - GET
/api/Fight
: Get information about an ongoing fight.
- POST
/api/Weapon
: Create a new weapon.
The API uses Entity Framework to manage the following entities and their relationships:
- Users
- Characters
- Skills
- Weapons
The database is seeded with initial data to demonstrate the API's functionality.
This API uses JWT for authentication and authorization.
Users can register using the /api/Auth/Register
endpoint.
Users can obtain an access token by logging in via the /api/Auth/Login
endpoint.
EpicRPG.API
: The main API project.EpicRPG.Data
: Data models and Entity Framework setup.EpicRPG.Services
: Business logic and services.EpicRPG.Auth
: Authentication services.EpicRPG.DTOs
: Data transfer objects.EpicRPG.Controllers
: API controllers.
Here are some of the key commits that contributed to the development of the API:
- Find commits by clicking here - Epic-RPG-API commits
Feel free to contribute to the development of Epic-RPG-API by submitting pull requests or reporting issues.