From 9e6c4f8d579fa100a71298d801624158c5f2f063 Mon Sep 17 00:00:00 2001 From: Gabriel Almeida Date: Sat, 27 May 2023 13:09:17 -0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore(CONTRIBUTING.md):=20reorga?= =?UTF-8?q?nize=20and=20clarify=20instructions=20for=20local=20development?= =?UTF-8?q?=20The=20commit=20reorganizes=20the=20instructions=20for=20loca?= =?UTF-8?q?l=20development=20in=20CONTRIBUTING.md=20to=20make=20them=20cle?= =?UTF-8?q?arer=20and=20more=20concise.=20It=20also=20adds=20a=20section?= =?UTF-8?q?=20on=20setting=20up=20pre-commit=20hooks=20to=20ensure=20consi?= =?UTF-8?q?stent=20code=20formatting.=20Additionally,=20it=20updates=20the?= =?UTF-8?q?=20instructions=20for=20running=20the=20backend=20and=20fronten?= =?UTF-8?q?d=20to=20use=20the=20`make`=20command=20for=20consistency=20and?= =?UTF-8?q?=20ease=20of=20use.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 47 +++++++++++++++++++++++++++++------------------ 1 file changed, 29 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f98336ba9..001417643 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -42,6 +42,35 @@ the system we use to tag our issues and pull requests. ### Local development You can develop LangFlow using docker compose, or locally. +We provide a .vscode/launch.json file for debugging the backend in VSCode, which is a lot faster than using docker compose. + +Setting up hooks: +```bash +make init +``` + +This will install the pre-commit hooks, which will run `make format` on every commit. + +It is advised to run `make lint` before pushing to the repository. + +#### **Locally** +Run locally by cloning the repository and installing the dependencies. We recommend using a virtual environment to isolate the dependencies from your system. + +Before you start, make sure you have the following installed: + - Poetry (>=1.4) + - Node.js + +For the backend, you will need to install the dependencies and start the development server. +```bash +make install_backend +make backend +``` +For the frontend, you will need to install the dependencies and start the development server. +```bash +make frontend +``` + + #### **Docker compose** This will run the backend and frontend in separate containers. The frontend will be available at `localhost:3000` and the backend at `localhost:7860`. ```bash @@ -50,22 +79,4 @@ docker compose up --build make dev build=1 ``` -#### **Locally** -Run locally by cloning the repository and installing the dependencies. We recommend using a virtual environment to isolate the dependencies from your system. - -Before you start, make sure you have the following installed: - - Poetry - - Node.js - -For the backend, you will need to install the dependencies and start the development server. -```bash -poetry install -make run_backend -``` -For the frontend, you will need to install the dependencies and start the development server. -```bash -cd src/frontend -npm install -npm start -```