From 8af817e2d50a72f2cdf492c301e5fbd962562449 Mon Sep 17 00:00:00 2001 From: timothycarambat Date: Wed, 16 Aug 2023 15:34:03 -0700 Subject: [PATCH] update local dev docs --- README.md | 8 ++++++++ frontend/.env.example | 2 ++ package.json | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 frontend/.env.example diff --git a/README.md b/README.md index 0f36576f..cf49a77e 100644 --- a/README.md +++ b/README.md @@ -71,7 +71,15 @@ This monorepo consists of three main sections: - `yarn setup` from the project root directory. - This will fill in the required `.env` files you'll need in each of the application sections. Go fill those out before proceeding or else things won't work right. - `cd frontend && yarn install && cd ../server && yarn install` from the project root directory. + +To boot the server locally (run commands from root of repo): +- ensure `server/.env.development` is set and filled out. +`yarn dev:server` +To boot the frontend locally (run commands from root of repo): +- ensure `frontend/.env` is set and filled out. +- ensure `VITE_API_BASE="http://localhost:3001/api"` +`yarn dev:frontend` Next, you will need some content to embed. This could be a Youtube Channel, Medium articles, local text files, word documents, and the list goes on. This is where you will use the `collector/` part of the repo. diff --git a/frontend/.env.example b/frontend/.env.example new file mode 100644 index 00000000..44057dac --- /dev/null +++ b/frontend/.env.example @@ -0,0 +1,2 @@ +VITE_API_BASE='http://localhost:3001/api' # Use this URL when developing locally +# VITE_API_BASE='/api' # Use this URL deploying on non-localhost address OR in docker. diff --git a/package.json b/package.json index 12d46fe3..318710a8 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "scripts": { "lint": "cd server && yarn lint && cd .. && cd frontend && yarn lint", "setup": "cd server && yarn && cd ../frontend && yarn && cd .. && yarn setup:envs && echo \"Please run yarn dev:server and yarn dev:frontend in separate terminal tabs.\"", - "setup:envs": "cp -n ./server/.env.example ./server/.env.development && cp -n ./collector/.env.example ./collector/.env && cp -n ./docker/.env.example ./docker/.env && echo \"All ENV files copied!\n\"", + "setup:envs": "cp -n ./frontend/.env.example ./frontend/.env && cp -n ./server/.env.example ./server/.env.development && cp -n ./collector/.env.example ./collector/.env && cp -n ./docker/.env.example ./docker/.env && echo \"All ENV files copied!\n\"", "dev:server": "cd server && yarn dev", "dev:frontend": "cd frontend && yarn start", "prod:server": "cd server && yarn start",