Skip to content

This repository houses the Epic-RPG Backend API, a feature-rich web API built with .NET 7 and C#. It powers the Epic-RPG game, allowing users to manage characters, skills, weapons, and engage in epic battles. Explore a robust set of endpoints for game management.

Notifications You must be signed in to change notification settings

hafizn07/Epic-RPG-API

Repository files navigation

Epic-RPG Backend API Documentation

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.

Epic-RPG Logo

Table of Contents

  1. Introduction
  2. Getting Started
  3. Endpoints
  4. Database
  5. Authentication and Authorization
  6. Project Structure
  7. Contributing

Introduction

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.

Getting Started

Prerequisites

  • .NET 7
  • Entity Framework
  • SQL Server or other compatible database
  • Git

Installation

  1. Clone the repository:
git clone https://github.com/hafizmp/Epic-RPG-API.git
  1. Navigate to the project directory and set up the database connection string.

  2. Run the following command to create the database and apply migrations:

dotnet ef database update
  1. Start the API:
dotnet watch run

The API will be accessible at http://localhost:5200/

Endpoints

Authentication

  • POST /api/Auth/Register : User registration.
  • POST /api/Auth/Login : User login to obtain a JWT token.

Character Management

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

Fight

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

Weapon

  • POST /api/Weapon : Create a new weapon.

Epic-RPG endpoints

Database

Entities and Relationships

The API uses Entity Framework to manage the following entities and their relationships:

  • Users
  • Characters
  • Skills
  • Weapons

Data Seeding

The database is seeded with initial data to demonstrate the API's functionality.

Authentication and Authorization

JSON Web Tokens (JWT)

This API uses JWT for authentication and authorization.

User Registration

Users can register using the /api/Auth/Register endpoint.

User Login

Users can obtain an access token by logging in via the /api/Auth/Login endpoint.

Project Structure

Solution Overview

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

Commit History

Here are some of the key commits that contributed to the development of the API:

Contributing

Feel free to contribute to the development of Epic-RPG-API by submitting pull requests or reporting issues.

About

This repository houses the Epic-RPG Backend API, a feature-rich web API built with .NET 7 and C#. It powers the Epic-RPG game, allowing users to manage characters, skills, weapons, and engage in epic battles. Explore a robust set of endpoints for game management.

Topics

Resources

Stars

Watchers

Forks

Languages