Skip to content

API for DDEG - Dungeons & Dragons Encounter Generator

License

Notifications You must be signed in to change notification settings

hayleyashby7/DDEG_API

Repository files navigation

DDEG - Dungeons & Dragons Encounter Generator - API

Summary

API for DDEG - Dungeons & Dragons Encounter Generator

Deployed to https://ddeg-api.fly.dev/

Tech Stack

Server

  • Node.js
  • TypeScript
  • Prisma

Database

  • PostgreSQL
  • Supabase

Testing

  • Jest

Endpoints

Encounter

POST /api/encounter

This takes an encounter request payload of

{
  character: number;
  level: number;
  difficulty: enum of ['Easy', 'Medium', 'Hard', 'Deadly'];
}

and currently returns either:

  • An array of D&D monsters with a challenge rating appropriate to the requested encounter.
  • An array of all D&D monsters and a null challenge rating when the challenge rating cannot be calculated.
{
    challengeRating: string | null;
    monsters: Monster[];
}

Monsters

GET /api/monsters

This end point is considered legacy and is likely to be phased out.

This takes a query parameter of challenge_rating and returns an array of D&D monsters with the matching challenge rating.

Notes

Monster stats were initially sourced from Open5e API under the Open Gaming License Version 1.0a

API key available on request.