This repo is a Laravel 12 + Inertia React (TypeScript) starter kit with Fortify auth, Tailwind 4, Wayfinder route helpers, and a ready-made Chargily Pay test checkout flow. The goal: you can clone, follow the steps, and have a running app (including a working payment sandbox) even if you are new to the stack.
- Laravel 12, Fortify authentication (login/registration/2FA-ready) with database sessions
- Inertia + React + TypeScript + Tailwind 4 (Vite dev server)
- Wayfinder-generated typed routes/forms for the frontend
- SQLite by default for zero config local DB
- Chargily Pay test flow (subscribe page, redirect, success/failure callback, webhook)
- PHP >= 8.2 with
sqlite3extension - Composer
- Node.js >= 18 with npm
- Git
- (Optional, but needed for webhook tests) ngrok account + agent
Verify quickly:
php -v
composer -V
node -v
npm -vgit clone https://github.com/redaDevCraft/taleb.git
cd taleb
# PHP deps
composer install
# JS deps
npm installCreate your .env from the example and generate an app key.
cp .env.example .env # on Windows you can use: copy .env.example .env
php artisan key:generateMinimal .env values to check/update:
APP_NAME="Taleb"
APP_ENV=local
APP_DEBUG=true
APP_URL=http://127.0.0.1:8000
DB_CONNECTION=sqlite
# For sqlite we use the file below, no user/pass needed
SESSION_DRIVER=database
QUEUE_CONNECTION=database
MAIL_MAILER=log
# ensure the file exists
mkdir -p database
type NUL > database/database.sqlite # use: touch database/database.sqlite on macOS/Linux
# run migrations
php artisan migrate --forceUse two terminals:
Terminal A (PHP):
php artisan serve --host=0.0.0.0 --port=8000Terminal B (Vite + Wayfinder types):
npm run dev
php artisan wayfinder:generate --with-formOpen: http://127.0.0.1:8000
Tip: If you change env/config, clear caches:
php artisan optimize:clearThe project ships with:
- Public subscribe page:
GET /chargilypay/subscribe - Create checkout:
POST /chargilypay/redirect - Return URL (success/failure):
GET /chargilypay/back - Webhook:
POST /chargilypay/webhook(already excluded from CSRF)
In the Chargily dashboard (Test mode): copy your test_pk_* and test_sk_* keys.
In a new terminal:
ngrok http 8000Copy the HTTPS forwarding URL it prints, e.g.:
https://your-domain.ngrok-free.dev
Edit .env and add/update:
CHARGILY_PUBLIC_BASE_URL=https://your-domain.ngrok-free.dev
CHARGILY_PUBLIC_KEY=your_test_pk_here
CHARGILY_SECRET_KEY=your_test_sk_here
CHARGILY_MODE=test
# (Optional but keeps URLs consistent)
APP_URL=https://your-domain.ngrok-free.dev
Then reload config:
php artisan optimize:clear- Webhook URL:
https://your-domain.ngrok-free.dev/chargilypay/webhook - Success URL:
https://your-domain.ngrok-free.dev/chargilypay/back - Failure URL:
https://your-domain.ngrok-free.dev/chargilypay/back
- Make sure
php artisan serveandnpm run devare running. - Visit:
http://127.0.0.1:8000/chargilypay/subscribe - Click the checkout button; you’ll be redirected to Chargily’s hosted page.
- Complete/cancel the payment; Chargily will redirect you back to
/chargilypay/backand also POST to/chargilypay/webhook.
Open ngrok inspector: http://127.0.0.1:4040 and you should see POST requests to /chargilypay/webhook.
If Chargily says “webhook URL must be valid,” confirm CHARGILY_PUBLIC_BASE_URL is set, caches cleared, and the URL uses https.
Happy shipping!