Modern Blog Platform is a dynamic and responsive blog application built with Ruby on Rails. It offers a robust user authentication system, role-based access control, and a sleek user interface designed for both administrators and regular users. Administrators have full control over blog articles, while regular users can seamlessly browse and read content without modification privileges.
the code: https://github.com/user-attachments/assets/dd9e168f-336b-42ea-bb5e-066e34c3b4fe
- Devise Integration: Secure user authentication system allowing users to sign up, log in, and manage their accounts.
- Role-Based Access Control:
- Admin Users: Can create, edit, delete, and manage blog articles.
- Regular Users: Can view and browse blog articles without modification rights.
- CRUD Operations: Administrators can perform Create, Read, Update, and Delete operations on blog articles.
- QR Code Generation: Each article has associated QR codes (PNG and SVG) for easy sharing and access.
- Categories: Organize articles into categories for better navigation and filtering.
- Responsive Design: Ensures optimal viewing experience across various devices and screen sizes.
- Sidebar Navigation: Intuitive sidebar for easy navigation between different sections of the platform.
- Animations: Smooth animations implemented using GSAP for enhanced user experience.
- Search Functionality: Allows users to search for articles efficiently.
- Bookmark Feature: Users can bookmark their favorite articles for quick access.
- Access Protection: Ensures that only authorized users can access specific parts of the application.
- CSRF Protection: Prevents cross-site request forgery attacks.
- Data Validation: Ensures that all user inputs are properly validated and sanitized.
- Turbolinks: Enhances navigation speed by making use of Turbolinks.
- Turbo Streams: Enables real-time updates and dynamic content rendering without full page reloads.
- Modern CSS Practices: Utilizes CSS variables and transitions for a modern and maintainable stylesheet.
Dashboard view for administrators.
User interface for regular users.
Note: Replace path_to_dashboard_screenshot.png
and path_to_user_view_screenshot.png
with actual paths to your screenshots.
-
Backend:
- Ruby on Rails
- Devise (Authentication)
- Pundit / CanCanCan (Authorization)
- RQRCode (QR Code Generation)
-
Frontend:
- HTML5 & CSS3
- JavaScript (ES6)
- GSAP (Animations)
- Turbo Streams (Real-Time Updates)
-
Database:
- PostgreSQL (or your preferred database)
Follow these steps to set up the project locally:
- Ruby: Version 2.7.0 or higher
- Rails: Version 6.1.4 or higher
- Bundler: For managing Ruby gems
- Node.js & Yarn: For managing JavaScript dependencies
- PostgreSQL: (Or another database supported by Rails)
-
Clone the Repository
git clone https://github.com/Abo5/modern-blog-platform.git cd modern-blog-platform
-
Install Ruby Gems
Ensure you have the required Ruby version installed. You can use RVM or rbenv to manage Ruby versions.
bundle install
-
Install JavaScript Dependencies
yarn install
-
Set Up the Database
Ensure PostgreSQL is running on your machine. Create the database and run migrations:
rails db:create rails db:migrate rails db:seed # If you have seed data
-
Run the Rails Server
rails server
Navigate to
http://localhost:3000
in your browser to view the application.
-
Admin User:
- Can access the admin dashboard.
- Can create, edit, and delete blog articles.
- Can manage categories and other administrative tasks.
-
Regular User:
- Can view and browse blog articles.
- Can search for articles.
- Can bookmark favorite articles.
By default, users can sign up as regular users. To create an admin user:
-
Via Rails Console
rails console
user = User.find_by(email: '[email protected]') user.update(admin: true)
Replace
'[email protected]'
with the actual admin user's email. -
Using Seed Data
You can add seed data in
db/seeds.rb
to create an admin user:User.create!( email: '[email protected]', password: 'password', password_confirmation: 'password', admin: true, fullname: 'Admin Demo', firstname: 'Admin', lastname: 'Demo' )
Then run:
rails db:seed
Contributions are welcome! Please follow these steps to contribute to the project:
-
Fork the Repository
Click the "Fork" button at the top right of this page to fork the repository.
-
Clone Your Fork
git clone https://github.com/Abo5/modern-blog-platform.git cd modern-blog-platform
-
Create a New Branch
git checkout -b feature/YourFeatureName
-
Make Your Changes
Implement your feature or fix.
-
Commit Your Changes
git commit -m "Add feature: YourFeatureName"
-
Push to Your Fork
git push origin feature/YourFeatureName
-
Create a Pull Request
Go to the original repository and click "Compare & pull request" to submit your changes.
This project is licensed under the MIT License. You are free to use, modify, and distribute this software as per the terms of the license.
For any inquiries or support, please contact:
- Name: Maven
- Email: [email protected]
- GitHub: my_account
- LinkedIn: my LinkedIn Profile