Skip to content

olucasmarquess/coodesh_challenge

Repository files navigation

Open Food Scraping

This is a Ruby on Rails web scraping project for collecting product information from the Open Food Facts website.

Setup

Make sure you have Ruby on Rails installed on your system. Additionally, ensure that you have MongoDB configured and Mongoid installed for storing the collected data.

Installing dependencies

Run the following command to install the project dependencies:

Inside folder Run to build the project

docker compose build

Database configuration

Make sure you have correctly configured the database information in the config/mongoid.yml file.

Build the application

docker compose up --build

The project will be accessible at http://localhost:3005.

Usage

Start the application

docker compose up

Stop the application

docker compose down

Manual synchronization

To manually synchronize the products, you can either access the /products/sync route in your browser or run the following command:

rails products:sync

Product listing

You can view the list of saved products by accessing the /products route in your browser.

Product details

To view the details of a specific product, access the /products/:code route, where :code is the product code.

Testing

To run the automated tests, use the following command:

bundle exec rspec

This is a challenge by Coodesh

About

A challenge produced for Coodesh

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published