Giter Club home page Giter Club logo

rick_and_morty's Introduction

README

Rick and Morty Email Notifications for Serge

Overview

This project uses Sidekiq to run a scheduled job every 30 minutes to fetch data from the Rick and Morty GraphQL API. Any new characters are stored in a local database. Serge is sent an email detailing the number of new records stored in the db and number of total records pulled from the API.

Prerequisites

Ruby 2.7+ Rails 6.1+ PostgreSQL

Dependencies

Sidekiq VCR and Webmock for mocking HTTP requests RSpec for testing

Installation

Clone the repository.

bundle install rails db:create rails db:migrate

Set up an .env file with your GMAIL_ADDRESS, GMAIL_PASSWORD, and MAIL_RECIPIENT. Use Serge's test email as the recipient per the instructions of the assignment. You may need to generate an app password to use instead of using your actual gmail password. https://myaccount.google.com/apppasswords

Usage

Starting the Sidekiq Worker (local)

  1. Install and run Redis. https://redis.io/download
  2. Run the rails server with rails s (optional, but helpful for seeing logs)
  3. Run Sidekiq: bundle exec sidekiq

Testing

Run rspec to run tests.

To fetch and store new characters manually, you can trigger the CharacterService.fetch_and_store_characters method.

Future improvements

  1. Generate separate internal character ID instead of using Ricky and Morty API character ID
  2. Improve format of notification email and include details about characters

rick_and_morty's People

Contributors

sonyavera avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.