path to file | path to text | current text |
---|---|---|
/package.json |
$.name |
"eco-monorepo" |
/package.json |
$.author |
"Dmytro Parzhytskyi <[email protected]>" |
/package.json |
$.repository |
"https://github.com/eco-repositories/eco-monorepo" |
/package-lock.json |
$.name |
"eco-monorepo" |
/package-lock.json |
$.packages[""].name |
"eco-monorepo" |
/packages/client/index.html |
html>head>title |
"Client App" |
Starting the application stack with npm start
is the simplest approach and also recommended.
-
Set environment variables and build arguments in
/docker-compose.env.local
Read
/docker-compose.yaml
for the variables it uses. Also, normally, Docker produces a warning message for variables that are not set.- (optionally) Copy the example file
/docker-compose.env.local.example
as/docker-compose.env.local
. Beware that the example file might be out of sync with the actual env variables used by Docker Compose.
- (optionally) Copy the example file
-
Run application stack:
npm start
- (optionally) To run the application stack in development mode (with development overrides applied), copy the example file
/docker-compose.override.yaml.example
as/docker-compose.override.yaml
. If present, this new file will automatically be picked up by Docker Compose, and all the specified overrides will be applied.
- (optionally) To run the application stack in development mode (with development overrides applied), copy the example file
-
Observe the apps:
-
server
onhttp://localhost:<SERVER_PORT_HOST>
(tryGET /v1/health
) -
client
onhttp://localhost:<CLIENT_PORT_HOST>
-
-
(optionally) Stop the application stack:
npm stop
To start the application stack without Docker, it is necessary to setup/build/start the applications manually on localhost
, then run server in the background, then run client in "dev" mode.
-
Install all dependencies:
npm ci
-
Build
shared
package (it has to be built first because the other packages depend on it):npm run -w shared build
-
Set server port as
PORT
environment variable in/packages/server/.env.local
:echo PORT='<SERVER_PORT>' >> ./packages/server/.env.local
-
Build server:
npm run -w server build
-
Start server:
npm run -w server start
-
Share server location with the client through
/packages/client/.env.local
:echo VITE_SERVER_BASE_URL='http://localhost:<SERVER_PORT>' >> ./packages/client/.env.local
-
Start client (in
dev
mode):npm run -w client dev
-
Observe the apps:
-
server
onhttp://localhost:<SERVER_PORT>
-
client
onhttp://localhost:<CLIENT_PORT>
(usually it ishttp://localhost:5173/
)
-
-
(optionally) Stop the application stack:
-
Stop the client (press Q in the client terminal)
-
Stop the server (press Ctrl+C in the server terminal)
-