Skip to content

archejk/blog_post

Repository files navigation

Blog Spot - Ruby on Rails Blog Application

A simple blog application built with Ruby on Rails, featuring user authentication, email notifications, and TailwindCSS styling for a modern and responsive UI.


Table of Contents


Features

  • User Authentication - Login/registration with Devise, Edit Profile Information with avatar upload
  • Blog Post Management - CRUD function in blog posts
  • Feedback System - Users can leave feedback on blog posts except their own
  • Email Notifications - Authors receive email notifications when feedback is submitted (via SendGrid Service API)
  • Filtering & Pagination – Filter blog posts by author and feedback presence with Kaminari gem pagination
  • Responsive Design - Built with Tailwind CSS for a modern, mobile-friendly interface
  • Testing - Fully tested with passing RSpec specs

Tech Stack

Layer Technology
Backend Ruby on Rails 7.x
Database PostgreSQL
Authentication Devise
Emails SendGrid API
Pagination Kaminari Gem
Frontend Tailwind CSS, Stimulus JS
Testing RSpec, FactoryBot

Prerequisites

  • Ruby 3.0 or higher
  • Rails 7.0 or higher
  • PostgreSQL
  • Node.js 16 or higher
  • Yarn or npm
  • Git

Installation & Setup

1. Clone Repository

git clone https://github.com/archejk/blog_post.git
  • Navigate into the project directory
cd blog_spot

2. Install dependencies

# install ruby gems
bundle install

# install js javascript packages
yarn install or npm install

3. Database Set up

# create and setup db
rails db:create
rails db:migrate

# load data in the db (optional)
rails db:seed

4. Environment Config

  • Create .env file in the root directory and add these env variables:
# database credentials
DATABASE_USERNAME=your_username
DATABASE_PASSWORD=your_password

# Sendgrid email delivery service
SENDGRID_API_KEY=your_sendgrid_api_key

Run Tests

# all tests (models, controllers, etc.)
bundle exec rspec

# run specific test files
bundle exec rspec spec/models
bundle exec rspec spec/controllers
bundle exec rspec spec/mailers
bundle exec rspec spec/services
bundle exec rspec spec/helpers
bundle exec rspec spec/requests

Running the Application

  1. Start rails server
rails s
  1. Start tailwind css watcher (in separate terminal)
rails tailwindcss:watch

# or

yarn build:css
  1. Access the application

Demo

BlogPost.Demo.-.User.Authentication.Email.Notification.Feedback.System.mp4
BlogPost.filtering.and.pagination.webm

Key Changes & Development Log

  • Initial Commit: Create and setup Blog Post with feedback mailer
  • UI Improvement: Integrated Tailwind CSS for responsive design
  • Email Notifications: Set up email delivery via SendGrid service
  • User Authentication: Integrated Devise for registration/login
  • User Profiles: Avatar upload with Active Storage and profile management
  • Bug Fix: Ensure delete button sends correct DELETE request with Turbo
  • Test: Set up Unit Test Framework
  • Feature: BlogPost Filtering & Pagination