Download the PHP package sylpi10/symfony-inertia-react-starter without Composer

On this page you can find all versions of the php package sylpi10/symfony-inertia-react-starter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package symfony-inertia-react-starter

Symfony + React SPA powered by Inertia.js, with SSR

A Symfony 8.1 starter with a React 19 + TypeScript front end, glued together by Inertia.js v3: you build a single-page app without writing an API. Controllers stay regular Symfony controllers, but instead of rendering Twig templates they return a React page + its props.

Included: Vite, Sass, server-side rendering, authentication (login, registration, password reset, email verification), stateless CSRF protection (no session for anonymous visitors), SEO (head tags per page, sitemap, robots.txt), an example admin CRUD, TypeScript types generated from PHP DTOs, functional tests, a Docker dev stack and a GitHub Actions CI.

Quick start

Open http://localhost:8000 and sign in with [email protected] / admin1234.

Needs PHP ≥ 8.4, Composer, Node 24 and the Symfony CLI. No PHP or Node on your machine? Use Getting started.

Requirements

Or only Docker: see Running with Docker.

Getting started

create-project installs the PHP dependencies, then runs composer setup, which:

  1. generates a fresh APP_SECRET in .env.dev (so that no two projects share the same one);
  2. runs the migrations, creating var/data_dev.db (SQLite);
  3. loads the fixtures: demo data + demo accounts;
  4. prepares the test database (var/data_test.db) the same way, so that php bin/phpunit works right away.

Then make the project yours: replace name and description in composer.json (they still read sylpi10/symfony-inertia-react-starter), and run composer update --lock to keep composer.lock in sync.

Prefer GitHub's Use this template button? Clone your new repository, then run the same steps by hand:

⚠️ composer setup is meant to run once: it resets both databases (dev and test) and replaces APP_SECRET.

Running in development

This starts the Symfony server in the background, along with the Vite dev server (hot reload), declared as a worker in .symfony.local.yaml.

Command What it does
make dev Starts the Symfony server + Vite in the background
make stop Stops the server and its workers
make logs Tails the server and Vite logs
make build Builds the client and SSR bundles (public/build, bootstrap/ssr)
make test Prepares the test database, then runs PHPUnit
make test-ssr Builds the assets, then checks the home page is server-rendered

Without make: symfony serve -d does the same as make dev. Without the Symfony CLI, run your PHP server and npm run dev in two terminals.

Open http://localhost:8000 and sign in with one of the demo accounts:

Account Password Role
[email protected] test1234 Regular user
[email protected] admin1234 ROLE_ADMIN: gets the Admin nav link

⚠️ localhost:5173 is Vite's asset server, not the app. Always browse through Symfony (port 8000).

Useful commands:

Command What it does
composer types Regenerates assets/types/generated.ts from PHP DTOs
npm run typecheck Type-checks the front end (tsc --noEmit)
npm run lint Checks the formatting of assets/ with Prettier
symfony console doctrine:fixtures:load -n Resets the database with demo data (deletes all users!)
/_profiler Symfony profiler: requests, SQL, emails sent in dev

SSR is off in development (no hot reload on the Node side). To check it: see SSR and production.

Running with Docker

A development stack that needs neither PHP nor Node on your machine: FrankenPHP for Symfony, and a Node container for Vite (hot reload included).

Then open http://localhost:8000, as without Docker.

Command What it does
make docker-up Builds and starts the containers
make docker-down Stops them (volumes are kept)
make docker-logs Follows the logs of both containers
make docker-fixtures Loads the fixtures in the Docker database
make docker-test Runs PHPUnit in the php container

Good to know:

Adding a page

1. A props DTO, marked #[TypeScript]:

2. The controller returns a page name + the DTO:

3. Generate the types: composer types

4. The page component, in assets/Pages/ (the name passed to render() is the file path):

No front-end route, no API call. Links between pages use <Link href="/contact"> from @inertiajs/react.

Example admin CRUD

/admin/technos manages the technos listed on the home page. It is a reference for the patterns you will reuse in your own CRUDs:

Pattern Where to look
Access control #[IsGranted("ROLE_ADMIN")] on Admin/TechnoController: anonymous → /login, non-admin → 403 error page
One input DTO, two uses TechnoInput with #[MapRequestPayload], shared by create (POST) and update (PUT)
One form page, two uses Pages/Admin/Technos/Form.tsx: form.post() or form.put() depending on the techno prop
Delete router.delete() after a confirm(), answered by a 303 redirect
Pagination Doctrine Paginator in TechnoRepository, ?page=N bound with #[MapQueryParameter]
Optimistic update Reordering with router.optimistic(...).patch(...): the row moves at once, Inertia rolls back on failure
Enum shared with TS MoveDirection (up / down), exported to generated.ts

Conventions

Project layout (short)

Testing

The test database is created by composer setup (or make test). If PHPUnit fails with no such table, it is missing: run make test. Run it again after adding a migration or changing the fixtures.

Functional tests live in tests/Controller/ and extend tests/InertiaWebTestCase.php, which talks to the app the way the Inertia client does:

Covered: pages and 404, SEO props and head tags, sitemap and robots.txt, CSRF, registration, email verification, login (case-insensitive email, throttling), password reset, and the admin CRUD including access control.

Continuous integration

.github/workflows/ci.yaml runs on every push to master and on pull requests, without Docker:

Documentation

Guide Contents
Architecture How Inertia works, page resolution, layouts, styles, images, full project structure
TypeScript types DTOs, #[TypeScript], composer types, shared props typing
Authentication, forms and security Login, registration, password reset, email verification, shared props, flash messages, CSRF, error pages, emails
SSR and production Enabling SSR, Node server, production build, asset versioning, deploy order, known limitations
SEO Head tags per page (SeoDto), indexing rules, share image, sitemap and robots.txt
Troubleshooting Common errors and their fixes

License

MIT


All versions of symfony-inertia-react-starter with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
ext-ctype Version *
ext-iconv Version *
ext-pdo_sqlite Version *
doctrine/doctrine-bundle Version ^3.3
doctrine/doctrine-migrations-bundle Version ^4.0
doctrine/orm Version ^3.7
nytodev/inertia-bundle Version ^3.1
pentatrion/vite-bundle Version ^8.2
phpdocumentor/reflection-docblock Version ^6.0
phpstan/phpdoc-parser Version ^2.3
symfony/console Version 8.1.*
symfony/dotenv Version 8.1.*
symfony/flex Version ^2
symfony/framework-bundle Version 8.1.*
symfony/http-client Version 8.1.*
symfony/mailer Version 8.1.*
symfony/property-access Version 8.1.*
symfony/property-info Version 8.1.*
symfony/rate-limiter Version 8.1.*
symfony/runtime Version 8.1.*
symfony/security-bundle Version 8.1.*
symfony/serializer Version 8.1.*
symfony/twig-bundle Version 8.1.*
symfony/validator Version 8.1.*
symfony/yaml Version 8.1.*
symfonycasts/reset-password-bundle Version ^1.25
symfonycasts/verify-email-bundle Version ^1.18
twig/extra-bundle Version ^2.12|^3.0
twig/twig Version ^2.12|^3.30
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package sylpi10/symfony-inertia-react-starter contains the following files

Loading the files please wait ...