path to file | path to text | current text |
---|---|---|
/package.json |
$.name |
"eco-monorepo" |
/package.json |
$.author |
"Dmytro Parzhytskyi <parzhitsky@gmail.com>" |
/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.
/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.Run application stack:
npm start
/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.Observe the apps:
server
on http://localhost:<SERVER_PORT_HOST>
(try GET /v1/health
)
client
on http://localhost:<CLIENT_PORT_HOST>
(optionally) Stop the application stack:
npm stop
localhost
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
on http://localhost:<SERVER_PORT>
client
on http://localhost:<CLIENT_PORT>
(usually it is http://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)