A Ruby application that leverages the Open Movie Database (OMDb) API to create a movie exploration service with local data storage capabilities.
- Search movies by title
- Retrieve movie details using IMDB ID
- Store movie data locally in SQLite database
- RESTful API architecture
- Data persistence using ActiveRecord
- Ruby 3.0+
- SQLite3 (Database)
- ActiveRecord (ORM)
gem 'httparty' # For API requests
gem 'dotenv' # Environment variable management
gem 'rubocop' # Code style enforcement
gem 'activerecord'# Database ORM
gem 'sqlite3' # Database- Ruby installed on your system
- SQLite3 installed
- Postman for API testing
- OMDb API key (Get it here)
- Clone the repository:
git clone <repository-url>
cd movie-explorer- Install dependencies:
bundle install- Configure environment variables:
- Create a
.envfile in the root directory - Add your OMDb API key:
- Create a
OMDB_API_KEY=your_api_key_here- Set up the database:
rake db:create
rake db:migratehttp://www.omdbapi.com/?apikey=[yourkey]&
GET /?t={movie_title}Example:
curl "http://www.omdbapi.com/?apikey=YOUR_KEY&t=Matrix"GET /?i={imdb_id}Example:
curl "http://www.omdbapi.com/?apikey=YOUR_KEY&i=tt0133093"CREATE TABLE movies (
id INTEGER PRIMARY KEY,
title VARCHAR(255),
year VARCHAR(10),
rated VARCHAR(10),
released DATE,
runtime VARCHAR(20),
genre VARCHAR(255),
director VARCHAR(255),
plot TEXT,
imdb_id VARCHAR(20) UNIQUE,
imdb_rating DECIMAL(3,1),
created_at DATETIME,
updated_at DATETIME
);- Import the provided Postman collection
- Update the API key in environment variables
- Run the collection to test all endpoints
rake testThis project follows Ruby style guidelines enforced by RuboCop. To check your code:
rubocopTo auto-correct issues:
rubocop -a- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE.md file for details.
- OMDb API for providing the movie database
- Ruby and its amazing community
- All contributors to this project
For support, please open an issue in the GitHub repository or contact the maintainers.