A modern, responsive blog application built with Laravel 10 and Bootstrap 5. This full-featured blog platform includes post management, categorization, tagging, and a weather widget displaying international city weather data.
- Post Management: Full CRUD operations for blog posts with rich content support
- User Authentication: Secure login system with Laravel Breeze
- Categories & Tags: Organize posts with categories and flexible tagging system
- SEO-Friendly URLs: Automatic slug generation for posts and categories
- Draft System: Save posts as drafts before publishing
- Responsive Design: Mobile-first design using Bootstrap 5
- International Weather: Displays weather for 100+ cities across 10 countries
- Real-time Updates: Auto-refreshing weather data every 5 minutes
- Interactive Interface: Manual refresh capability and hover effects
- Local Time Display: Shows local time for each displayed city
- Laravel 10: Modern PHP framework with Eloquent ORM
- Bootstrap 5: Responsive CSS framework with custom styling
- Vite: Fast build tool for asset compilation
- Laravel Telescope: Application debugging and monitoring
- PHPUnit Testing: Comprehensive test suite
├── app/
│ ├── Http/Controllers/ # Application controllers
│ │ ├── HomeController.php # Public blog pages
│ │ ├── PostController.php # Post CRUD operations
│ │ ├── CategoryController.php # Category management
│ │ ├── TagController.php # Tag management
│ │ └── WeatherController.php # Weather API endpoints
│ ├── Models/ # Eloquent models
│ │ ├── Post.php # Blog post model
│ │ ├── Category.php # Post categories
│ │ ├── Tag.php # Post tags
│ │ ├── User.php # User authentication
│ │ └── WeatherCity.php # Weather cities data
│ └── View/ # View composers and components
├── database/
│ ├── migrations/ # Database schema migrations
│ └── seeders/ # Database seeders
├── resources/
│ ├── views/ # Blade templates
│ │ ├── components/ # Reusable components
│ │ ├── layouts/ # Layout templates
│ │ └── posts/ # Post-related views
│ └── js/ # Frontend JavaScript
├── routes/
│ ├── web.php # Web routes
│ └── api.php # API routes
└── tests/ # PHPUnit tests- PHP 8.1 or higher
- Composer
- Node.js & npm
- PostgreSQL or SQLite database
-
Clone the repository
git clone git@github.com:rlunar/valkey-demo-php-laravel.git cd valkey-demo-php-laravel -
Install PHP dependencies
composer install
-
Install Node.js dependencies
pnpm add -g pnpm
pnpm install
-
Environment configuration
cp .env.example .env
Configure environment variables in the
.envfileAPP_NAME=LaravelValkey APP_ENV=local APP_KEY= APP_DEBUG=true APP_URL=http://localhost LOG_CHANNEL=stack LOG_DEPRECATIONS_CHANNEL=null LOG_LEVEL=debug DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=laravel DB_USERNAME=root DB_PASSWORD= BROADCAST_DRIVER=log CACHE_DRIVER=file FILESYSTEM_DISK=local QUEUE_CONNECTION=sync SESSION_DRIVER=file SESSION_LIFETIME=120 MEMCACHED_HOST=127.0.0.1 REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 MAIL_MAILER=smtp MAIL_HOST=mailpit MAIL_PORT=1025 MAIL_USERNAME=null MAIL_PASSWORD=null MAIL_ENCRYPTION=null MAIL_FROM_ADDRESS="hello@example.com" MAIL_FROM_NAME="${APP_NAME}" AWS_ACCESS_KEY_ID= AWS_SECRET_ACCESS_KEY= AWS_DEFAULT_REGION=us-east-1 AWS_BUCKET= AWS_USE_PATH_STYLE_ENDPOINT=false PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_HOST= PUSHER_PORT=443 PUSHER_SCHEME=https PUSHER_APP_CLUSTER=mt1 VITE_APP_NAME="${APP_NAME}" VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}" VITE_PUSHER_HOST="${PUSHER_HOST}" VITE_PUSHER_PORT="${PUSHER_PORT}" VITE_PUSHER_SCHEME="${PUSHER_SCHEME}" VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
php artisan key:generate
-
Database setup
php artisan migrate
php artisan db:seed
-
Build assets
pnpm run build
or for development
pnpm run dev
-
Start the application
php artisan serve
Visit http://localhost:8000 to view the blog.
- Homepage: Browse published blog posts with pagination
- Post Reading: View individual posts with full content and metadata
- Categories: Browse posts by category
- Tags: Filter posts by tags
- Popular Posts: View most popular content
- Weather Widget: Check weather for international cities
- Post Management: Create, edit, and delete blog posts
- Category Management: Organize posts into categories
- Tag Management: Create and manage post tags
- Draft System: Save posts as drafts before publishing
GET /api/weather/random?count=5- Get weather for multiple random citiesGET /api/weather/single- Get weather for one random city
- users: User authentication and profiles
- posts: Blog posts with content, metadata, and relationships
- categories: Post categorization system
- tags: Flexible tagging system
- weather_cities: International cities for weather widget
- Posts belong to Users (author relationship)
- Posts belong to Categories
- Posts have many Tags (many-to-many)
- Weather cities are independent entities
Run the comprehensive test suite:
# Run all tests
php artisan test
# Run specific test files
php artisan test tests/Feature/PostTest.php
# Run with coverage
php artisan test --coverage# Watch for changes during development
pnpm run dev
# Build for production
pnpm run build# Create new migration
php artisan make:migration create_table_name
# Run migrations
php artisan migrate
# Rollback migrations
php artisan migrate:rollbackLaravel Telescope is included for application monitoring:
- Visit
/telescopewhen running in local environment - Monitor database queries, requests, and performance
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
- CSRF protection on all forms
- XSS prevention in content display
- Authentication middleware on admin routes
- Input validation and sanitization
- Secure password hashing with Laravel's built-in system
This project is open-sourced software licensed under the BSD 3-Clause License.