Create a lightweight, secure, and fast blogging platform called "GreenBlog" that serves as a minimalist alternative to WordPress. The solution should:
- Use PHP and SQLite with ADODB for database operations
- Generate static HTML files for performance
- Require minimal server configuration
- Be easily installable in an Apache vhost
- Include a simple admin interface for creating and managing posts
- Prioritize security, simplicity, and speed
- PHP 7.4+ (compatible with PHP 8.x)
- SQLite 3 database
- ADODB library for database abstraction
- Apache web server compatibility
- No JavaScript frameworks required (vanilla JS only where necessary)
- Minimal external dependencies
- Single setup script that:
- Creates necessary database structure
- Configures blog name, admin credentials, and basic settings
- Sets appropriate file permissions
- Generates initial static files
- Provides clear success/error messages
- Should work with standard Apache configurations without special modules
- No command-line operations required for end users
- File-based SQLite database for content storage
- ADODB for secure database operations
- Static file generation system that creates HTML files for:
- Homepage/index (with pagination)
- Individual blog posts
- Category/tag pages
- Archive pages
- Simple template system with minimal, clean design
- Caching mechanism for optimal performance
- Secure login system with password hashing
- Basic WYSIWYG or Markdown editor for post creation
- Post management (create, edit, delete)
- Category/tag management
- Media upload capability (images only)
- Option to manually regenerate static files
- Basic site settings configuration
- Input validation and sanitization
- Protection against SQL injection (via ADODB)
- XSS prevention
- CSRF protection
- Secure password handling
- File upload validation
- Rate limiting for login attempts
- Static file generation for all public-facing pages
- Minimal database queries
- Efficient caching system
- Optimized image handling
- Low memory footprint
- User uploads files to server
- Navigates to setup.php
- Enters blog name, admin username, password, and email
- Setup script creates database, tables, and initial configuration
- Static files are generated
- User is redirected to admin login
- Admin can create, edit, and delete posts
- Posts support:
- Title
- Content (formatted text)
- Categories/tags
- Featured image
- Publication date
- Draft/published status
- When a post is published or updated, static files are regenerated
- Clean, responsive design
- Blog homepage with recent posts
- Individual post pages
- Category/tag filtering
- Simple search functionality
- Pagination
- RSS feed
greenblog/
├── admin/ # Admin interface files
│ ├── index.php # Admin dashboard
│ ├── login.php # Login page
│ ├── posts.php # Post management
│ ├── settings.php # Site settings
│ └── media.php # Media management
├── includes/ # Core functionality
│ ├── config.php # Configuration file (generated during setup)
│ ├── db.php # Database connection using ADODB
│ ├── functions.php # Helper functions
│ ├── auth.php # Authentication functions
│ └── static-generator.php # Static file generation logic
├── templates/ # HTML templates
│ ├── index.template.php # Homepage template
│ ├── post.template.php # Single post template
│ ├── category.template.php # Category page template
│ └── admin/ # Admin templates
├── static/ # Generated static files (created by the system)
├── uploads/ # Media uploads
├── assets/ # CSS, JS, and images
│ ├── css/
│ ├── js/
│ └── images/
├── setup.php # Installation script
├── index.php # Front controller (redirects to static files)
└── .htaccess # Apache configuration
- Prioritize simplicity and readability over complex features
- Follow secure coding practices throughout
- Minimize external dependencies
- Ensure compatibility with standard shared hosting environments
- Document code thoroughly
- Implement proper error handling and logging
- Create a system that's easy to maintain and extend
- Complete source code for the GreenBlog system
- Installation and usage documentation
- Security considerations and best practices
- Sample blog with demonstration content
- Set up the basic project structure
- Implement the database schema and ADODB integration
- Create the setup script
- Develop the admin interface
- Implement the static file generation system
- Create front-end templates
- Add security features
- Optimize performance
- Test thoroughly in various environments
This lightweight blogging platform should provide a simple, secure alternative to WordPress for users who need a basic blog without the complexity and resource requirements of larger CMS systems.