Skip to content

GO-Blog is a Laravel-based project aimed at creating a powerful and user-friendly blogging platform. It provides a robust backend powered by PHP and the Laravel Framework, along with a modern front-end interface using Livewire.

Notifications You must be signed in to change notification settings

ohansyah/go-blog

Repository files navigation

GO-Blog

PHP Laravel Laravel Jetstream Livewire Tailwind CSS DaisyUI TinyMCE

GO-Blog is a Laravel-based project aimed at creating a powerful and user-friendly blogging platform. It provides a robust backend powered by PHP and the Laravel Framework, along with a modern front-end interface using Livewire.

This project leverages the following technologies:

  • PHP (^8.1) - The programming language powering the backend of the application.
  • Laravel Framework (^10.10) - A powerful PHP framework for web application development.
  • Laravel Jetstream (^3.2) - A beautifully designed application scaffolding for Laravel.
  • Livewire (^2.12) - A full-stack framework for building dynamic user interfaces in Laravel.
  • Tailwind CSS (^2.2) - A utility-first CSS framework for rapidly building custom user interfaces.
  • DaisyUI (^2.5) - A component library for Tailwind CSS.
  • TinyMCE - Empowering content creation with a user-friendly rich text editor, making sharing your knowledge a breeze.

Installation

Prerequisites

Before you begin, make sure you have the following prerequisites installed on your system:

Installation Steps

Follow these steps to set up your Laravel 10 project with Jetstream and Vite:

  1. Clone the Repository
    git clone <repository-url>
    cd <project-folder>
  2. Install Composer Dependencies
    composer install
  3. IInstall NPM Dependencies
    npm instal
  4. Copy the Environment File Create a copy of the .env.example file and name it .env.
    cp .env.example .env
  5. Generate an Application Key
    php artisan key:generate
  6. Configure the Database Update the .env file with your database connection details:
    DB_CONNECTION=mysql
    DB_HOST=127.0.0.1
    DB_PORT=3306
    DB_DATABASE=your_database_name
    DB_USERNAME=your_database_username
    DB_PASSWORD=your_database_password
  7. Run Migrations and Seed the Database
    php artisan migrate --seed
  8. Set TinyMCE
    TINYMCE_CDN_URL="https://cdn.tiny.cloud/1/YOUR_TINY_MCE_API_KEY/tinymce/5/tinymce.min.js"
    // register and replace YOUR_TINY_MCE_API_KEY from https://www.tiny.cloud/my-account/dashboard -> Yout Tiny API Key
  9. Install and Build Vite Assets
    npm run dev
    
    # OR for production build
    npm run prod
  10. Start the Laravel Development Server
    php artisan serve
  11. Access Your Application Open your web browser and visit http:https://localhost:8000 to access your Laravel 10 project.

Laravel Blog Project Roadmap

This roadmap outlines the progression of the Laravel blog project, highlighting the key phases and tasks involved.

Phase 0: Bug Fix and Additional

Bug Fix

  • Post Index - Post Heigh unstable.
  • Post Index - Post image size unstable.
  • Post Create - Slug.
  • Post Image - Validate Image Required withoud refresh page.

Additional

  • TinyMCE - put credential on env.
  • Weather API - Integration with api.open-meteo.com

Phase 1: Basic Setup and Functionality

  1. Set up Laravel project with Jetstream and Livewire.

    • Install Laravel using the Laravel installer or Composer.
    • Create a new Laravel project with the desired name.
    • Install Jetstream and choose the Livewire stack during installation.
    • Configure the database settings in the .env file.
    • Generate the application key using php artisan key:generate.
    • Run the migration and seed the database with dummy data using php artisan migrate --seed.
    • Test the basic setup by accessing the application in the browser.
    • Configure logging daily (7).
    • Configure logging query, bindings, time.
  2. Configure authentication and user management.

    • Generate authentication scaffolding using Jetstream: php artisan jetstream:install livewire.
    • Customize the authentication views and routes as needed.
    • Test the authentication functionality by registering, logging in, and logging out.

Phase 2: Core Functionality

  1. Create blog model and migration.

    • Generate a migration for the blog posts table: php artisan make:migration create_blog_posts_table.
    • Define the structure of the blog posts table in the migration file.
    • Run the migration: php artisan migrate.
  2. Implement CRUD operations for blog posts.

    • Create PostController and routes php artisan make:controller PostController --resource.
    • Create Post Model php artisan make:model Post.
    • Create a Livewire component for managing blog posts, such as PostIndex, PostCreate, PostEdit, and PostShow.
    • Define the necessary properties and methods in each Livewire component.
    • Implement the logic for creating, editing, and deleting blog posts using Laravel's Eloquent ORM.
    • Render the appropriate views and wire up the Livewire components with the necessary routes.
  3. Design views for creating, editing, and displaying blog posts.

    • Use Blade templates to design the views for creating, editing, and displaying blog posts.
    • Style the views using Tailwind CSS classes and components.
    • Leverage Livewire's data binding and wire directives to create dynamic and interactive UI elements.

