Add a complete documentation site for Plugi with the following pages: - Readme.md: project overview, quick start, and key features - GettingStarted.md: installation guide, requirements, and first steps - Configuration.md: full reference for .env and config.php settings - Themes.md: theme structure, blocks, layouts, and asset compilation - Extensions.md: extension architecture, routes, blocks, and admin pages Also add index.html (Docsify entry point), _sidebar.md (navigation), favicon.ico, and .nojekyll to prevent GitHub Pages from interfering.
4.1 KiB
Getting Started
This guide will help you get Plugi up and running on your local machine or server.
Requirements
- PHP 8.2 or higher
- MySQL 8.0 or higher
- Apache or Nginx web server
- PDO MySQL extension enabled
Installation
Option 1: Manual Installation
-
Download Plugi and upload it to the webroot directory of your website.
-
Create the
.envfile by copying.env.example(if available) or creating one with the following variables:DB_HOST=mysql DB_NAME=plugi DB_USER=plugi DB_PASSWORD=plugi STAGE=developmentAdjust the database credentials to match your MySQL server.
-
Create the config file by copying
config.dist.phptoconfig.php:cp config.dist.php config.php -
Edit
config.phpand update the settings as needed. At a minimum, change the default login credentials in theauthsection. -
Set up the database. On first access, Plugi will create the required tables automatically. If the database schema changes in a future version, the admin panel will prompt you to update it.
-
Access the admin panel by navigating to
/adminon your website and logging in with the credentials you set inconfig.php(defaults areadmin/admin).
Option 2: Docker
The quickest way to get started is with Docker Compose:
-
Clone or download the Plugi repository.
-
Create the
.envfile with your environment variables (see above). -
Create
config.phpfromconfig.dist.php:cp config.dist.php config.php -
Start the services:
docker-compose up -dThis will start three services:
- Web (PHP 8.2 + Apache) on port
63000 - MySQL 8.0 database
- Adminer (database management) on port
63001
- Web (PHP 8.2 + Apache) on port
-
Open your browser and navigate to
http://localhost:63000/adminto access the admin panel.
First Steps
After logging in, you will see the Website Manager dashboard. From here you can:
- Create pages — Add new pages with custom routes and titles.
- Edit pages — Use the drag-and-drop Page Builder (powered by GrapesJS) to design your pages visually.
- Manage blocks — Drag blocks from the block library onto your pages. Blocks are defined by your active theme.
- Configure settings — Adjust general settings, select a theme, and manage extensions from the admin panel.
- Manage menus — Create and assign navigation menus.
- Upload files — Manage uploaded assets from the Files tab.
Project Structure
A typical Plugi project has the following structure:
project-root/
├── index.php # Entry point
├── config.php # Configuration (copied from config.dist.php)
├── .env # Environment variables
├── plugi-core/ # Core framework files
├── extensions/ # Extensions (plugins)
│ ├── plugi-ext-form/ # Form extension
│ └── plugi-ext-sitemap/ # Sitemap extension
├── themes/ # Themes
│ └── theme-one/ # Active theme
│ ├── blocks/ # Theme blocks
│ ├── layouts/ # Page layouts
│ ├── pages/ # Static pages (e.g. 404.php)
│ └── dist/ # Compiled CSS/JS
├── uploads/ # User-uploaded files
└── docs/ # Documentation
Production Checklist
Before deploying to production:
- Set
STAGE=productionin your.envfile to disable error reporting. - Change the default admin credentials in
config.php. - Enable caching in
config.php(cache.enabled => true) for better performance. - Ensure the
uploads/directory is writable but not executable. - Consider using
.htaccess(Apache) or Nginx config to serve/uploadsdirectly, bypassing PHP for faster file delivery.
Next Steps
- Learn how to configure Plugi in detail.
- Discover how to create custom themes.
- Build your own extensions to add functionality.