Download the PHP package samsonasik/ci4-react without Composer
On this page you can find all versions of the php package samsonasik/ci4-react. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download samsonasik/ci4-react
More information about samsonasik/ci4-react
Files in samsonasik/ci4-react
Package ci4-react
Short Description CodeIgniter4 starter app with react.js Integration
License MIT
Homepage https://codeigniter.com
Informations about the package ci4-react
Example Using react.js in CodeIgniter 4 application
Introduction
A CodeIgniter 4 Skeleton Application with react.js integration.
Features
- SPA application with React Router DOM with cached pages after visited.
- Using server side template from CodeIgniter 4, eval'd with DOMPurify it first.
- Webpack support for production
Setup
1. Run composer create-project command:
2. Copy file ci4-react/env
to ci4-react/.env
:
3. Set environment and app configuration
Open ci4-react/.env
and set CI_ENVIRONMENT
, app.baseURL
, app.indexPage
:
4. Run PHP Development server
5. Open web browser http://localhost:8080
Production
For deploy to production purpose, it has webpack.config.js
in root directory that when we run webpack
command, we can get public/js/dist/bundle.js
after run it. If you don't have a webpack
installed yet in your system, you can install nodejs and install webpack
and webpack-cli
:
So, we can run:
After it generated, we can update .env
file as follow:
In app/Views/layout.php
, we have a ENVIRONMENT
check to use js/app.js
when on development, and use /js/dist/bundle.js
on production when exists.
that will automatically take care of that.