Marvel Comics App

This project is a Rails application that interacts with the Marvel API to fetch information about comics and characters.

Table of Contents

Installation

To get started with the application, you must install Ruby and Rails on your machine. Follow the steps below:

  1. Clone the repository:

    git clone https://github.com/yourusername/marvel-comics-app.git
    cd marvel-comics-app
  2. Install the dependencies:

    bundle install

Configuration

You must set up the Marvel API keys to interact with the API. Follow the steps below:

  1. Create .env file:

    touch .env
  2. Add your Marvel API keys to the .env file:

    MARVEL_PUBLIC_KEY=your_public_key
    MARVEL_PRIVATE_KEY=your_private_key
  3. Install dotenv-rails gem (if not already installed): Add this line to your Gemfile:

    gem 'dotenv-rails', groups: [:development, :test]

    Then run:

    bundle install

Usage

To start the Rails server, run:

rails server

Visit http://localhost:3000 in your web browser to access the application.

Testing

To run the tests, run:

rails test

Mocking API Requests

This project uses Webmock to mock API durubg testing. The test suite includes tests for MarvelService and ComicsController.

API Rate Limiting

To handle API rate limiting, the application implements caching for the API responses using Rails Cache.