ref: improving development environment and instructions (#5180)

* improving development environment and instructions

* minor edits as requested

* fix typo in  DEVELOPMENT.md

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Phil Miesle 2024-12-12 12:01:05 +00:00 • committed by GitHub
commit d1821cb466
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 391 additions and 157 deletions

60
.devcontainer/README.md Normal file
View file

@ -0,0 +1,60 @@
# Langflow Demo Codespace Readme
These instructions will walk you through the process of running a Langflow demo via GitHub Codespaces.
If you want a faster and easier demo experience with Langflow, DataStax Langflow is a hosted environment with zero setup: [Sign up for a free account.](https://astra.datastax.com/signup?type=langflow)
## Create a Codespace in GitHub
To setup the demo in Codespace:
1. Navigate to the Langflow repo
2. On the "Code <>" button, select the "Codespaces" tab
3. Click the green "Create codespace on..." button (or "+" icon if you want more options) to create a new Codespace
## Wait for everything to install
After the codespace is opened, there will be two phases to the process. It will take ≈5-10 minutes to complete.
* **Phase 1**: Building Container; you can click on the "Building Codespace" link to watch the logs
* **Phase 2**: Building Langflow; the terminal will now show `Running postCreateCommand...`, similar to:
```
✔ Finishing up...
⠸ Running postCreateCommand...
› sudo chown -R langflow .venv .mypy_cache src/frontend/node_modules src/frontend/build src/backend/base/langflow/frontend && make install_frontend && mak…
```
Once completed, this terminal window will close.
You now need to manually build the frontend. Open a new Terminal and run command:
```bash
make build_frontend
```
This will take a short period of time, you should have a message similar to `Building frontend static files` and the command will complete successfully.
Installation is now complete.
## Start up the Service
Open a new Terminal, and type `uv run langflow run`.
The service will start, and you will may notice a dialog in the lower right indicating there is a port available to connect to. However, the service will not be ready until you see the welcome banner:
```
╭───────────────────────────────────────────────────────────────────╮
│ Welcome to ⛓ Langflow │
│ │
│ │
│ Collaborate, and contribute at our GitHub Repo 🌟 │
│ │
│ We collect anonymous usage data to improve Langflow. │
│ You can opt-out by setting DO_NOT_TRACK=true in your environment. │
│ │
│ Access http://127.0.0.1:7860 │
╰───────────────────────────────────────────────────────────────────╯
```
At this point you can connect to the service via the port, or if the dialog is gone you can find the "Forwarded Address" on the "Ports" tab (which is next the "Terminal" tab). If there is no port forwarded, you can click the "Forward a Port" button on the "Ports" tab, and forward `7860`.