Cosmosha / hello-rails-react

A Random Greeting App in Rails and React

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello-Rails-React: "A Random Rails React Greeting App"

Table of Contents

Tech Stack πŸ› οΈ

(back to top)

✨ Key Features

  • Greetings: Randomly Select a greeting message to users.

(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:cosmosha/hello-rails-react.git

Using HTTPS:

git clone https://github.com/cosmosha/hello-rails-react.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/cosmosha/hello-rails-react

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 Like model):
rspec spec/models/like_spec.rb
  1. All tests should pass without any errors or failures, ensuring that all models and their methods are functioning correctly.

πŸ–‹οΈ Authors & Contributors

πŸ§‘β€πŸ¦² Cosmos Hagan

(back to top)

🌟 Future Features

  • Tests to verify the behavior of controller actions and responses.

(back to top)

🀝 Contributing

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 following individuals and projects for their contributions and inspiration:

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.

(back to top)

About

A Random Greeting App in Rails and React

License:MIT License


Languages

Language:Ruby 64.2%Language:HTML 15.8%Language:JavaScript 9.8%Language:Batchfile 7.7%Language:CSS 2.0%Language:Shell 0.6%