GithubHelp home page GithubHelp logo

turboho / react-laravel-boilerplate Goto Github PK

View Code? Open in Web Editor NEW

This project forked from huwcarwyn/react-laravel-boilerplate

0.0 0.0 0.0 1.95 MB

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

License: MIT License

PHP 69.52% JavaScript 29.48% Shell 0.35% Blade 0.64%

react-laravel-boilerplate's Introduction

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 Formik
  • 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.

Important note about development

Since this application takes advantage of webpack hashes to bust caches in production, the asset() and mix() helpers are used when loading front end assets. This means that it is important to set a correct value for ASSET_URL in your .env file. Otherwise Laravel will load assets from the wrong place.

If you are developing using npm run hot - make sure to set ASSET_URL to http://localhost:9000, otherwise for development set it to the root URL of your app.

In production you will need to set this value to the public root, that will usually be the same as your domain name.

react-laravel-boilerplate's People

Contributors

carwynstephen avatar dependabot[bot] avatar huwcarwyn avatar jmarikle avatar jonasva avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.