Quick Start

The best way to get started fast with SaQle is to install the accompanying starter project hosted on github.

It is important that you install this project via composer

Requirements

  • A web server like Apache or Nginx installed on your system
  • Composer installed on your system
  • PHP 8.4 and above installed on your system

Get starter project

Inside the directory where you want to create a new application, run the following command in your terminal to download the starter project. Replace project_name with a name of your choosing

composer create-project mrogwang/saqle-project project_name

Update environment variables

Once the installation is complete, open the project_dir/env/development/.env file and update your environment variables to reflect your setup

project_dir/env/development/.env

                     APP_NAME="Your Application Name"

COOKIE_DOMAIN=your-domain.local
ROOT_DOMAIN=your-domain.local

DB_HOST=localhost
DB_USER_NAME=your-db-user
DB_PASSWORD=your-db-password
DB_NAME=your-db-name

EMAIL_USER_NAME=your-email-user
EMAIL_PASSWORD=your-email-password
EMAIL_HOST=your-email-host
EMAIL_PORT=your-email-port
EMAIL_SENDER_ADDRESS=your-email-address

DISPLAY_ERRORS=1
DISPLAY_STARTUP_ERRORS=1

JWT_KEY=your-jwt-key
JWT_TTL=3600

MEDIA_ENCRYPT_KEY=your-media-encryption-key
MEDIA_ENCRYPT_SALT=your-media-encryption-salt
                

Make migrations

Cd into project root and run the following command

php saqle make:migrations -n=Initial

Your project's initial migrations are created in: project_dir/databases/migrations

Your project's initial database snapshots are created in: project_dir/databases/snapshots

We will discuss these much more later

Migrate

Cd into project root and run the following command

php saqle migrate

If the migration runs successfully, you should have a database with your project's name and some tables that come with the starter project created in it

Make Super User

SaQle comes with an in built administrator panel that can help you start managing data immediately.

To log into this panel, you will need to create a super user account

Cd into project root and run the following command

php saqle make:superuser

This command runs interactively. Provide all the information required.

Once the command runs, you should have a super user account created with the user name and password you provided. You can log into the admin panel at: your-root-domain/saqle/signin

We will discuss the admin panels further in later sections

Open app in browser

If the steps above completed without any problems, your application will be available at: http://your-domain

Example: http://localhost

Congratulations! You have created your first application with SaQle