Skip to content

jwraats/Wizard-RPG

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Wizard RPG 🧙‍♂️

A web-based RPG game set in a Wizard school. Battle fellow wizards, collect gold, bet on broom races, and join fellowships!

🚀 Quick Start

Prerequisites

Run with Docker Compose

# Production-like build
docker compose up --build

# Open the game
open http://localhost:3000

# API docs (Swagger)
open http://localhost:5000/swagger

Development (with hot reload)

# Uses docker-compose.override.yml automatically
docker compose up --build

# Frontend dev server: http://localhost:5173
# Backend API:         http://localhost:5000
# Database:            localhost:5432

🏗️ Architecture

Wizard-RPG/
├── backend/                          # C# .NET 8 Web API
│   ├── WizardRPG.Api/                # Main API project
│   │   ├── Controllers/              # REST endpoints
│   │   ├── Services/                 # Business logic
│   │   ├── Models/                   # EF Core entities
│   │   ├── DTOs/                     # Data transfer objects
│   │   ├── Hubs/                     # SignalR WebSocket hubs
│   │   └── Data/                     # DbContext + seed data
│   ├── WizardRPG.Tests.Unit/         # xUnit unit tests
│   └── WizardRPG.Tests.Integration/  # Integration tests
├── frontend/                         # Vue 3 + TypeScript
│   ├── src/
│   │   ├── views/                    # Page components
│   │   ├── stores/                   # Pinia state stores
│   │   ├── components/               # Reusable components
│   │   ├── router/                   # Vue Router config
│   │   └── api/                      # Axios + API types
│   └── tests/e2e/                    # Playwright E2E tests
├── docker-compose.yml                # Production config
└── docker-compose.override.yml       # Dev overrides (hot reload)

🎮 Features

Feature Description
🔐 Authentication Register/Login with JWT tokens
💰 Gold Coins Earn gold through battles and fellowships
🏦 Bank Deposit gold and store magical items
🧹 Broom Game Bet on broom league races
🤝 Fellowships Join guilds with referral links for steady income
⚔️ Battles Turn-based spell battles between wizards
📖 Narrator LLM-powered story narration for battles
👑 Admin Panel Game Master controls and player management

📡 API Endpoints

Method Path Description
POST /api/auth/register Register new player
POST /api/auth/login Login and receive JWT
GET /api/player/me Get current player profile
GET /api/bank Get bank account info
POST /api/bank/deposit Deposit gold to bank
POST /api/bank/withdraw Withdraw gold from bank
GET /api/broomgame/leagues List broom leagues
POST /api/broomgame/bet Place a bet
GET /api/fellowship Get current fellowship
POST /api/fellowship Create a fellowship
POST /api/fellowship/join Join via referral code
POST /api/battle/challenge Challenge a player
POST /api/battle/{id}/cast Cast a spell in battle
GET /api/admin/players List all players (admin)

Full API documentation available at /swagger when running.

🧪 Running Tests

Backend Tests

cd backend
dotnet test

E2E Tests (Playwright)

# Start the app first
docker compose up -d

cd frontend
npx playwright test

🔧 Local Development (without Docker)

Backend

cd backend
dotnet restore
# Update appsettings.Development.json with your local PostgreSQL connection
dotnet run --project WizardRPG.Api

Frontend

cd frontend
npm install
npm run dev

📋 Improvement Ideas & Roadmap

See docs/IMPROVEMENT_IDEAS.md for a comprehensive list of planned features and improvement proposals, including:

  • 🏆 Ranking System — ELO ratings, rank tiers, seasonal leaderboards
  • 🏠 House System — Four houses with house points, inter-house competitions, and house cups
  • 🤝 Collaboration — Group quests, cooperative boss battles, fellowship wars, mentorship
  • 📈 Player Growth — Referral rewards, onboarding tutorial, social sharing, demo mode
  • 🎯 Engagement — Daily quests, achievements, seasonal events, login rewards

📸 Screenshots

Screenshots are auto-generated by Playwright E2E tests after each test run.

🛠️ Tech Stack

  • Backend: C# .NET 8, ASP.NET Core, Entity Framework Core, SignalR
  • Database: PostgreSQL 16
  • Frontend: Vue 3, TypeScript, Vite, Pinia, Tailwind CSS
  • Real-time: SignalR WebSockets
  • Tests: xUnit, Moq, Playwright
  • Infrastructure: Docker, Docker Compose

About

This is a RPG game, where you can login and play in a Wizard school. (this is a AI driven project for FUN). this will be one of my public repos to burn some CoPilot credits at the end of the month.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors