Tutorials
News Portal Tutorial
This tutorial guides you through building a complete news portal application similar to popular news sites but with a simplified architecture. You'll implement features such as content management, user roles, comments, and analytics.
Project Overview
In this tutorial, we'll build a news portal application with both an admin panel and a public-facing website. The project will use Laravolt's built-in features to accelerate development while still providing a comprehensive learning experience.
Application Specifications
Actors (User Roles)
The application will involve four distinct user roles:
- Admin - Manages the platform and has access to all features
- Writer - Creates and manages news content
- Member - Registered users who can interact with content
- Guest - Anonymous visitors with limited permissions
User Stories
Admin Capabilities
- Moderate comments (approve, reject, delete)
- Manage member and writer accounts
- Access dashboard with application statistics and summaries
- (Advanced) Export news and comments to Excel
- (Advanced) Configure website settings like name, logo, and analytics
- (Advanced) Switch between multiple themes
Writer Capabilities
- Create, read, update, and delete news articles
- Access a personal dashboard with content statistics
- (Advanced) Receive email notifications for comments on their articles
Member Capabilities
- Edit personal profile information
- Add, edit, and delete their own comments
- Read news articles and browse content
Guest Capabilities
- Browse and read news articles
- Search for articles by keywords
- Filter articles by topic
- View comments
- Register for a member account with email verification
- Authenticate (login/logout)
- Recover forgotten passwords
Technical Concepts
Data Models
The application will use four primary models:
- User - Stores account information for all user types
- Post - Represents news articles
- Topic - Categorizes news articles
- Comment - Stores user comments on articles
Relationships
The application will implement these relationships:
- Member is-a User
- Writer is-a Member
- Writer has many Posts
- Member has many Comments
- Post belongs to Topic
- Post belongs to Writer
- Comment belongs to Member
Technical Requirements
- Admin panel built with Laravolt
- Public-facing website built with TailwindCSS
- CRUD operations for Post and Topic using AutoCRUD
- Dashboard charts created with Laravolt Chart
Development Roadmap
We'll approach this project in progressive levels, each designed to be demonstrated in a 7-minute YouTube screencast:
Level 1: Project Setup
The first screencast covers setting up the initial project:
- Create a new Laravel project
- Install and configure Laravolt
- Set up the development environment (database, config)
- Overview of the project structure
Level 2: Data Structure
This screencast focuses on building the data foundation:
- Create database migrations with proper relationships
- Implement models with appropriate traits (HasUlids, SoftDeletes)
- Define model relationships
- Run migrations and verify database structure
Level 3: Authentication & Authorization
This screencast covers user management:
- Configure authentication using Laravolt
- Set up the ACL system with roles (Admin, Writer, Member)
- Create permission enums for access control
- Implement policies for Post and Comment models
- Create seeders for roles and permissions
Level 4: Admin Panel - Topic Management
This screencast demonstrates building admin functionality:
- Implement AutoCRUD for topic management
- Create topic listing with sorting and filtering
- Build topic creation and edit forms
- Add validation rules for topic data
- Implement topic deletion with confirmation
Level 5: Admin Panel - Post Management
This screencast continues admin functionality:
- Build post management with rich text editor
- Create post listing with topic filters
- Implement featured image uploads
- Add post publishing workflow
- Set up post status management
Level 6: Admin Panel - Dashboard & Comments
This screencast completes the admin features:
- Create admin dashboard with statistics
- Build comment moderation system
- Implement user management interface
- Add simple analytics charts
- Create activity logs
Level 7: Public Website - Frontend
This screencast starts building the public site:
- Set up TailwindCSS for the public site
- Create responsive layouts
- Build homepage with featured posts
- Implement topic browsing pages
- Create article detail pages
Level 8: Public Website - Interactive Features
This screencast adds interactivity to the public site:
- Implement comment submission system
- Create user registration and profile pages
- Build search functionality
- Add topic filtering
- Implement pagination
Level 9: Testing & Quality Assurance
The final screencast focuses on ensuring quality:
- Configure PHPStan for code quality
- Create integration tests for core features
- Write unit tests for critical components
- Set up CI/CD pipeline configurations
- Add performance optimizations