🔧 chore(CONTRIBUTING.md): reorganize and clarify instructions for local development

The commit reorganizes the instructions for local development in CONTRIBUTING.md to make them clearer and more concise. It also adds a section on setting up pre-commit hooks to ensure consistent code formatting. Additionally, it updates the instructions for running the backend and frontend to use the `make` command for consistency and ease of use.
This commit is contained in:
Gabriel Almeida 2023-05-27 13:09:17 -03:00
commit 9e6c4f8d57

View file

@ -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
```