8000 GitHub - elselif/rick-and-morty-restful-api: This project provides an API to fetch, store, and serve character data from the Rick and Morty series.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

elselif/rick-and-morty-restful-api

Repository files navigation

Rick and Morty Character API

This project provides an API to fetch, store, and serve character data from the Rick and Morty series.

  • Laravel: The PHP framework used to build the API.
  • MySQL: The database management system used to store character, episode, and location data.
  • Docker: Used to containerize the application environment.
  • Laravel Sail: A lightweight command-line interface for interacting with Laravel's Docker development environment.
  • Postman: A collaboration platform for API development. A Postman collection is included in the docs directory to demonstrate API endpoints and usage.
  • PHPUnit: The unit testing framework for PHP. Unit tests are included in the tests directory to ensure the reliability of the application.

Installation

< 6F0E /div>
  1. Clone this repository:
git clone https://github.com/user/repository.git
  1. Copy the .env.example file to .env:
cp .env.example .env
  1. Configure the .env file according to your environment.

  2. Run Sail's installation command:

./vendor/bin/sail up -d
  1. Create the database and migrate tables:
./vendor/bin/sail artisan migrate
  1. To fetch data from the Rick and Morty API and store it in the database, run the following command:
./vendor/bin/sail artisan rickandmorty:getdata

Usage

You can access the data by making HTTP requests to the API. For example:

Send a GET request to list all characters:

GET http://localhost/api/characters

Send a GET request to view a specific character:

GET http://localhost/api/characters/{id}

Send a POST request to create a new character:

POST http://localhost/api/characters

Send a PUT request to update a character:

PUT http://localhost/api/characters/{id}

Send a DELETE request to delete a character:

DELETE http://localhost/api/characters/{id}

Postman Collection

A Postman collection is available in the docs directory. Import this collection into Postman to explore and interact with the API endpoints.

Unit Tests

Unit tests are included in the tests directory. You can run the tests using PHPUnit to ensure the reliability of the application.

About

This project provides an API to fetch, store, and serve character data from the Rick and Morty series.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0