Live App URL: https://dinner-recipe-475753dcfb84.herokuapp.com/
Prerequisites:
- Ensure Ruby and Rails is Installed.
- Ensure PostgreSQL is Installed.
Installation:
-
Clone the repository:
git clone https://github.com/subhashsaran/dinner_recipe.git cd dinner_recipe
-
Install dependencies:
bundle install
-
Create and migrate the database:
rails db:create && rails db:migrate
-
Import recipe data (Optional):
This step requires a
tmp/recipes-en.json
file containing recipe data in JSON format.rails recipes:import
-
Run tests:
bundle exec rspec
-
Start the Rails server:
rails server
I maintained a clean commit history, allowing to track the project's development step-by-step. Each commit represents a small user story delivered.
Initial Version
The initial version focused on displaying a list of recipes along with their ingredients. Here are some potential improvements:
- Enhanced Ingredient Display: A more aesthetically pleasing way to display ingredients.
- Search Result Highlighting: Replicate the behavior of search engines like Google and GitHub, highlighting matching ingredients within each recipe.
Improved Version with Basic Syntax Highlighting
This commit introduced basic syntax highlighting for ingredients (commit 07e55309: [https://github.com/subhashsaran/dinner_recipe/commit/d217bcd41dc382311cc80719aea03e9245aea8a4)). While not the most optimal solution, it provides a visual improvement over the initial version.
Here are some potential improvements we can discuss during the review call:
Search Ranking:
- Implement sorting by the number of matching search ingredients within a recipe. This could involve assigning a score to each recipe based on the number of matches, with higher-scoring recipes displayed at the top.
Pagination:
- Currently, for basic search items like sugar, salt, etc., there are thousands of matching records, the search results are displayed in a single page. This could be improved by adding pagination to the search results.
Recipe Import:
- Improve the recipe import process:
- Use
activerecord-import
to bulk import recipes and ingredients in a single transaction, significantly improving efficiency compared to individual inserts. - Add a progress bar to indicate import progress.
- Prevent duplicate record creation during multiple imports.
- Use
Search Functionality:
- Consider integrating Basic Elasticsearch using Searchkick to enhance search results' relevance and speed.
Frontend Enhancements (Future Consideration):
- Explore using React to implement single-page application features for a more dynamic user experience.
Code Quality:
- Add Rubocop to check for coding style issues and enforce best practices.