Skip to content

RickAndMorty-Spring-API is a backend developed with Java and Spring Boot that implements a RESTful API to manage and list data from the Rick and Morty series. The project is prepared to be consumed by a separate front-end.

License

Notifications You must be signed in to change notification settings

Exploit-Experts/RickAndMorty-Spring-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀Rick and Morty Spring API

License: MIT GitHub pull requests GitHub contributors

RickAndMorty-Spring-API is a backend developed with Java and Spring Boot that implements a RESTful API to list data of characters from the Rick and Morty series. The project allows viewing character information and is prepared to be consumed by a separate front-end.

This service provides a robust base for integration with client interfaces that consume character data through endpoints.


📋 Table of Contents


Objective

Create a RESTful API that allows consuming and viewing data of characters from the Rick and Morty series, providing endpoints to be used in the Angular front-end.


Credits

Bruno Magno
Paulo de Araujo
Marcelo Mesquita
Jonathan Rocha
Klismans Nazário
Leandro Oliveira

Technologies Used

  • Java
  • MySQL
  • Spring Boot
  • Spring Boot
  • Spring Data JPA
  • Lombok

Installation and Execution

  1. Clone the repository:
git clone https://github.com/Exploit-Experts/RickAndMorty-Spring-API.git
  1. Navigate to the project directory:
cd RickAndMorty-Spring-API
  1. Copile project
mvn clean install
  1. Execute the jar
java -jar target/rickMorty-0.0.1-SNAPSHOT.jar

Endpoints

  • Characters

    • GET /characters - Retrieves all characters from the first page.
    • GET /characters?page=1 - Retrieves all characters from a specific page.
    • GET /characters
      • Parameters:
        • sort (optional) - Sorts by a specific attribute (NAME_ASC, NAME_DESC, STATUS_ASC, STATUS_DESC).
        • name (optional) - Filters characters by name.
        • status (optional) - Filters characters by status (ALIVE, DEAD, UNKNOWN).
        • species (optional) - Filters characters by species.
        • type (optional) - Filters characters by type.
        • gender (optional) - Filters characters by gender (FEMALE, MALE, GENDERLESS, UNKNOWN).
    • GET /characters/{id} - Retrieves a specific character by ID.
    • GET /characters/avatar/{id}.jpeg - Retrieves the avatar of a specific character by ID.
  • Episodes

    • GET /episodes - Retrieves all episodes from the first page.
    • GET /episodes?page=2 - Retrieves all episodes from a specific page.
    • GET /episodes
      • Parameters:
        • name (optional) - Filters episodes by name.
        • episode (optional) - Filters episodes by code (expected format: SXXEXX).
        • sort (optional) - Sorts episodes by name (NAME_ASC, NAME_DESC) or episode code (EPISODE_CODE, EPISODE_CODE_DESC).
    • GET /episodes/{id} - Retrieves a specific episode by ID.
  • Locations

    • GET /locations - Retrieves all locations from the first page.
    • GET /locations?page=2 - Retrieves all locations from a specific page.
    • GET /locations
      • Parameters:
        • name (optional) - Filters locations by name.
        • type (optional) - Filters locations by type.
        • dimension (optional) - Filters locations by dimension.
        • sort (optional) - Sorts locations by name (NAME_ASC, NAME_DESC), type (TYPE_ASC, TYPE_DESC), or dimension (DIMENSION_ASC, DIMENSION_DESC).
    • GET /locations/{id} - Retrieves a specific location by ID.
  • Users

    • POST /users - Registers a user by ID.
    • PUT /users/{id} - Fully updates user data.
    • PATCH /users/{id} - Partially updates user data by ID.
    • DELETE /users/{id} - (soft delete) Deletes the user by ID.
  • Favorites

    • POST /favorites - Registers a favorite and associates it with a user.
    • GET /favorites/{userId} - Retrieves all favorites for a specific user.
      • Parameters:
        • page (optional, default: 0) - The page number to retrieve.
        • size (optional, default: 10) - The number of items per page.
        • sort (optional, default: "asc") - Sorts by ID in ascending or descending order.
    • DELETE /favorites/{userId}/{favoriteId} - Removes a specific favorite for a user.
    • DELETE /favorites/{userId} - Removes all favorites for a user.

Swagger Documentation

The API documentation is available via Swagger. You can access it by navigating to the following URL after running the application: http://localhost:8080/swagger-ui/index.html

This documentation provides a detailed description of all available endpoints, their parameters, and responses, making it easier to understand and interact with the API.


Contributing

We welcome contributions from the open-source community. If you have any ideas, bug fixes, or feature requests, feel free to submit a pull request.


Roadmap

  • Implement the remaining endpoints.
  • Implement the remaining users and favorites operations.
  • Implement the remaining features.

License

This project is licensed under the MIT License. See the LICENSE file for more information.

References

About

RickAndMorty-Spring-API is a backend developed with Java and Spring Boot that implements a RESTful API to manage and list data from the Rick and Morty series. The project is prepared to be consumed by a separate front-end.

Topics

Resources

License

Stars

Watchers

Forks

Languages