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.

This guide walks you through setting up the CareerTrack API on your local machine — from cloning the repository and installing PHP dependencies to running database migrations and starting the Laravel development server. By the end you will have a fully functional API running at http://localhost:8000.

Prerequisites

Before you begin, make sure the following tools are installed on your system:
  • PHP 8.3+ — CareerTrack requires PHP 8.3 or higher (php -v to check)
  • Composer — PHP dependency manager (getcomposer.org)
  • Node.js — Required for building Vite front-end assets bundled with Laravel
  • Git — To clone the repository

Installation Steps

1

Clone the repository

Clone the project from GitHub and move into the project directory:
git clone https://github.com/ericcobasdev/careertrack-api.git && cd careertrack-api
2

Install PHP dependencies

Install all required PHP packages via Composer:
composer install
3

Set up the environment file

Copy the example environment file and generate a unique application key:
cp .env.example .env
php artisan key:generate
php artisan key:generate writes a 32-character random string to APP_KEY in your .env file. This key is used for encryption and must never be shared. See Configuration for a full breakdown of every environment variable.
4

Create the SQLite database file

The default configuration uses SQLite. Create the database file that Laravel expects:
touch database/database.sqlite
5

Run database migrations

Apply all migrations to create the application tables, including job_applications and users:
php artisan migrate
6

Seed sample data (optional)

Populate the database with sample records for development and testing:
php artisan db:seed
7

Start the development server

Launch the built-in Laravel development server:
php artisan serve
The API is now available at http://localhost:8000. All endpoints are prefixed with /api (e.g., http://localhost:8000/api/applications).
One-command setup: The composer.json setup script automates steps 2–6 in a single command. It runs composer install, copies .env.example to .env if it does not exist, generates the application key, runs migrations, installs Node dependencies, and builds front-end assets:
composer run setup
After it completes, run php artisan serve to start the server.

Verifying the Installation

Once the server is running, verify the API is responding by sending a registration request:
curl -s -X POST http://localhost:8000/api/auth/register \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{"name":"Test User","email":"test@example.com","password":"password","password_confirmation":"password"}'
A successful response returns a 201 Created status with a JSON body containing the new user and a Sanctum bearer token. If you receive an HTML error page, check that APP_KEY is set in your .env and that the database file exists.

Running Tests

CareerTrack ships with a PHPUnit test suite. Run it with either command:
php artisan test
composer run test
The composer run test script clears the config cache before running the suite, which is useful when environment values have changed between runs.

Build docs developers (and LLMs) love