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.
118 lines
4.1 KiB
Markdown
118 lines
4.1 KiB
Markdown
# 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
|
|
|
|
1. **Download Plugi** and upload it to the webroot directory of your website.
|
|
|
|
2. **Create the `.env` file** by copying `.env.example` (if available) or creating one with the following variables:
|
|
|
|
```ini
|
|
DB_HOST=mysql
|
|
DB_NAME=plugi
|
|
DB_USER=plugi
|
|
DB_PASSWORD=plugi
|
|
STAGE=development
|
|
```
|
|
|
|
Adjust the database credentials to match your MySQL server.
|
|
|
|
3. **Create the config file** by copying `config.dist.php` to `config.php`:
|
|
|
|
```bash
|
|
cp config.dist.php config.php
|
|
```
|
|
|
|
4. **Edit `config.php`** and update the settings as needed. At a minimum, change the default login credentials in the `auth` section.
|
|
|
|
5. **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.
|
|
|
|
6. **Access the admin panel** by navigating to `/admin` on your website and logging in with the credentials you set in `config.php` (defaults are `admin` / `admin`).
|
|
|
|
### Option 2: Docker
|
|
|
|
The quickest way to get started is with Docker Compose:
|
|
|
|
1. **Clone or download** the Plugi repository.
|
|
|
|
2. **Create the `.env` file** with your environment variables (see above).
|
|
|
|
3. **Create `config.php`** from `config.dist.php`:
|
|
|
|
```bash
|
|
cp config.dist.php config.php
|
|
```
|
|
|
|
4. **Start the services**:
|
|
|
|
```bash
|
|
docker-compose up -d
|
|
```
|
|
|
|
This will start three services:
|
|
- **Web** (PHP 8.2 + Apache) on port `63000`
|
|
- **MySQL 8.0** database
|
|
- **Adminer** (database management) on port `63001`
|
|
|
|
5. **Open your browser** and navigate to `http://localhost:63000/admin` to 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:
|
|
|
|
1. Set `STAGE=production` in your `.env` file to disable error reporting.
|
|
2. Change the default admin credentials in `config.php`.
|
|
3. Enable caching in `config.php` (`cache.enabled => true`) for better performance.
|
|
4. Ensure the `uploads/` directory is writable but not executable.
|
|
5. Consider using `.htaccess` (Apache) or Nginx config to serve `/uploads` directly, bypassing PHP for faster file delivery.
|
|
|
|
## Next Steps
|
|
|
|
- Learn how to [configure](Configuration.md) Plugi in detail.
|
|
- Discover how to create custom [themes](Themes.md).
|
|
- Build your own [extensions](Extensions.md) to add functionality.
|