The first time I built a React app on Laravel, most of my time was spent simply building out the infrastructure related to authentication (login, registration, password reset, etc).
With a server rendered app, Laravel generates the authentication boilerplate for you. But for a 100% React frontend, all these pieces need to be built custom: an auth API (with JSON web tokens), routing, forms and form validation, persistent storage, and tests. There’s also aren’t many tutorials or example projects that show how it all works together.
Example To-Do App
So, now that I’m a little more familiar with these concepts, I re-purposed one of my own projects and released it as an example To Do app that includes the following:
- An auth API, using tymon/jwt-auth to manage the JSON Web Tokens.
- Routing with react-router (private, public and split routes).
- Feature tests.
- Database seeding.
- A base ApiController to help return standardized responses.
- Bootstrap for styling.