jsapp-starter

1.0.8 • Public • Published

jsapp-starter

node npm build publish

Node.js project generator for React Full stack Application.

Perquisites

  • node.js 16+
  • npm 8+

Features

  • Generates React Client and Express Server subprojects.
  • Uses npm workspaces to manage both subprojects.
  • Uses Typescript for both server and Client
  • For full features refer to cra-express-ts-starter

Usage

  • Create React/Express fullstack starter app.
$ npx jsapp-starter create-app <my-app>

Run npx jsapp-starter --help or npx jsapp-starter create-app --help for additional options.

  • Start Server
$ cd my-app
$ npm start --workspace=server
  • Start the Cleint
$ cd my-app
$ npm start --workspace=client

Advanced Usage

Development with Proxy Mode

  • Here you run client with react-scripts webpack server and all the Api calls get proxied to SERVER_URL
  • Start server by running npm start --workspace=server
  • Configure client/.env.development and set
PORT=3000
PUBLIC_URL=
REACT_APP_USE_PROXY=true
REACT_APP_SERVER_URL=http://localhost:9000
  • Start Client by running npm start --workspace=client
  • Access application on default location http://localhost:3000

Development in Server Mode

  • Here you build the client application on a watch, and server serves the Client applicaton from build folder
  • Configure server/.env.development and set
PUBLIC_PATH=../client/build
  • Start server by running npm start --workspace=server
  • Configure client/.env.development and set
PUBLIC_URL=http://localhost:9000
REACT_APP_USE_PROXY=false
REACT_APP_SERVER_URL=
  • Start watch on client builds by running npm run watch:dev:build --workspace=client
  • Access application on server's location http://localhost:9000

NOTE: Refer to Project README for additional information.

License

MIT License.

Package Sidebar

Install

npm i jsapp-starter

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

13.6 kB

Total Files

9

Last publish

Collaborators

  • jsstarter