Introducing the Recipe App: Your all-in-one solution for effortless cooking! Seamlessly organize your recipes, ingredients, and pantry items. Craft delicious recipes with ease, generate smart shopping lists, and even share your culinary creations with the world. Cooking has never been this convenient – simplify your kitchen adventures with our Recipe app!

Table of Contents

Tech Stack 🛠️

(back to top)

✨ Key Features

  • Four main models: User, Food, Recipe, and Recipe Food, following the ERD diagram.
  • Associations between models, including one-to-many and many-to-one relationships.
  • Generated corresponding migration files for each model with appropriate attributes.
  • Added foreign keys and indexes to ensure data integrity and optimize database queries.
  • Utilized timestamps for tracking creation and update times automatically.
  • Followed naming conventions for models, tables, and columns as per Rails standards.
  • Generated migration files to create necessary tables, columns, and associations.
  • Data validations and tests for models to ensure data integrity.
  • Model methods to process data and tests to validate their functionality.
  • CRUD actions in controllers for managing model instances.
  • View templates to render data and user interfaces.
  • Implemented forms for user input and data submission.
  • Optimized queries to handle n+1 problem.
  • Integrated Devise gem for user authentication and registration.
  • Integrated CanCanCan gem for user authorization (CRUD control).
  • Tests to verify the behavior of controller actions and responses.
  • Integration tests to cover user interactions.

(back to top)

🚀 Getting Started

Setup 🔧

  1. Ensure you have Ruby installed on your system. You can check your Ruby version in the terminal by running:
ruby -v

If Ruby is not installed, you can download and install it from the official Ruby website.

  1. Ensure you have Ruby on Rails (RoR) installed on your system. You can check your Rails version in the terminal by running:
rails -v

If Rails is not installed, you can install it using the following command:

gem install rails
  1. To get a local copy up and running, follow these steps. Choose the directory on your local machine where you want to copy project. For example:
cd /home/user/name-of-your-directory

Clone the project using one of the options.

Using SSH-key:

git clone git@github.com:Jrmcuervo/RoR-group-project.git

Using HTTPS:

git clone https://github.com/Jrmcuervo/RoR-group-project.git

You can also create the new directory just adding the name of it in the end of command. For example:

git clone https://github.com/Jrmcuervo/RoR-group-project.git recipe-app

Installation ⚙️

To run this project locally, follow these steps:

  1. Open your terminal or command prompt.

  2. Navigate to the directory where you have cloned or downloaded the Ultimate Recipe Assistant repository.

  3. Run the following command to install any required dependencies: bundle install

Usage 🧰

  1. Once the setup is complete, ensure you are still in the directory containing the Ultimate Recipe Assistant files.

  2. To set up the database and seed initial data, run the following commands:

rails db:create
rails db:migrate

This will create the database and apply migrations.

If you want to populate the database you can run (this step is not required):

rails db:seed
  1. To precompile assets for production deployment, execute the following command:
rails assets:precompile

Precompiling assets is essential for improved performance and loading times in a production environment.

  1. To run the app in development mode, execute the following command:
rails server
  1. The app will be accessible at http://localhost:3000 in your web browser.

If you encounter any issues with the email verification process, please refer to the Devise documentation or seek assistance from the Devise community.

  1. If you have future features like GUI or interactive mode, follow the specific instructions provided for those features in the app's documentation.

Troubleshooting 🔩

Rendering

If you encounter any issues related to missing assets or unexpected behavior after making changes, try the following steps:

  1. Delete the tmp directory located in the root of your project:
rm -rf tmp/

This can help clear any cached data that might be causing issues.

  1. Delete the public/assets directory:
rm -rf public/assets/

This ensures that any previously precompiled assets are removed, and new ones will be generated during the next precompilation.

Database

If you encounter any problems related to data or database inconsistencies, you can follow these steps to reset your database:

  1. Ensure Server/Process Shutdown: Make sure that your Rails server or any related processes are not running. You should not have any active connections to the database.

  2. Drop the Database:

rake db:drop

or

rails db:drop
  1. Recreate the Database how to

After dropping the database, you can recreate it from scratch. Run migrations to set up the schema.

If problems persist, you can refer to the official Ruby on Rails Guides for more troubleshooting tips and guidance.

Tests ✔️

To run the tests for the Ultimate Recipe Assistant requests and models, ensure you are in the directory containing the test files.

  1. Install RSpec:

Find your gemfile and add the RSpec gem in the development, test group:

group :development, :test do
  gem 'rspec-rails'
end
  1. Then in your terminal run the command:
bundle install
  1. To set up RSpec in your app and create the Spec folder run:
rails generate rspec:install
  1. Run the tests for all the models using the following command:
rspec spec/models
  1. Alternatively, you could run tests for any specific suit using the following command (an example for Food model):
rspec spec/models/food.rb
  1. All tests should pass without any errors or failures, ensuring that all models and their methods are functioning correctly.

🖋️ Authors & Contributors

👤 steven wafeek

👤 Ruben Cuervo

(back to top)

🌟 Future Features

  • Infinite scrolling pagination

(back to top)

🤝 Contributing

I welcome contributions to enhance the functionality and user experience of the Ultimate Recipe Assistant Application. If you have any ideas, suggestions, or bug reports, feel free to open an issue or submit a pull request. Let's share ideas!

If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and commit them with descriptive commit messages.
  4. Push your changes to your forked repository.
  5. Submit a pull request to the main repository, explaining your changes in detail.

Please adhere to the coding conventions and guidelines specified in the project.

Feel free to check the issues page.

(back to top)

🆘 Support

If you encounter any issues or have any questions or suggestions, please open an issue on the issue tracker. Furthermore, if you would like to get in touch with me, you can find our contact information in the Authors section.

(back to top)

🌲 Acknowledgements

  • I would like to thank the entire community who are always willing to help and contribute.

Ruby official : Special thanks to Yukihiro Matsumoto, the creator of the Ruby programming language, for giving me this powerful and elegant tool to build amazing applications. I am also grateful to the Ruby Core Team and the passionate Ruby community for their continuous support and contributions.

Ruby on Rails: A big thank you to the creators, contributors, and maintainers of the Ruby on Rails framework. Your efforts have empowered countless developers to build powerful and scalable web applications.

📄 License

This project is MIT licensed.gre

(back to top)