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
- Install with Composer and set
app.baseURL. - Create the database and set credentials in
.env. - Write a migration for each table and run
php spark migrate. - Add routes for every public URL and protect admin groups with filters.
- Keep controllers thin; put data rules in models and reusable work in libraries or services.
- Render pages with views and escape every dynamic value with
esc(). - Validate all input, use CSRF tokens, and handle uploads with strict rules.
- Store session state on the server and use flashdata for one-request messages.
- Cache public, repeatable pages and data; invalidate when records change.
- Turn on the debug toolbar in development and profile the slowest pages.
- Review the security checklist before launch.
- 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
writableonly. - 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.