Installation

Installation and Setup

A practical step-by-step guide for installing LabSchool Exams locally with XAMPP and deploying it on a server.

Before you start

LabSchool Exams is a Laravel application. You need a Laravel-ready environment and a writable application directory.

  • PHP 8.2 or newer with common Laravel extensions enabled.
  • Composer for PHP dependencies.
  • Node.js and npm for frontend assets.
  • SQLite for a quick local install, or MySQL/MariaDB for XAMPP and production.
  • Write access to storage/ and bootstrap/cache/.

The project has one repeatable installer: php artisan app:install. It generates the app key when needed, runs migrations, seeds the core data, creates or updates the first administrator, and creates the public storage link.

A. Local installation

This flow is suitable for Windows/XAMPP development, testing, and demonstrations.

What to install on your computer

Before you install the application itself, prepare the computer that will host it. In a school lab this can be the teacher computer, the lab server, or another stable computer that stays open during the assessment.

  • Install XAMPP from apachefriends.org. XAMPP gives you Apache, PHP, MySQL/MariaDB, and phpMyAdmin in one package.
  • Install Composer from getcomposer.org. Composer downloads and prepares the Laravel/PHP dependencies.
  • Install Node.js LTS from nodejs.org. It includes npm, which builds the frontend files used by the interface.
  • Install Git from git-scm.com if you want to clone the repository instead of extracting a release zip.

A local installation does not mean that only one person can use it. If the host computer is connected to the same local network, other computers in the lab can open the application from the host computer address. This is useful for a school computer lab, an ICT training room, a language school, or a small internal seminar.

1. Place the project in XAMPP

Clone or extract the project under C:\xampp\htdocs\exams, then open PowerShell in that folder.

cd C:\xampp\htdocs\exams

2. Install dependencies

composer install
npm install

3. Create the environment file

Copy the example environment file. For the fastest local setup you may keep SQLite, or switch to MySQL/MariaDB if you want to use the XAMPP database server.

Copy-Item .env.example .env

Option A: quick local setup with SQLite

Keep DB_CONNECTION=sqlite. If the database file does not exist, create database/database.sqlite.

New-Item database\database.sqlite -ItemType File

Option B: local setup with XAMPP MySQL

Start Apache and MySQL from the XAMPP Control Panel. Create a database, for example exams, in phpMyAdmin and update these values in .env.

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=exams
DB_USERNAME=root
DB_PASSWORD=

4. Run the application installer

Choose the first administrator account while installing. Add --demo if you want the shared example quiz data.

php artisan app:install --admin-email=admin@example.test --admin-name="System Administrator" --admin-password="change-this-password"

php artisan app:install --demo --admin-email=admin@example.test --admin-password="change-this-password"

5. Build assets and open the app

npm run build
php artisan serve

Open http://127.0.0.1:8000 and sign in with the administrator account you created.

Permanent local network address with XAMPP

When the project is inside C:\xampp\htdocs\exams and Apache is running, the host computer can open http://localhost/exams. The rest of the computers in the same local network can open the application from the host computer IP, for example http://192.168.1.20/exams.

APP_URL=http://192.168.1.20/exams

Because the application is served from the /exams folder, confirm that public/.htaccess includes RewriteBase /exams immediately after RewriteEngine On. Keep the rest of the Laravel rewrite rules unchanged.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /exams
</IfModule>

For a stable lab address, reserve a fixed local IP for the host computer from the router or set a static IP, and allow Apache through the Windows firewall on the private network.

Temporary test address with artisan serve

If you only want a quick test without Apache, you can start Laravel with host binding and give the other computers the address with port 8000.

php artisan serve --host=0.0.0.0 --port=8000

Use this only on a trusted local network. For public access through the internet, use the server installation flow with HTTPS and production settings.

B. Server installation

Use this flow for a real deployment on shared hosting, a VPS, or a managed server.

1. Upload or pull the release

Place the application outside the public web root when possible. The web server document root should point to the Laravel public/ directory.

2. Prepare production environment values

Create .env from .env.example and set production values before running the installer.

APP_ENV=production
APP_DEBUG=false
APP_URL=https://your-domain.example
APP_SOURCE_URL=https://github.com/LabSchool-GR/Exams

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_user
DB_PASSWORD=your_password

SESSION_SECURE_COOKIE=true

3. Install production dependencies and assets

If you install from a prepared release package, production dependencies and built assets may already be included. If you install from source, run these commands on the server or in your build pipeline.

composer install --no-dev --prefer-dist --optimize-autoloader
npm ci
npm run build

4. Run the installer in production mode

php artisan app:install --force --admin-email=admin@example.com --admin-name="System Administrator" --admin-password="use-a-strong-password"

5. Cache configuration

php artisan optimize:clear
php artisan config:cache
php artisan route:cache
php artisan view:cache

6. Configure background tasks

The scheduler expires timed quiz attempts and prunes old personal data. Queues are used for mail-related jobs.

* * * * * php /path/to/exams/artisan schedule:run >> /dev/null 2>&1

php artisan queue:work --tries=3

Mail settings

Mail is used for feedback, teacher registration notifications, quota requests, and other administrative flows. The application can run without real mail during local testing, but a production installation should use working SMTP settings.

Local testing

For a local installation, you can keep emails in the log so you can test flows without sending real messages.

MAIL_MAILER=log
MAIL_FROM_ADDRESS="no-reply@example.test"
MAIL_FROM_NAME="${APP_NAME}"

SMTP example

For a real server, use the SMTP values given by your provider or organization. The example environment file includes a baseline suitable for Panhellenic School Network style deployments.

MAIL_MAILER=smtp
MAIL_HOST=websitemail.sch.gr
MAIL_PORT=25
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="your-address@sch.gr"
MAIL_FROM_NAME="${APP_NAME}"

Queued mail

If the queue connection is set to database, make sure a queue worker runs on the server. Otherwise, email jobs may stay pending in the jobs table.

QUEUE_CONNECTION=database

php artisan queue:work --tries=3

After changing mail settings, clear and rebuild the configuration cache on production.

php artisan optimize:clear
php artisan config:cache

After installation

  1. Sign in as the administrator and confirm that the dashboard loads.
  2. Check mail settings if you will use feedback, registration alerts, quota requests, or other email flows.
  3. Confirm that uploaded files and generated PDFs can be written under storage/.
  4. Create a small quiz, open a public or PIN-based participation flow, and submit one test attempt.
  5. On production, use HTTPS and keep APP_DEBUG=false.

Useful checks

For development or before publishing changes, run the project checks.

php artisan test
php vendor/bin/pint
npm run build