Phase 3: Enhancements

  1. Implement authorization for managing blog posts.

    • Define authorization policies or gates for managing blog posts.
    • Restrict access to create, edit, and delete operations based on user roles and permissions.
    • Add appropriate authorization checks in the Livewire components and views.
  2. Integrate a rich text editor for content creation.

    • Choose a rich text editor library such as TinyMCE or CKEditor.
    • Install the library using a package manager or include it directly in your project.
    • Integrate the rich text editor into the create and edit views.
    • Implement the necessary JavaScript code to handle content formatting and interactions.
  3. Add image upload functionality for blog posts.

    • Implement file upload handling using Laravel's file system features.
    • Update the create and edit views to include an image upload field.
    • Store the uploaded images in a designated folder and associate them with the corresponding blog posts.
  4. Implement pagination for the blog listing page.

    • Use Laravel's pagination features to paginate the list of blog posts.
    • Update the blog listing view to display paginated results.
    • Implement navigation links to switch between different pages.

Phase 4: Additional Features

  1. Integrate a commenting system for blog posts.

    • Create a Comment model and migration for storing comments.
    • Establish a relationship between the Comment and Post models.
    • Design and implement a Livewire component for adding and displaying comments.
    • Update the PostShow view to render the comments component and allow users to leave comments.
    • Implement live updates using Livewire.
  2. Implement categories and tags for organizing blog posts.

    • Create models and migrations for categories and tags.
    • Define relationships between the Category, Tag, and Post models.
    • Update the database schema and seed the categories and tags data.
    • Modify the views and components to display and filter blog posts by categories and tags.
  3. Enable social sharing of blog posts.

    • Integrate social sharing buttons for popular platforms like Facebook, Twitter, and LinkedIn.
    • Generate appropriate share links with the post's URL and title.
    • Add the social sharing buttons to the PostShow view.
  4. Test the blog thoroughly for functionality and user experience.

    • Conduct comprehensive testing of all features, including creating, editing, and deleting blog posts, authentication, and user management.
    • Test the blog across multiple devices and browsers to ensure responsiveness and compatibility.
    • Verify that the SEO enhancements are correctly implemented and functioning as expected.
  5. Gather feedback and make necessary refinements.

    • Solicit feedback from users or colleagues to identify any usability or functionality issues.
    • Address any reported bugs or usability concerns promptly.
    • Make necessary adjustments to improve the user experience and overall quality of the blog.
  6. Optimize performance and security.

    • Analyze and optimize the performance of your application, including database queries, code efficiency, and caching.
    • Implement security measures, such as input validation, CSRF protection, and user authorization checks, to ensure the safety of your blog.

Phase 5: SEO Enhancements

  1. Enhance SEO by generating search-friendly URLs and adding meta tags.
    • Customize the routes to generate SEO-friendly URLs for blog posts.
    • Update the views and Livewire components to include appropriate meta tags, such as title, description, and keywords.
    • Implement a sitemap.xml file to help search engines index your blog posts.
    • Consider implementing canonical URLs, structured data, and other SEO best practices to improve search engine visibility.

Phase 6: Unit Test

  1. Write Unit Test.
    • Post - Public Index.
    • Post - Public View.
    • Dashboard.
    • Post - Index.
    • Post - Create.
    • Post - View.
    • Post - Edit.
    • Comment - Create.

Phase 7: Refactor and Perform Enhancements

  1. Refractor Controller to Service Layer.

    • PostController.
    • CommentController.
  2. Refractor reusable VIew Component.

    • Post.
    • Comment.

Phase 8: Additional Features

  1. Post - Like and Count.

    • Create Like Model and Migration.
    • Create Like Controller.
    • Create Like Component.
    • Create Like Unit Test.
  2. Comment - Reply.

    • Able to reply to comment.
  3. Dashboard Notification.

    • Post - Like.
    • Post - Comment.
    • Comment - Reply.
  4. Search Feature using Laravel Scout.

    • Able to search post by title.
    • Able to search post by Category and Tags.
  5. Image functionality for blog posts.

    • compress image as thumbnail.
    • list - image thumbnail.
    • show - image original size.

About

GO-Blog is a Laravel-based project aimed at creating a powerful and user-friendly blogging platform. It provides a robust backend powered by PHP and the Laravel Framework, along with a modern front-end interface using Livewire.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages