Skip to content

Latest commit

 

History

History
68 lines (42 loc) · 3.1 KB

README.md

File metadata and controls

68 lines (42 loc) · 3.1 KB

sails-react monolith setup

this is a Sails v1 application setup with client-side rendered react app. For a server side rendered setup using next.js, check this project out

NOTICE

There is a copy of .env.example file in the frontend folder.

I have gone ahead to make the build folder assets.

You can specify your own, but first, take a look at sails documentation here before you do.

Installation process

  • to install the react app
    • using yarn run npm run yarn:install:frontend
    • using npm run npm run npm:install:frontend

Building React app

  • create a .env file inside frontend folder and paste the content of .env.example into it

  • to build the react app

    • using yarn npm run yarn:build:frontend
    • using npm npm run npm:build:frontend

Production Setup process

  • set the value of sails.config.sockets.onlyAllowOrigins in config/env/production.js on line 257 or follow deploy Sails app instruction in sails documentation

  • You can start sails in production npm start

To build react and lift sails in production mode with a single command

- using yarn ```npm run yarn:start:project```
- using npm ```npm run npm:start:project```

Development Setup

  • go ahead and lift the sails app with sails lift for development mode

  • then, to start react in dev mode run

    • using yarn npm run yarn:dev:frontend
    • using npm npm run npm:dev:frontend

To run react and lift sails in development mode with a single command

- using yarn ```npm run yarn:dev:project```
- using npm ```npm run npm:dev:project```

Links

Version info

This app was originally generated on Sun Sep 12 2021 23:27:23 GMT+0100 (West Africa Standard Time) using Sails v1.4.4.