/blogapp

["Blog App"] The Blog app is a classic example of a blog website. It is a fully functional website that will show the list of posts and empower readers to interact with them by adding comments and liking posts.

Primary LanguageRubyMIT LicenseMIT

Blog App

Table of Contents

📖 ["Blog App"]

["Blog App"] is a classic example of a blog website. It is a fully functional website that will show the list of posts and empower readers to interact with them by adding comments and liking posts.

🛠 Built With

1- Ruby
2- Gitflow
3- Rubocop
4- Ruby On Rails

Tech Stack

Client
Ruby

Key Features

  • [] [Add migration got post, user, comment and like according the ER]
  • [] [Added foreign keys and indexes to ensure data integrity and optimize database queries]
  • [] Processing data in models.
  • [] Validations and Model specs.
  • Setup and controllers.
  • Controllers specs.
  • Integration specs for Views and fixing n+1 problems.
  • Add device.
  • Add authorization rules
  • Add API end point.

(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/your-directory

Clone the project :

Using HTTPS:

git clone https://github.com/beteland123/blogapp.git

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 this 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 blogapp 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):

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.

Tests

To run tests, run the following command:

  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

(back to top)

👥 Authors

👤 Micronaut Betel Andarge

(back to top)

🔭 Future Features

  • Update the CRUD logic to allow editing of comments and posts.

(back to top)

🤝 Contributing

Contributions, issues, and feature requests are welcome!

Feel free to check the issues page.

(back to top)

⭐️ Show your support

If you like this project, please give a ⭐️ (Thank you)

(back to top)

🙏 Acknowledgments

  • I would like to thank Microverse for this learning opportunity.

  • Microverse team

📝 License

This project is MIT licensed.

(back to top)