This repository contains the backend API for E.L.I.A.S. (Event & Logic Intelligent Assistant System). It connects with the frontend (Vue.js) app. It has secure endpoints, event logic and a real-time AI Helpdesk.
The code uses a Service Layer approach (for example HelpdeskService, EventService, AuthService) to keep business logic separate from the HTTP controllers and make the codebase easier to maintain. External integrations (like OpenAI) are separated into dedicated integration classes.
- Framework: Laravel 12 (PHP 8.4+)
- Database: SQLite (local development)
- Authentication: Laravel Sanctum (Bearer token)
- AI Engine: OpenAI API (
gpt-4o-mini, SSE stream) - Advanced AI features:
- Server-sent Events (SSE) for real-time text streaming.
- Context-aware prompt engineering (Retrieval-Augmented Generation basics)
- Multilingual support with strict data integrity rules.
- Human-agent handoff logic (
[AGENT]trigger).
Follow these steps in your terminal to run the backend:
git clone https://github.com/kokenydaniel/elias-backend.git
cd elias-backend
composer installMake a copy of the example configuration file:
cp .env.example .env
php artisan key:generateOpen the new .env file and set the required variables:
Required
OPENAI_API_KEY=...
Recommended
FRONTEND_URL=http://localhost:5173(used for password reset links)
Optional
OPENAI_MODEL=gpt-4o-miniOPENAI_TEMPERATURE=0.2
The system uses an SQLite database. You do not need an SQL server. Run this to create tables and load test accounts:
php artisan migrate:fresh --seedphp artisan serveThe API now listens at http://localhost:8000/api.
After you seed the database, you can log in on the frontend (or in Postman) with these accounts:
The universal password for ALL accounts is: password123
User accounts (with calendar events):
- Email:
marcus@elias.com(Has ONLY English events - good for testing AI rules) - Email:
diana@elias.com(Has ONLY Hungarian events) - Email:
charlie@elias.com(Has MIXED English & Hungarian events) - Email:
user@elias.com(Empty calendar for fresh testing)
Agent accounts (Helpdesk dashboard):
- Email:
agent@elias.com - Email:
alex.agent@elias.com
This project runs locally. You do not need a real SMTP server to test password reset emails. The app uses Laravel's log mailer.
How to test it for evaluation?
- Click "Forgot password" on the frontend and type and existing email address.
- Open the
storage/logs/laravel.logfile in the backend folder. - Scroll to the bottom of the file. You will see the generated email with HTML code. Find the link
http://localhost:5173/reset-password?token=... - Open this link in your browser to set a new password!
You can find the documentation and ready-to-test requests (with payload examples) in the ELIAS_API_Collection.json Postman Collection file in the project root.
Optional (alternative format): docs/openapi.yaml
How to use:
- Open the Postman app.
- Click the
Importbutton. - Upload the
ELIAS_API_Collection.jsonfile. - Log in at the
/loginendpoint. Copy the token. - Go to the Collection's
Variablestab and paste the token into thetokenvariable. - Now you can test the protected endpoints.
- MFA: If the user has MFA enabled,
/loginreturns a temporary token that can only be used forPOST /verify/mfa. - Helpdesk streaming:
POST /helpdesk/messagescan return:- JSON (if the conversation is not handled by the bot), or
text/event-stream(SSE) when the bot is handling the conversation and streams its reply.