Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel + Inertia SaaS Starter

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.


0) What you get

  • 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)

1) Prerequisites (install these first)

  • PHP >= 8.2 with sqlite3 extension
  • 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 -v

2) Clone & install dependencies

git clone https://github.com/redaDevCraft/taleb.git
cd taleb

# PHP deps
composer install

# JS deps
npm install

3) Environment file

Create 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:generate

Minimal .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

4) Database (SQLite, zero config)

# 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 --force

5) Run the app (development)

Use two terminals:

Terminal A (PHP):

php artisan serve --host=0.0.0.0 --port=8000

Terminal B (Vite + Wayfinder types):

npm run dev
php artisan wayfinder:generate --with-form

Open: http://127.0.0.1:8000

Tip: If you change env/config, clear caches:

php artisan optimize:clear

6) Chargily Pay (test mode) – full walkthrough

The 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)

6.1 Get your test keys from Chargily

In the Chargily dashboard (Test mode): copy your test_pk_* and test_sk_* keys.

6.2 Start ngrok (needed so Chargily can hit your webhook)

In a new terminal:

ngrok http 8000

Copy the HTTPS forwarding URL it prints, e.g.:

https://your-domain.ngrok-free.dev

6.3 Set .env for Chargily

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

6.4 Configure URLs in Chargily dashboard (Test mode)

  • 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

6.5 Trigger a payment

  1. Make sure php artisan serve and npm run dev are running.
  2. Visit: http://127.0.0.1:8000/chargilypay/subscribe
  3. Click the checkout button; you’ll be redirected to Chargily’s hosted page.
  4. Complete/cancel the payment; Chargily will redirect you back to /chargilypay/back and also POST to /chargilypay/webhook.

6.6 Inspect webhook calls

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!

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages