An opinionated practical CLI for developing full-stack server-rendered React applications. You can use it to generate an independent React application (optionally with TypeScript) that's fully-configured to render on both client and server. You can also use it to render simple template applications (without SSR).
This CLI requires Node >= 10.x.
npx reactful create my-awesome-react-appThis will create a new reactful project using the default template (webpack, babel, express, with support for SSR).
You can also use a few different templates using:
npx reactful create -t <template_name> my-awesome-react-appSupported templates:
- default: A babel-based configuration (with support for SSR and production buid)
- typescript: A typescript-based configuration (with support for SSR and production build)
- simple: A simple Parcel-based configuration (no SSR, no production config)
Once a project is created you can use the "start" command to start it in development mode:
cd my-awesome-react-app
# To start the dev server and dev bundler watchers
npx reactful startOn the "default" and "typescript" templates, the "start" command will run 2 commands concurrently, you can also run them separately with:
npx reactful dev:server # runs on port 1234 by default
npx reactful dev:bundler # this will re-bundle on saveTo run all the tests:
npx reactful testTo build and start the app in production:
npx reactful build:all
npx reactful prod:startIf you keep the folder structure initialized by the package, you can use reactful to generate component files. For example:
npx reactful gc ComponentName # Create a new function component
npx reactful gcc ComponentName # Create a new class componentThese commands will also create a jest snapshot test for the generated component.
While in a React application that's created with this tool, you can always revert things back to the default configurations with the init command. You can also use this command in an empty directory.
cd my-awesome-react-app
npx reactful initIf that directory already has files, reactful will ask you if you want to override them.
Reactful is MIT licensed.