Documentation of Percy Jackson API

A REST API system providing data on characters, creatures, artifacts, and themes from the Percy Jackson and the Olympians universe (Riordanverse). The project aims to make data from the Percy Jackson universe available for programming studies using the REST API and for the development of applications for fans of the series, like websites featuring character profiles, a glossary of terms and words from Greco-Roman mythology, and Camp Half-Blood RPG games.

The REST API was built with the framework Express using TypeScript. The data used in this project comes from the official website of the saga author Rick Riordan Rickriordan.com, the publisher of the Percy Jackson books Readriordan.com and the fan website Fandom.com.

In addition, to promote the project, this website was created, using HTML, CSS, Tailwind and JavaScript, where users can test the API and read its documentation.

Project tools

How to run the Application locally

  1. Clone the application's GitHub repository to your local machine:
    git clone https://github.com/JCOAlves/PercyJacksonAPI.git
  2. Go to the API folder:
    cd API
  3. Inside the API folder, install the project's dependencies:
    npm install
  4. Create a .env file with the environment variables in API, based on env.example:
    npm run setup
  5. Finally, run the application using the API:
    npm run dev

    The REST API will run at http://localhost:3000 by default.

Routes of API

Eleven endpoints were created for the API, all of which are based on GET /api, the application's main route, which returns all data about characters, artifacts, cabins, locations, and books.

Request route:
/api
Example response body:
{
  "success": true,
  "status": 200,
  "message": "Data successfully listed",
  "data": {
    "characters": ["..."], 
    "artifacts": ["..."], 
    "cabins": ["..."],
    "places": ["..."],
    "books": ["..."]
  }
}

In addition, there is the GET /api/nameRoutes route, which lists all routes for characters, artifacts, cabins, places and books:

Request route:
/api/nameRoutes
Example response body:
{
    "success": true,
    "status": 200,
    "message": "Data successfully listed",
    "data": {
        "characters": ["/api/characters", "/api/characters/:name"],
        "artifacts": ["/api/artifacts", "/api/artifacts/:name"],
        "cabins": ["/api/cabins", "/api/cabins/:cabinNumber"],
        "places": ["/api/places", "/api/places/:name"],
        "books": ["/api/sagas", "/api/sagas/books", "/api/sagas/books/:title", "/api/sagas/:name"]
    }
}

In the event of errors, the error attribute is returned in the response, and the data attribute is omitted:

{
  "success": false,
  "status": 404,
  "message": "Error in the list of data",
  "error": "ROUTE_NOT_FOUND"
}
Summary Routes of API

Character route

Artifact route

Cabin route

Place route

Book route

Developers and contributors of the project

Júlio César

Creator and main fullstack dev of the application.

Breno Gusmão

Contributor responsible for the release of part of the API data.

If you'd like to contribute to the project, create a Pull Request.