This directory contains standalone feature modules that can be integrated into any page of the website.
Location: /modules/blog
- Full-featured blog system
- Post management through admin panel
- Category and tag support
- SEO optimization
- Schema:
blog/schema.sql
Location: /modules/rss
- Automatic RSS feed generation
- Configurable feed settings
- Integration with blog and content pages
- Schema:
rss/schema.sql
Location: /modules/sitemap
- Dynamic XML sitemap generation
- SEO-friendly URL structure
- Automatic page discovery
- Schema:
sitemap/schema.sql
Each module follows a standardized structure:
module_name/
├── admin.php # Admin interface for content management
├── html.php # Frontend template
├── query.php # Database queries
├── schema.sql # Database structure
├── script.js # JavaScript functionality
└── style.css # Module styles
require_once 'modules/blog/html.php';Modules can be loaded dynamically based on SQL configuration:
INSERT INTO modules (name, enabled, position) VALUES ('blog', 1, 1);Modules can be accessed via API endpoints:
GET /api/modules/blog/posts
GET /api/modules/rss/feed
GET /api/modules/sitemap/xml
Each module includes test files and can be tested using:
./test.sh modules/module_name- Create module directory:
mkdir modules/your_module_name- Create required files:
- admin.php - Admin interface
- html.php - Frontend template
- query.php - Database queries
- schema.sql - Database structure
- script.js - JavaScript functionality
- style.css - Module styles
- Add database schema in schema.sql
- Implement admin interface
- Create frontend templates
- Add to module configuration in database
- Keep modules independent and self-contained
- Follow consistent naming conventions
- Include proper documentation
- Write unit tests
- Use prepared statements for database queries
- Implement proper error handling
- Follow security best practices
- Maintain backwards compatibility