https://github.com/gardimy/ror_recipe_app
For this milestone, I created a Recipe app that keeps track of all my recipes. It will allow you to save ingredients, keep track of what you have, create recipes, and generate a shopping list based on what you have and what you are missing from a recipe. Also, since sharing recipes is an important part of cooking the app should allow you to make th
https://github.com/gardimy/ror_recipe_app
devise ruby ruby-on-rails testing-framework
Last synced: 3 months ago
JSON representation
For this milestone, I created a Recipe app that keeps track of all my recipes. It will allow you to save ingredients, keep track of what you have, create recipes, and generate a shopping list based on what you have and what you are missing from a recipe. Also, since sharing recipes is an important part of cooking the app should allow you to make th
- Host: GitHub
- URL: https://github.com/gardimy/ror_recipe_app
- Owner: Gardimy
- License: mit
- Created: 2023-11-13T14:49:39.000Z (over 2 years ago)
- Default Branch: dev
- Last Pushed: 2023-11-17T17:33:23.000Z (over 2 years ago)
- Last Synced: 2025-01-13T14:54:33.234Z (over 1 year ago)
- Topics: devise, ruby, ruby-on-rails, testing-framework
- Language: Ruby
- Homepage:
- Size: 156 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 25
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
For this milestone, I created a Recipe app that keeps track of all my recipes. It will allow you to save ingredients, keep track of what you have, create recipes, and generate a shopping list based on what you have and what you are missing from a recipe. Also, since sharing recipes is an important part of cooking the app should allow you to make them public so anyone can access them..For now I only focus on the recipe part.
## Table of Contents
- [Tech Stack](#tech-stack) 🛠️
- [Key Features](#key-features) ✨
- [Getting Started](#getting-started) 🚀
- [Setup](#setup) 🔧
- [Installation](#installation) ⚙️
- [Usage](#usage) 🧰
- [Tests](#tests) :heavy_check_mark:
- [Troubleshooting](#troubleshooting) :nut_and_bolt:
- [Authors](#authors) 🖋️
- [Future Features](#future-features) 🌟
- [Contributing](#contributing) 🤝
- [Support](#support) 🆘
- [Acknowledgments](#acknowledgments) 🙏
- [License](#license) 📄
- [x] Four main models: User, Food, Recipe, and Recipe Food, following the ERD diagram.
- [x] Associations between models, including one-to-many and many-to-one relationships.
- [x] Generated corresponding migration files for each model with appropriate attributes.
- [x] Added foreign keys and indexes to ensure data integrity and optimize database queries.
- [x] Utilized timestamps for tracking creation and update times automatically.
- [x] Followed naming conventions for models, tables, and columns as per Rails standards.
- [x] Generated migration files to create necessary tables, columns, and associations.
- [x] Data validations and tests for models to ensure data integrity.
- [x] Model methods to process data and tests to validate their functionality.
- [x] CRUD actions in controllers for managing model instances.
- [x] View templates to render data and user interfaces.
- [x] Implemented forms for user input and data submission.
- [x] Optimized queries to handle n+1 problem.
- [x] Integrated Devise gem for user authentication and registration.
- [x] Integrated CanCanCan gem for user authorization (CRUD control).
- [x] Tests to verify the behavior of controller actions and responses.
- [x] Integration tests to cover user interactions.
- Allow User to create food
- allow user to save ingredients
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.
2. 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
```
3. 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 https://github.com/Gardimy/ror_recipe_app
```
Using HTTPS:
```
git clone https://github.com/Gardimy/ror_recipe_app
```
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/Gardimy/ror_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```
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
```
3. 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.
4. To run the app in development mode, execute the following command:
```
rails server
```
5. 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.
7. If you have future features like GUI or interactive mode, follow the specific instructions provided for those features in the app's documentation.
### Troubleshooting :nut_and_bolt:
#### 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.
2. 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
```
3. Recreate the Database [how to](#usage)
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](https://guides.rubyonrails.org/getting_started.html) for more troubleshooting tips and guidance.
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
```
2. Then in your terminal run the command:
```
bundle install
```
3. To set up RSpec in your app and create the Spec folder run:
```
rails generate rspec:install
```
4. Run the tests for all the models using the following command:
```
rspec spec/models
```
5. Alternatively, you could run tests for any specific suit using the following command (an example for Food model):
```
rspec spec/models/food.rb
```
6. All tests should pass without any errors or failures, ensuring that all models and their methods are functioning correctly.
> 👤 **Gardimy Charles**
- GitHub: [@Gardimy](https://github.com/Gardimy)
- Twitter: [@gardyelontiga45](https://twitter.com/gardyelontiga45)
- LinkedIn: [Gardimy charles](https://www.linkedin.com/in/gardimycharles/)
- [ ] Infinite scrolling pagination
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](https://github.com/Gardimy/ror_recipe_app/issues).
If you encounter any issues or have any questions or suggestions, please open an issue on the [issue tracker](https://github.com/Gardimy/ror_recipe_app/issues).
Furthermore, if you would like to get in touch with me, you can find our contact information in the Authors section.
- I would like to thank the entire community who are always willing to help and contribute.
[Ruby official](https://www.ruby-lang.org/) : 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](https://rubyonrails.org/): 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.
This project is [MIT](./MIT.md) licensed.gre