This is a Ruby on Rails web scraping project for collecting product information from the Open Food Facts website.
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.
Run the following command to install the project dependencies:
Inside folder Run to build the project
docker compose build
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
.
Start the application
docker compose up
Stop the application
docker compose down
To manually synchronize the products, you can either access the /products/sync
route in your browser or run the following command:
rails products:sync
You can view the list of saved products by accessing the /products
route in your browser.
To view the details of a specific product, access the /products/:code
route, where :code
is the product code.
To run the automated tests, use the following command:
bundle exec rspec
This is a challenge by Coodesh