Skip to main content
Quick Guide

Quick Guide

This quick guide condenses the course into a practical build and deployment checklist. Use it as a refresher once you have read the full topics.

Build checklist

  1. Install with Composer and set app.baseURL.
  2. Create the database and set credentials in .env.
  3. Write a migration for each table and run php spark migrate.
  4. Add routes for every public URL and protect admin groups with filters.
  5. Keep controllers thin; put data rules in models and reusable work in libraries or services.
  6. Render pages with views and escape every dynamic value with esc().
  7. Validate all input, use CSRF tokens, and handle uploads with strict rules.
  8. Store session state on the server and use flashdata for one-request messages.
  9. Cache public, repeatable pages and data; invalidate when records change.
  10. Turn on the debug toolbar in development and profile the slowest pages.
  11. Review the security checklist before launch.
  12. Test forms, sign-in, uploads, email, 404 pages, and mobile layouts.

Deploy checklist

composer install --no-dev --optimize-autoloader
php spark migrate --all
php spark cache:clear
CI_ENVIRONMENT = production
app.baseURL = 'https://example.com/'
  • Point the web server document root at public.
  • Give the web server write access to writable only.
  • Redirect HTTP to HTTPS and enable secure cookie flags.
  • Back up the database and files before each release.
  • Confirm logs are written and monitored.
  • Keep the previous release available for a quick rollback.
Deployment gets easier when it is boring: the same commands, the same checks, and a clear path back.