A beautiful, powerful, and feature-rich Content Management System contained in a single PHP file. Perfect for quick deployments, small to medium websites, and developers who want a lightweight yet comprehensive CMS solution.
- Single File Deployment - Everything in one
cms.phpfile - SQLite Database - No complex database setup required
- Beautiful Admin Interface - Modern, responsive design with Tailwind CSS
- WYSIWYG Editor - Rich text editing with toolbar formatting
- Media Management - Upload, organize, and link files with drag-and-drop
- Dynamic Table Creation - Create custom content types on the fly
- REST API - Full JSON API for external integrations
- Translation Management - Translate content into multiple languages
- Language Switching - Easy language management interface
- API Translation Support - Get translated content via API
- Default Language Fallback - Graceful handling of missing translations
- 10+ Pre-configured Languages - English, Spanish, French, German, Italian, Portuguese, Arabic, Chinese, Japanese, Russian
- Foreign Key Relationships - Link content between tables
- Media Field Types - Single and multiple file attachments
- Search Functionality - Full-text search across all content
- Field Type System - Text, Long Text, Numbers, Dates, Booleans, Media, Foreign Keys
- Responsive Design - Works perfectly on desktop, tablet, and mobile
- Setup Wizard - Guided installation process
- RESTful API - Complete CRUD operations
- JSON Responses - Structured data format
- CORS Support - Cross-origin requests enabled
- Media API - File management endpoints
- Translation API - Multi-language content access
- Search API - Query content programmatically
- Download the
cms.phpfile - Upload to your web server
- Visit the URL in your browser
- Follow the setup wizard
# Using wget
wget https://raw.githubusercontent.com/your-repo/cms.php
# Using curl
curl -O https://raw.githubusercontent.com/your-repo/cms.php- PHP 7.4+ (PHP 8.0+ recommended)
- SQLite PDO Extension (usually included)
- Web Server (Apache, Nginx, or built-in PHP server)
- Run Setup: Navigate to your CMS URL and complete the setup wizard
- Create Content: Use the admin interface to create your first table and content
- Configure Languages: Set up multi-language support if needed
- API Access: Start using the REST API for external integrations
// Create a blog
1. Add a new table called "articles"
2. Add fields: title (text), content (long text), author (text), date (date)
3. Start writing articles!// Translate your content
1. Go to Languages management
2. Activate desired languages (French, Spanish, etc.)
3. Edit any content record
4. Use the language tabs to add translations
5. Access via API with ?lang=fr parameter// Upload and link media
1. Go to Media section
2. Upload images, documents, videos
3. Create content with Media field types
4. Link media to your content records// Get all articles
fetch('/cms.php?api=records&table=articles')
.then(response => response.json())
.then(data => console.log(data.data));
// Get articles in French
fetch('/cms.php?api=records&table=articles&lang=fr')
.then(response => response.json())
.then(data => {
data.data.forEach(article => {
console.log('Original:', article.title);
console.log('French:', article.translations.title);
});
});// Get available languages
fetch('/cms.php?api=languages')
.then(response => response.json())
.then(data => console.log(data.data.languages));// Get all translations for a specific article
fetch('/cms.php?api=translations&table=articles&record_id=1')
.then(response => response.json())
.then(data => console.log(data.data.translations));// Get content for your website
$articles = json_decode(
file_get_contents('https://yoursite.com/cms.php?api=records&table=articles&lang=es'),
true
);
foreach ($articles['data'] as $article) {
$title = $article['translations']['title'] ?? $article['title'];
echo "<h2>{$title}</h2>";
}| Endpoint | Method | Description |
|---|---|---|
/cms.php?api=tables |
GET | List all tables and their structure |
/cms.php?api=records&table=X |
GET | Get records from table X |
/cms.php?api=record&table=X&id=Y |
GET | Get specific record by ID |
/cms.php?api=media |
GET | List media files |
/cms.php?api=search&table=X&q=Y |
GET | Search records in table X |
/cms.php?api=languages |
GET | Get available languages |
/cms.php?api=translations&table=X&record_id=Y |
GET | Get translations for record |
lang- Language code (fr, es, de, etc.) for translated contentlimit- Number of records to return (default: 10, max: 100)offset- Number of records to skip for paginationorder_by- Field to sort by (default: id)order_dir- Sort direction: ASC or DESC (default: DESC)
The CMS uses Tailwind CSS loaded from CDN. You can customize the appearance by:
- Modifying the CSS classes in the code
- Adding custom CSS styles
- Replacing Tailwind with your own CSS framework
Being a single file, you can easily:
- Add new field types
- Modify the API responses
- Customize the admin interface
- Add authentication methods
- Extend the translation system
- Password Hashing - Secure password storage with PHP's password_hash()
- SQL Injection Protection - All queries use prepared statements
- XSS Prevention - Output escaping with htmlspecialchars()
- File Upload Validation - MIME type and size restrictions
- Session Management - Secure admin session handling
- Small Business Websites - Quick content management
- Portfolio Sites - Showcase work with media galleries
- Blogs - Multi-language blogging platform
- API Backend - Headless CMS for mobile apps
- Prototyping - Rapid content modeling and testing
- Learning - Understanding CMS architecture
- Restaurant menus in multiple languages
- Product catalogs with images
- News sites with categories
- Event listings with details
- Team member profiles
- Project portfolios
- Dynamic Tables - User-defined content structures
- System Tables - users, media, languages, translations, metadata
- Foreign Keys - Relationships between content
- Media Linking - File attachment system
- MVC Pattern - Clean separation of concerns
- RESTful API - Standard HTTP methods and responses
- Responsive Design - Mobile-first approach
- Progressive Enhancement - Works without JavaScript
cms.php (Everything is here!)
βββ PHP Classes & Logic
βββ HTML Templates
βββ CSS Styles (Tailwind CDN)
βββ JavaScript Functions
βββ API Endpoints
βββ Database Schema
# Using PHP built-in server
php -S localhost:8000 cms.php
# Visit http://localhost:8000FROM php:8.1-apache
RUN docker-php-ext-install pdo pdo_sqlite
COPY cms.php /var/www/html/index.phpThis is a single-file project, making contributions straightforward:
- Fork the repository
- Modify the
cms.phpfile - Test your changes thoroughly
- Submit a pull request
- New field types
- Additional languages
- Security enhancements
- Performance optimizations
- UI/UX improvements
- API extensions
- β Multi-language translation system
- β Enhanced API with translation support
- β Improved WYSIWYG editor
- β Language management interface
- β Translation API endpoints
- β Interactive API documentation
- β Single-file CMS architecture
- β SQLite database integration
- β Admin interface
- β Content management
- β Media upload system
- β Basic REST API
- Large Files - PHP upload limits may restrict large media files
- Concurrent Editing - No real-time collaboration features
- Advanced Permissions - Single admin role only
- Database Backup - Manual SQLite file backup required
MIT License - feel free to use this CMS for personal and commercial projects.
- Built-in Help - Admin interface includes comprehensive guides
- API Docs - Interactive documentation within the CMS
- Code Comments - Well-documented source code
- GitHub Issues - Bug reports and feature requests
- Discussions - Community support and ideas
- Wiki - Extended documentation and tutorials
- User Roles - Multiple user types with permissions
- Plugin System - Extensible architecture
- Themes - Template system for different designs
- Backup/Export - Data export and import tools
- Advanced Search - Full-text search with filters
- Caching - Performance optimization features
- Multi-site Management - Manage multiple sites
- Workflow System - Content approval process
- SEO Tools - Built-in SEO optimization
- Analytics - Basic usage statistics
- Email Integration - Contact forms and notifications
Live Demo: View Demo Site
- Username:
demo - Password:
demo123
API Demo: API Explorer
Download the single cms.php file and start building your content-managed website in minutes!
# Quick start
curl -O https://raw.githubusercontent.com/your-repo/cms.php
php -S localhost:8000 cms.php
# Visit http://localhost:8000 and enjoy!Made with β€οΈ for developers who love simplicity without sacrificing power.