r3-cli
v4.2.0
Published
<p align="center"> <a href="https://github.com/reginaldoMorais/r3-cli-vscode-snippet"> <img alt="r3-cli" src="https://image.ibb.co/cZZcUn/r3_cli_snippet_icons.png" width="244"> </a> </p>
Downloads
7
Maintainers
Readme
R3-CLI
Create React applications with server-side rendering using Redux and Router v4. Simple and very fast!
Installation
Run the command below, to have the module installed globally:
npm install -g r3-cli
For old structure
For the old structure please use R3-CLI version 3 or before.
npm install -g r3-cli@^3.0.6
Usage
To see commands avaliable, run a single command with argument:
r3-cli --help
To create a new Project, run the command:
r3-cli
or
r3-cli -c my-app
It will create a directory called my-app
inside the current folder.
You will found the initial Project structure:
my-app
├── .gitignore
├── package.json
├── README.md
├── node_modules
└── source
├── actions
│ └── IndexActions.js
│
├── assets
│ ├── fonts
│ ├── images
│ └── styles
│
├── client
│ ├── index.ejs
│ ├── index.html
│ └── index.js
│
├── config
│ ├── index.js
│ ├── config.env.json
│ └── response.status.json
│
├── reducers
│ └── IndexReducer.js
│
├── server
│ ├── excludesExtensions.js
│ ├── index.js
│ ├── server.js
│ └── template.js
│
├── views
│ ├── web
│ │ ├── components
│ │ ├── controller
│ │ ├── pages
│ │ │ └── index
│ │ │ ├── __test__
│ │ │ ├── Index.js
│ │ │ └── IndexContainer.js
│ │ │
│ │ ├── templates
│ │ │ ├── In.js
│ │ │ ├── Out.js
│ │ │ └── PageNotFound.js
│ │ │
│ │ └── Imports.js
│ │
│ └── mobile (future feature)
│
├── Reducers.js
├── Routes.js
└── Store.js
Running your new Project
Inside the newly created Project, you need to set a Node version:
Requisite
NVM
To easily switch Node versions for your Project, You can use NVM command:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source ~/.bashrc
nvm install
nvm use
Running
Afterward you can run some built-in commands:
npm start
or
yarn start
Your Project is ready to be accessed. Your can run the command npm ls or yarn ls to view available commands.
Creating a new Route
To create a new route on your Project run the command bellow:
r3-cli --route
A new route and view will automatically be created. It will be created the files:
./source/views/web/page/newView
NewView.jsx
NewViewContainer.jsx
./source/actions
NewViewActions.js
./source/reducers
NewViewReducer.js