Skip to content

Add first-class Vite frontend scaffolding for React, Vue, Svelte, and Tailwind#258

Merged
techmahedy merged 16 commits intodoppar:3.xfrom
techmahedy:techmahedy-3.x
Apr 26, 2026
Merged

Add first-class Vite frontend scaffolding for React, Vue, Svelte, and Tailwind#258
techmahedy merged 16 commits intodoppar:3.xfrom
techmahedy:techmahedy-3.x

Conversation

@techmahedy
Copy link
Copy Markdown
Member

@techmahedy techmahedy commented Apr 26, 2026

This PR adds first-class frontend scaffolding to Doppar with:

  • php pool frontend:install --force (passing force will override existing app and welcome files)
  • php pool frontend:uninstall
  • native Vite runtime support through vite()
  • resources/client as the frontend source directory
  • React/Vue/Svelte/Vanilla setup support
  • Tailwind and Bootstrap setup options
  • production fallback to public/build

What To Test

Please verify:

  • the install command works interactively
  • generated files are correct
  • dev mode works with npm run dev
  • production build works with npm run build
  • Tailwind classes compile correctly
  • vite() falls back to built assets when the dev server is stopped
  • uninstall removes the scaffold cleanly

Fresh Install Flow

Start from the project root:

php pool frontend:install

This will start like this way:
image

The layout should contain a Vite call similar to:

#vite('resources/client/js/main.tsx')

or the raw helper form if you are testing directly:

[[! vite('resources/client/js/main.tsx') !]]

Dev Mode Test

Start Doppar:

php pool server:start

Start Vite:

npm run dev

Open the app in the browser:

http://localhost:8000

Expected result:

  • the client frontend should render
  • page navigation should work
  • styles should be visible

Build the frontend:

npm run build

Uninstall Test

Run:

php pool frontend:uninstall

Optional:

php pool frontend:uninstall --clean-node-modules

Expected result:

  • scaffolded frontend files should be removed or restored from backup
  • resources/client should be cleaned up if it did not exist before install
  • public/build should be removed when owned by the scaffold lifecycle
  • layout patches should be removed

Suggested Reviewer Path

For the fastest review:

  1. Run php pool frontend:install
  2. Start php pool server:start
  3. Start npm run dev
  4. Visit /,
  5. Stop Vite
  6. Run npm run build
  7. Reload /
  8. Run php pool frontend:uninstall

If all of the above works, this PR is behaving as intended.

For PUT PATCH DELETE POST request

use csrf token like this way

fetch('/posts', {
    method: 'POST',
    headers: {
        'Content-Type': 'application/json',
        ...(window.__DOPPAR_FRONTEND__?.headers ?? {}),
    },
    body: JSON.stringify({ title: 'Test' }),
});

@techmahedy techmahedy requested a review from rrr63 April 26, 2026 06:17
@techmahedy techmahedy added the feat new feature label Apr 26, 2026
@techmahedy techmahedy merged commit 77ecd90 into doppar:3.x Apr 26, 2026
25 checks passed
@rrr63 rrr63 removed their request for review April 26, 2026 19:14
@rrr63
Copy link
Copy Markdown
Member

rrr63 commented Apr 26, 2026

thank you @techmahedy , good job ! huge feature

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants