Running the backend
The webservice is a Laravel 11 application. It holds your data, exposes the REST API, and runs the agent. These steps get a development instance running.
Get the code and dependencies
Section titled “Get the code and dependencies”git clone https://github.com/trakli/trakli.gitcd trakli/webservicecomposer installConfigure the environment
Section titled “Configure the environment”Copy the example environment file and generate an application key.
cp .env.example .envphp artisan key:generateOpen .env and set your database connection and any other settings. Use real values only on the server, never in committed files.
APP_NAME=TrakliAPP_ENV=localAPP_URL=http://localhost:8000
DB_CONNECTION=mysqlDB_HOST=127.0.0.1DB_PORT=3306DB_DATABASE=trakliDB_USERNAME=your-db-user-hereDB_PASSWORD=your-db-password-hereRun migrations
Section titled “Run migrations”Create the schema.
php artisan migrateServe it
Section titled “Serve it”php artisan serveThe API is now available under /api. Authenticated routes live under /api/v1 and require a Sanctum bearer token. See Authentication.
Enable the agent (optional)
Section titled “Enable the agent (optional)”The agent is configured through the eloquent-agents package. To use it you supply a model provider and an API key, and you decide whether the agent may write. By default the agent can read but not write. See Configuration and API keys for the exact keys and the write opt-in.
Verify
Section titled “Verify”A quick way to confirm the server is up is the public info endpoint, which does not require auth:
curl http://localhost:8000/api/infoRun the tests
Section titled “Run the tests”php artisan test