# Desxpert Admin

Laravel 12 administration application for the Desxpert platform. It reads and manages the same MySQL database used by `desxpert-api`; it does not own a separate business schema.

## Local setup

1. Copy `.env.example` to `.env`.
2. Copy the `DB_CONNECTION`, `DB_HOST`, `DB_PORT`, `DB_DATABASE`, `DB_USERNAME`, and `DB_PASSWORD` values from `../desxpert-api/.env`.
3. Run `composer install`, `npm install`, and `npm run build`.
4. Run `php artisan key:generate` and `php artisan serve`.

Copy the `MAIL_*` settings from `desxpert-api/.env` so application approval and decline emails use the same SMTP provider as the API.

Do not create a separate application database and do not run schema migrations from this project. All shared schema migrations, including `admin_users`, remain owned and executed by `desxpert-api`.

## Create an administrator

Run `php artisan admin:create`. The command securely prompts for the email, name, and password, then creates an active System Admin in the dedicated `admin_users` table. Regular records in `users` cannot authenticate to the administration portal.

## Architecture

- Controllers handle HTTP input and responses.
- `AdminService` coordinates use cases.
- `AdminRepositoryInterface` and `AdminRepository` contain database queries.
- Eloquent models map directly to the existing API tables.
