Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ericcobasdev/careertrack-api/llms.txt

Use this file to discover all available pages before exploring further.

CareerTrack is configured entirely through the .env file located at the project root. Laravel reads this file at boot time and makes every value accessible via the env() helper and the config/ directory. This guide covers the key variables you need to understand for local development and production deployments.

Environment File Setup

The repository ships with .env.example — a template containing every supported variable with safe defaults. Copy it to create your working .env:
cp .env.example .env
Next, generate a unique application key. This 32-character string is used by Laravel for encryption, cookie signing, and session security:
php artisan key:generate
The command writes the generated value directly to APP_KEY in your .env. Never commit the real .env to version control.

Key Environment Variables

APP_NAME
string
default:"Laravel"
The human-readable name of the application. Used in notifications and log entries.
APP_ENV
string
default:"local"
The current environment. Accepted values are local, production, and testing. Laravel enables additional debugging features when set to local.
APP_KEY
string
required
A 32-character base64-encoded encryption key. Generated by php artisan key:generate. The application will refuse to boot if this is empty.
APP_DEBUG
boolean
default:"true"
When true, Laravel renders full stack traces in error responses. Always set to false in production to avoid exposing internal details.
APP_URL
string
default:"http://localhost"
The base URL of the application. Used when generating absolute URLs and in Sanctum’s stateful domain resolution.
DB_CONNECTION
string
default:"sqlite"
The database driver to use. The default configuration uses sqlite. Supported values include sqlite, mysql, mariadb, and pgsql.
DB_DATABASE
string
default:"database/database.sqlite"
For SQLite, this is the path to the database file (relative to the project root). For MySQL or PostgreSQL, this is the database name.
LOG_CHANNEL
string
default:"stack"
The logging channel used to write application logs. The stack channel aggregates multiple drivers. Other options include single, daily, and stderr.
LOG_LEVEL
string
default:"debug"
The minimum severity level that gets written to the log. Standard levels from least to most severe: debug, info, notice, warning, error, critical, alert, emergency.

Switching to MySQL or PostgreSQL

The default SQLite setup is ideal for local development, but production environments typically use MySQL or PostgreSQL. Uncomment and update the relevant block in your .env:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=careertrack
DB_USERNAME=root
DB_PASSWORD=secret
For PostgreSQL, change DB_CONNECTION to pgsql and DB_PORT to 5432. After updating the file, re-run migrations against the new database:
php artisan migrate
When switching away from SQLite, you do not need the database/database.sqlite file. The DB_DATABASE value becomes the name of the database on your server rather than a file path.

Sanctum Configuration

CareerTrack uses Laravel Sanctum for API authentication. Sanctum supports two authentication strategies:
  • Token authentication — clients send a bearer token in the Authorization header. This is the default mode for mobile apps and third-party API consumers. No extra configuration is needed.
  • SPA (cookie) authentication — a first-party JavaScript SPA authenticates via encrypted session cookies. The stateful domains list in config/sanctum.php already includes localhost, localhost:3000, 127.0.0.1, and 127.0.0.1:8000, so no change is necessary for local SPA development.
For a purely token-based API (the most common case), no additional configuration is needed.

Production Checklist

Before deploying CareerTrack to a production environment, verify every item in this checklist:
  • Set APP_ENV=production
  • Set APP_DEBUG=false — stack traces must never be visible to end users
  • Set APP_URL to your public domain (e.g., https://api.myapp.com)
  • Replace SQLite with a production-grade database (mysql or pgsql)
  • Ensure APP_KEY is a securely generated value and is kept secret
  • Rotate APP_KEY only with a full understanding of the impact — existing encrypted values (sessions, cookies) will be invalidated

Build docs developers (and LLMs) love