Go to file
Husnu Setiawan 62f96023e9
WMS API/PXG_2026_API/pipeline/head This commit looks good Details
add composer envoy
2026-02-18 14:32:52 +07:00
app init 2026-02-17 17:44:40 +07:00
bootstrap init 2026-02-17 17:44:40 +07:00
config init 2026-02-17 17:44:40 +07:00
database init 2026-02-17 17:44:40 +07:00
public init 2026-02-17 17:44:40 +07:00
resources init 2026-02-17 17:44:40 +07:00
routes init 2026-02-17 17:44:40 +07:00
storage init 2026-02-17 17:44:40 +07:00
tests init 2026-02-17 17:44:40 +07:00
.editorconfig init 2026-02-17 17:44:40 +07:00
.env.example init 2026-02-17 17:44:40 +07:00
.gitattributes init 2026-02-17 17:44:40 +07:00
.gitignore init 2026-02-17 17:44:40 +07:00
Envoy.blade.php add envoy and jenkinsfile 2026-02-18 14:28:48 +07:00
INSTALL_NOTES.md init 2026-02-17 17:44:40 +07:00
Jenkinsfile add envoy and jenkinsfile 2026-02-18 14:28:48 +07:00
MIDDLEWARE_NOTE.md init 2026-02-17 17:44:40 +07:00
README.md init 2026-02-17 17:44:40 +07:00
artisan init 2026-02-17 17:44:40 +07:00
composer.json add composer envoy 2026-02-18 14:32:52 +07:00
composer.lock add composer envoy 2026-02-18 14:32:52 +07:00
package.json init 2026-02-17 17:44:40 +07:00
phpunit.xml init 2026-02-17 17:44:40 +07:00
vite.config.js init 2026-02-17 17:44:40 +07:00

README.md

TOURNAMENT PXG 2026 — Laravel API Skeleton (matches Vue frontend contract)

This is a Laravel API skeleton you can copy into an existing Laravel 10/11 project. It matches the frontend contract used by the Vue project:

Endpoints (v1)

  • GET /api/v1/events/{event}
  • POST /api/v1/events/{event}/registrations
  • POST /api/v1/events/{event}/groups
  • GET /api/v1/groups/{code}
  • POST /api/v1/groups/{code}/join
  • POST /api/v1/registrations/{registration}/pay
  • POST /api/v1/pairing/lookup
  • POST /api/v1/pairing/otp/request
  • POST /api/v1/pairing/otp/verify
  • GET /api/v1/pairing/me (Bearer pairing_token)
  • POST /api/v1/webhooks/xendit

Environment variables (.env)

Add:

  • XENDIT_API_KEY=...
  • XENDIT_WEBHOOK_TOKEN=... (the token you set in Xendit dashboard)
  • WA_OTP_DRIVER=log (default) or your provider driver name
  • PAIRING_TOKEN_TTL_MINUTES=30
  • OTP_TTL_MINUTES=5

WhatsApp OTP

This skeleton provides an interface OtpSenderInterface + default driver LogOtpSender which writes OTP to logs. Replace it with your WhatsApp Business API provider integration.

Xendit

This skeleton includes a minimal XenditService stub. Replace createInvoice() with real Xendit Invoice API call and map the webhook payload accordingly.

Installation approach

  1. Create a fresh Laravel project (or use existing).
  2. Copy the app/, routes/, and database/migrations/ from this skeleton into your project.
  3. Run migrations:
    php artisan migrate
    
  4. Seed flights:
    php artisan pxg:seed-flights --event=1
    
  5. Configure .env and run:
    php artisan serve
    

Notes

  • Pairing token is an encrypted bearer token (not Sanctum), issued after OTP verification.
  • OTP uses hashing + rate-limits (basic) + attempt limits.
  • Pairing assignment logic is NOT implemented here (you can plug your pairing job/service later). The API returns pairing info only if a registration has been assigned to a flight via flight_members.

Admin Dashboard (API)

  • Login: POST /api/v1/admin/login with email+password -> returns Sanctum token
  • Default seeded admin:
    • email: admin@pxg.local
    • password: pxg2026admin Run:
php artisan db:seed --class=AdminUserSeeder