owenchen / react-laravel-boilerplate

A Laravel REST API backend with React/Redux/Redux-form, hot module reloading in development and route-level code splitting

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Laravel Boilerplate

Build Status

This is the boilerplate that I personally use for getting projects off the ground quickly using my favourite stack of technologies. It uses Laravel as a backend API service, and has a React single page application in the front end.

Features

  • Laravel Passport API authentication
  • Route level code splitting using React Lazy/Suspense
  • Login/signup functionality implemented and tested
  • Webpack configuration for development and production
  • React/Redux single page application using React Router
  • Some basic components already built in resources/assets/js/components
  • Simple form building using Redux Form
  • Component library and interactive component building via Storybook
  • Hot module reloading for your React components using Webpack Dev Server and React Hot Module Reloader
  • Tailwind CSS for utility class styling (see https://tailwindcss.com)
  • Support for scoped styling using React CSS modules using Gajus React CSS Modules
  • Continous build integration via Travis CI
  • Automatic code style fixing with Prettier

Installation

I personally use Vagrant and Homestead, so these installation instructions assume that you use Homestead as well, but the project's dependencies are very similar to the base Laravel installation, so if you use something else to develop locally, the instructions shouldn't change too much.

  • Clone the repository using git clone https://github.com/huwcarwyn/react-laravel-boilerplate
  • Fill out a .env file in the project root using the .env.example file as a template
  • Install composer dependencies using composer install
  • Run php artisan key:generate php artisan migrate php artisan passport:install and php artisan storage:link
  • Install NPM dependencies using npm install
  • Make sure to create two databases, one main and one for running the tests, then run php artisan migrate
  • If you want to use the webpack dev server, make sure that the proxy entry in the weback.dev.js points to the server that's running your Laravel installation.

About

A Laravel REST API backend with React/Redux/Redux-form, hot module reloading in development and route-level code splitting

License:MIT License


Languages

Language:PHP 67.6%Language:JavaScript 32.0%Language:HTML 0.4%