react php starter github
React php starter github
Starter template for react and webpack.
Just clone this repo and change the origin git remote.
Installation via Vagrant
It automatically recompiles and refreshes the page when files are changed.
Hot Module Replacement development server
It automatically recompiles when files are changed. When a hot-replacement-enabled file is changed (i. e. stylesheets or React components) the module is hot-replaced. If Hot Replacement is not possible the page is refreshed.
Hot Module Replacement has a performance impact on compilation.
Production compilation and server
The server is at lib/server.js
The production setting builds two configurations: one for the client ( build/public ) and one for the serverside prerendering ( build/prerender ).
Legacy static assets
Assets in public are also served.
After a production build you may want to visualize your modules and chunks tree.
Loaders and file types
Common changes to the configuration
Add more entry points
(for a multi page app)
Switch devtool to SourceMaps
Change devtool property in webpack-dev-server.config.js and webpack-hot-dev-server.config.js to «source-map» (better module names) or «eval-source-map» (faster compilation).
SourceMaps have a performance impact on compilation.
Enable SourceMaps in production
SourceMaps have a performance impact on compilation.
Coffeescript is not installed/enabled by default to not disturb non-coffee developer, but you can install it easily:
Copyright (c) 2012-2015 Tobias Koppers
About
[OUTDATED] Starter template for React with webpack. Doesn’t focus on simplicity! NOT FOR BEGINNERS!
React php starter github
This is a boilerplate React application that I use to start new projects. It uses webpack to build the JavaScript bundle file and PHP for the back-end API. Inspired by Christian Alfoni’s ultimate webpack setup.
React apps are often served using a node server like Express. However, in my case I wanted to use Apache because we use PHP to manage user authentication. I know there are packages that theoretically can make Express serve PHP, but it was easier to just use our existing Apache server.
This happens to be my specific use case at the moment, but this project could easily be adapted to use a node server instead.
I wanted a setup that would enable the following features:
The project is structured like this:
The public directory is the web root. Configure the server to serve files from there. The build directory is where the webpack output files go. This directory is ignored by git.
The «scripts» section of the package.json file contains the build scripts. When you first checkout the project you’ll need to run npm install to get all the node modules used.
For development type:
The development build runs webpack in watch mode. Whenever you save changes to a file in the src folder it rebuilds the bundle.
For production type:
About
A boilerplate React application that I use to start new projects. It uses webpack to build the JavaScript bundle file and PHP for the back-end API.
React php starter github
The web’s most popular front-end template for building web applications with React, Relay, and GraphQL.
This project was bootstrapped with React Starter Kit. Be sure to join our Discord channel for assistance.
IMPORTANT: Ensure that VSCode is using the workspace versions of TypeScript and ESLint.
Compile and deploy the app by running:
Anyone and everyone is welcome to contribute. Start by checking out the list of open issues marked help wanted. However, if you decide to get involved, please take a moment to review the guidelines.
Copyright © 2014-present Kriasoft. This source code is licensed under the MIT license found in the LICENSE file.
Made with ♥ by Konstantin Tarkus (@koistya, blog) and contributors.
About
React Starter Kit — front-end starter kit using React, Relay, GraphQL, and JAM stack architecture
ReactPHP
We’ve verified that the organization reactphp controls the domain:
reactphp.org
Pinned
Event-driven, non-blocking I/O with PHP.
ReactPHP’s core reactor event loop that libraries can use for evented I/O.
Event-driven readable and writable streams for non-blocking I/O in ReactPHP.
Promises/A implementation for PHP.
Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
Event-driven, streaming HTTP client and server implementation for ReactPHP.
Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP.
2 Updated Sep 11, 2021
Event-driven, streaming HTTP client and server implementation for ReactPHP.
9 Updated Sep 1, 2021
Promises/A implementation for PHP.
6 Updated Aug 31, 2021
0 Updated Aug 7, 2021
Source code of reactphp.org.
0 Updated Aug 7, 2021
ReactPHP’s core reactor event loop that libraries can use for evented I/O.
3 Updated Aug 7, 2021
Event-driven, non-blocking I/O with PHP.
0 Updated Jul 11, 2021
A trivial implementation of timeouts for Promises, built on top of ReactPHP.
0 Updated Jul 11, 2021
Event-driven UDP client and server sockets for ReactPHP.
2 Updated Jul 11, 2021
Event-driven library for executing child processes with ReactPHP.
1 Updated Jul 11, 2021
People
Top languages
Most used topics
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
React php starter github
Open Source Universal React Redux GraphQL Boilerplate
This repository contains the source code for React-Starter-Kit. This documentation will cover the installation on your machine, project architecture, unit testing and working with the app in general.
This is a Universal React Redux GraphQL Node app.
YouTube Video Tutorials
Introduction (Getting started)
Before proceeding, please ensure you have the following software installed on your computer.
Please fork a copy of this repository. Forking a repository allows you to freely experiment with changes without affecting the original project. Alternatively download or clone the master branch.
This should launch the application and start running on: http://localhost:3000/
For specific versions of dependencies being used please reference the ‘package.json’ file within the main project directory.
Within the main project directory ‘src’ (source) folder, you will find the following folders:
This folder contains important files that are referenced throughout the app.
This folder contains our source code.
Please read the information below before making any changes to this project. You can reference this to gain an understanding of our design patterns, and help you find/write new code.
Inside the ‘src’ folder
Any actions we create should be exported from this file. (incl async)
This folder contains code that is shared. For example form inupt types or form validation.
This folder contains components which are not connected to the store. For example, you can find the header & footer components here.
We are using the axios library to handle our requests both on the server & client.
I have created an axios instance with a ‘baseURL’ for our main API. This means when making a call we only need to supply the route and body of our request.
Please see the example:
Please note: The ‘baseURL’ is defined within the ‘webConfig’ file. If you need to make a request to a completely different api, use axios without our instance.
We use layout components to render our routes. Upon configuration, we can define a unique layout component for any route. This can be useful for landing pages or pages that require unique functionality.
Please note that our routes will be rendered wherever we place the following code:
This folder is self-explanatory.
Please maintain the proper naming conventions. For example, ‘namePage’.
Whilst most of our code is standard, please note the special ‘loadData’ function that is exported.
As you know, this is a universal application, which means that we need to configure our pages to run on both the server and client.
The ‘loadData’ function is used to tell the server what calls need to be complete before throwing down the initial html to the browser.
This folder is self-explanatory.
Please maintain the proper naming conventions. For example, ‘nameReducer’.
Before we create a store, we combine our reducers. Please ensure any new reducers are imported into the main ‘index’ file within the directory and added to the combine reducers method/object.
You can imagine this as the default layout of our application.
This file is self-explanatory.
Although we are using ‘React Router 4’ as this is a universal app, I am using the static router.
This is because we need to handle two types of routing as it needs to run on both the client and the server.
More information can be found:
To deploy the app, simply follow the steps:
We are using ‘nodemailer’ to handle the process of sending emails.
We have already intergrated into the project. See ‘src/client/pages/contactPage.js’ and the ‘/sendmail’ route within our server file.
Throughout the project we reference a single font family ‘gt_walsheim’, but have multiple font weights.
We have the following weights included within the project:
Ultra Thin: 100 Thin: 200 Light: 300 Regular: 400 Medium: 500 Bold: 700 Ultra Bold: 900
Please reference ‘src/assets/fonts/fonts.css’ for more.
Reference a background image within css
Please ensure you copy all your images into the graphics folder. Whenever you compile the scss, webpack will prefix your path with the root domain defined within the ‘webConfig’ file.
To reference an image within css, please use the example below:
Reference a image within HTML/components
There are a number of different methods that can be used to include graphics within our components. However once you begin using more complex routes, you might find some paths breaking.
The solution is to use absolute paths. This means that we prefix with the enviroment url. Please reference the example below:
Please note: ensure you have imported ‘webConfig’ before using it.
You may wish to implement a carousel within the website.
Whilst this is slightly more complex because this is a universal app, please reference the link below.
This app uses ‘react-slick’. The relevant dependencies and css have already been included within the project.
We are using ‘Redux-form’ throughout our application. This has made it simple to apply proper validation (inclu async), two-way data binding (initialize from store), and write cleaner, more reusable code (pre-defined input types & validation etc..).
We are currently exporting constants for the following field types:
Please ensure you export new constants from this file if you require any new field types. It is important to be aware that the styles for these inputs can be found within ‘src/assets/scss/base/_forms.scss’ and that each have multiple variations in terms of both functionality and design determined by the presence of additional classes.
Be careful when manipulating the mark-up of these constants, as these field types are used throughout the application.
These input types can be utilized by passing the relevant const through as a prop to each ‘Field’ element as a ‘component’ within ‘Redux-form’.
We are using SCSS (CSS pre-processor/bracketed version of SASS) to enable us to write cleaner and more reusable css code.
Our main ‘styles.scss’ is compiled upon each save, once the project has been started from your terminal/cmd. Whilst the resulting ‘styles.css’ is the only ‘css’ called from within the project, the ‘scss’ version simply contains imports to the partial files created within folders.
In order to ensure the integrity of the project and long-term maintainability, please conform the following rules:
We are using rem’s to style our app. Whilst you should not use any other measurement unit, it is correct to use ‘px’ for certain properties. For example, you should still use ‘px’ for setting a border or the width of a media query to ensure more accurate break points.
The root font size is set to ’10px’. This means the calculation required to implement rem’s is simple: (target font size / 10 OR 18 / 10 = 1.8rem).
Please utilize our configuration partial file wherever possible. This contains global variables for generic/brand colours, keyframes, mixins and more! For consistency please reference these instead of redefining where possible (or add to this file).
12 Col Grid Boiler template
We are using a 12 Column Grid that works as follows:
The grid has 12 columns
Each columns width is a % value that can be calculated using the following:
Example HTML mark-up for a 2-column layout:
Each column has a ‘20px’ gutter/ Each column has 10px padding on either side.
The grid should not be used within areas that require custom mark-up (such as your header/footer) to avoid having to override default styling. This will ensure the integrity of the code. Please DO NOT apply any styling to the grid directly. These should be global classes which are not overridden (ensures you will not break styling in other places).
To centre your content, simply apply a ‘max-width’ to the parent wrapper ‘.grid’. You can either set this globally within the ‘_responsive-grid’ partial file or target it specifically via a custom parent class.
About
Open Source Universal React Redux GraphQL Boilerplate