🚀 Quick Start


System Requirements

  • PHP 8.2+ with extensions: mbstring, xml, curl, zip, gd

  • Composer for PHP dependency management

  • Node.js 18+ and npm for frontend build

  • MySQL 8.0+ or PostgreSQL 13+

  • Web server: Apache, Nginx, or built-in PHP server

Installation in 3 Steps

1. Clone and Install Dependencies

bash

git clone https://github.com/KolpakovK/statamic-base-template.git
cd statamic-base-template
composer install
npm install

2. Environment Setup

bash

cp .env.example .env
php artisan key:generate
php artisan statamic:install

3. Run the Project

bash

npm run dev     # Start development build
php artisan serve   # Start local server

Done! Your site is available at http://localhost:8000


⚙️ Detailed Configuration

Statamic Configuration

env

STATAMIC_LICENSE_KEY=your-license-key 
STATAMIC_STACHE_WATCHER=true 
STATAMIC_STATIC_CACHING_STRATEGY=full

🎨 Theme Customization

Via Admin Panel

  1. Log in to the admin panel at /cp

  2. Navigate to Globals → Theme Settings

  3. Adjust colors, fonts, and spacing

  4. Save changes

Via Code

Edit the resources/css/site.css file:

css

:root {
    --primary: #your-color;
    --secondary: #your-color;
    /* other variables */
}

🔧 Development

Development Commands

bash

npm run dev         # Development mode with hot reload
npm run build       # Production build
npm run preview     # Preview production build
composer test       # Run tests

Adding a New Block

  1. Create a blueprint: resources/blueprints/blocks/new-block.yaml

  2. Create a template: resources/views/blocks/new-block.blade.php

  3. Add to the block list in resources/blueprints/collections/pages.yaml

Creating a Component

bash

php artisan make:component YourComponent

🚀 Production Deployment

Deployment Preparation

bash

composer install --optimize-autoloader --no-dev
npm run build
php artisan config:cache
php artisan route:cache
php artisan view:cache

Web Server Configuration

Nginx

nginx

server {
    listen 80;
    server_name your-domain.com;
    root /path/to/your/project/public;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_index index.php;
        include fastcgi_params;
    }
}

Apache

apache

<VirtualHost *:80>
    ServerName your-domain.com
    DocumentRoot /path/to/your/project/public

    <Directory /path/to/your/project/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

🛠️ Maintenance and Updates

Regular Maintenance

  • Update dependencies monthly

  • Back up the database and files

  • Monitor logs for errors

  • Test performance

Getting Updates

bash

git pull origin main
composer update
npm update
npm run build