Skip to content

Commit cbec7ae

Browse files
Initial commit
0 parents  commit cbec7ae

File tree

2,257 files changed

+339872
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,257 files changed

+339872
-0
lines changed

.devcontainer/Dockerfile

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Source: https://github.com/a5chin/python-uv
2+
FROM debian:bookworm-slim AS builder
3+
4+
ENV CARGO_HOME="/opt/.cargo"
5+
6+
SHELL [ "/bin/bash", "-o", "pipefail", "-c" ]
7+
8+
WORKDIR /opt
9+
10+
# The installer requires curl (and certificates) to download the release archive
11+
# hadolint ignore=DL3008
12+
RUN apt-get update && \
13+
apt-get install -y --no-install-recommends ca-certificates curl
14+
15+
# Run uv installer
16+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
17+
18+
19+
FROM mcr.microsoft.com/vscode/devcontainers/base:bookworm
20+
21+
22+
ENV CARGO_HOME="/opt/.cargo"
23+
ENV PATH="$CARGO_HOME/bin/:$PATH"
24+
ENV PYTHONUNBUFFERED=True
25+
ENV UV_LINK_MODE=copy
26+
27+
WORKDIR /opt
28+
29+
COPY --from=builder --chown=vscode: $CARGO_HOME $CARGO_HOME

.devcontainer/demo/README.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Langflow Demo Codespace Readme
2+
3+
These instructions will walk you through the process of running a Langflow demo via GitHub Codespaces.
4+
5+
## Setup
6+
7+
### Create a Codespace in GitHub
8+
9+
To setup the demo, simply navigate to the Langflow repo, click the "+" button, and select "Create new Codespace". This will automatically create a new codespace in your browser, which you can use for the demo.
10+
11+
### Wait for everything to install
12+
13+
After the codespace is opened, you should see a new Terminal window in VS Code where langflow is installed. Once the install completes, `langflow` will launch the webserver and your application will be available via devcontainer port.
14+
15+
Note: VS Code should prompt you with a button to push once the port is available.

.devcontainer/demo/devcontainer.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
3+
{
4+
"name": "Langflow Demo Container",
5+
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6+
"image": "mcr.microsoft.com/devcontainers/python:3.10",
7+
"features": {
8+
"ghcr.io/devcontainers/features/aws-cli:1": {},
9+
"ghcr.io/devcontainers/features/docker-in-docker": {},
10+
"ghcr.io/devcontainers/features/node": {}
11+
},
12+
"customizations": {
13+
"vscode": {
14+
"extensions": [
15+
"actboy168.tasks",
16+
"GitHub.copilot",
17+
"ms-python.python",
18+
"eamodio.gitlens",
19+
"GitHub.vscode-pull-request-github"
20+
]
21+
}
22+
},
23+
// Features to add to the dev container. More info: https://containers.dev/features.
24+
// "features": {},
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
// "forwardPorts": [],
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
"postCreateCommand": "pipx install 'langflow>=0.0.33' && langflow --host 0.0.0.0"
29+
// Configure tool-specific properties.
30+
// "customizations": {},
31+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
32+
// "remoteUser": "root"
33+
}

.devcontainer/devcontainer.json

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/universal
3+
{
4+
"name": "Langflow Dev Container",
5+
"build": {
6+
"context": "..",
7+
"dockerfile": "Dockerfile"
8+
},
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
"features": {
11+
"ghcr.io/devcontainers/features/node": {},
12+
"ghcr.io/dhoeric/features/hadolint:1": {}
13+
},
14+
15+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
16+
// "forwardPorts": [],
17+
18+
// Use 'postCreateCommand' to run commands after the container is created.
19+
"postCreateCommand": "make install_frontend && make install_backend",
20+
"postStartCommand": "make init",
21+
22+
// Configure tool-specific properties.
23+
"customizations": {
24+
"vscode": {
25+
"extensions": [
26+
"charliermarsh.ruff",
27+
"njpwerner.autodocstring",
28+
"oderwat.indent-rainbow",
29+
"exiasr.hadolint",
30+
"actboy168.tasks",
31+
"GitHub.copilot",
32+
"ms-python.python",
33+
"eamodio.gitlens",
34+
"ms-vscode.makefile-tools",
35+
"GitHub.vscode-pull-request-github"
36+
],
37+
"settings": {
38+
"terminal.integrated.defaultProfile.linux": "zsh",
39+
"terminal.integrated.profiles.linux": {
40+
"zsh": {
41+
"path": "/bin/zsh"
42+
}
43+
}
44+
}
45+
}
46+
},
47+
48+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
49+
// "remoteUser": "root"
50+
"remoteUser": "vscode"
51+
}

.env.example

+104
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
# Description: Example of .env file
2+
# Usage: Copy this file to .env and change the values
3+
# according to your needs
4+
# Do not commit .env file to git
5+
# Do not change .env.example file
6+
7+
# Config directory
8+
# Directory where files, logs and database will be stored
9+
# Example: LANGFLOW_CONFIG_DIR=~/.langflow
10+
LANGFLOW_CONFIG_DIR=
11+
12+
# Save database in the config directory
13+
# Values: true, false
14+
# If false, the database will be saved in Langflow's root directory
15+
# This means that the database will be deleted when Langflow is uninstalled
16+
# and that the database will not be shared between different virtual environments
17+
# Example: LANGFLOW_SAVE_DB_IN_CONFIG_DIR=true
18+
LANGFLOW_SAVE_DB_IN_CONFIG_DIR=
19+
20+
# Database URL
21+
# Postgres example: LANGFLOW_DATABASE_URL=postgresql://postgres:postgres@localhost:5432/langflow
22+
# SQLite example:
23+
LANGFLOW_DATABASE_URL=sqlite:///./langflow.db
24+
25+
# Cache type
26+
LANGFLOW_LANGCHAIN_CACHE=SQLiteCache
27+
28+
# Server host
29+
# Example: LANGFLOW_HOST=127.0.0.1
30+
LANGFLOW_HOST=
31+
32+
# Worker processes
33+
# Example: LANGFLOW_WORKERS=1
34+
LANGFLOW_WORKERS=
35+
36+
# Server port
37+
# Example: LANGFLOW_PORT=7860
38+
LANGFLOW_PORT=
39+
40+
# Logging level
41+
# Example: LANGFLOW_LOG_LEVEL=critical
42+
LANGFLOW_LOG_LEVEL=
43+
44+
# Path to the log file
45+
# Example: LANGFLOW_LOG_FILE=logs/langflow.log
46+
LANGFLOW_LOG_FILE=
47+
48+
# Path to the frontend directory containing build files
49+
# Example: LANGFLOW_FRONTEND_PATH=/path/to/frontend/build/files
50+
LANGFLOW_FRONTEND_PATH=
51+
52+
# Whether to open the browser after starting the server
53+
# Values: true, false
54+
# Example: LANGFLOW_OPEN_BROWSER=true
55+
LANGFLOW_OPEN_BROWSER=
56+
57+
# Whether to remove API keys from the projects saved in the database
58+
# Values: true, false
59+
# Example: LANGFLOW_REMOVE_API_KEYS=false
60+
LANGFLOW_REMOVE_API_KEYS=
61+
62+
# Whether to use RedisCache or ThreadingInMemoryCache or AsyncInMemoryCache
63+
# Values: async, memory, redis
64+
# Example: LANGFLOW_CACHE_TYPE=memory
65+
# If you want to use redis then the following environment variables must be set:
66+
# LANGFLOW_REDIS_HOST (default: localhost)
67+
# LANGFLOW_REDIS_PORT (default: 6379)
68+
# LANGFLOW_REDIS_DB (default: 0)
69+
# LANGFLOW_REDIS_CACHE_EXPIRE (default: 3600)
70+
LANGFLOW_CACHE_TYPE=
71+
72+
# Set AUTO_LOGIN to false if you want to disable auto login
73+
# and use the login form to login. LANGFLOW_SUPERUSER and LANGFLOW_SUPERUSER_PASSWORD
74+
# must be set if AUTO_LOGIN is set to false
75+
# Values: true, false
76+
LANGFLOW_AUTO_LOGIN=
77+
78+
# Superuser username
79+
# Example: LANGFLOW_SUPERUSER=admin
80+
LANGFLOW_SUPERUSER=
81+
82+
# Superuser password
83+
# Example: LANGFLOW_SUPERUSER_PASSWORD=123456
84+
LANGFLOW_SUPERUSER_PASSWORD=
85+
86+
# Should store environment variables in the database
87+
# Values: true, false
88+
LANGFLOW_STORE_ENVIRONMENT_VARIABLES=
89+
90+
# STORE_URL
91+
# Example: LANGFLOW_STORE_URL=https://api.langflow.store
92+
# LANGFLOW_STORE_URL=
93+
94+
# DOWNLOAD_WEBHOOK_URL
95+
#
96+
# LANGFLOW_DOWNLOAD_WEBHOOK_URL=
97+
98+
# LIKE_WEBHOOK_URL
99+
#
100+
# LANGFLOW_LIKE_WEBHOOK_URL=
101+
102+
# Value must finish with slash /
103+
#BACKEND_URL=http://localhost:7860/
104+
BACKEND_URL=

.eslintrc.json

+90
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:react/recommended",
5+
"plugin:prettier/recommended"
6+
],
7+
"plugins": [
8+
"react",
9+
"import-helpers",
10+
"prettier"
11+
],
12+
"parser": "@typescript-eslint/parser",
13+
"parserOptions": {
14+
"project": [
15+
"./tsconfig.node.json",
16+
"./tsconfig.json"
17+
],
18+
"extraFileExtensions:": [
19+
".mdx"
20+
],
21+
"extensions:": [
22+
".mdx"
23+
]
24+
},
25+
"env": {
26+
"browser": true,
27+
"es2021": true
28+
},
29+
"settings": {
30+
"react": {
31+
"version": "detect"
32+
}
33+
},
34+
"rules": {
35+
"no-console": "warn",
36+
"no-self-assign": "warn",
37+
"no-self-compare": "warn",
38+
"complexity": [
39+
"error",
40+
{
41+
"max": 15
42+
}
43+
],
44+
"indent": [
45+
"error",
46+
2,
47+
{
48+
"SwitchCase": 1
49+
}
50+
],
51+
"no-dupe-keys": "error",
52+
"no-invalid-regexp": "error",
53+
"no-undef": "error",
54+
"no-return-assign": "error",
55+
"no-redeclare": "error",
56+
"no-empty": "error",
57+
"no-await-in-loop": "error",
58+
"react/react-in-jsx-scope": 0,
59+
"node/exports-style": [
60+
"error",
61+
"module.exports"
62+
],
63+
"node/file-extension-in-import": [
64+
"error",
65+
"always"
66+
],
67+
"node/prefer-global/buffer": [
68+
"error",
69+
"always"
70+
],
71+
"node/prefer-global/console": [
72+
"error",
73+
"always"
74+
],
75+
"node/prefer-global/process": [
76+
"error",
77+
"always"
78+
],
79+
"node/prefer-global/url-search-params": [
80+
"error",
81+
"always"
82+
],
83+
"node/prefer-global/url": [
84+
"error",
85+
"always"
86+
],
87+
"node/prefer-promises/dns": "error",
88+
"node/prefer-promises/fs": "error"
89+
}
90+
}

.gitattributes

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text eol=lf
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.c text
7+
*.h text
8+
*.py text
9+
*.js text
10+
*.jsx text
11+
*.ts text
12+
*.tsx text
13+
*.md text
14+
*.mdx text
15+
*.yml text
16+
*.yaml text
17+
*.xml text
18+
*.csv text
19+
*.json text
20+
*.sh text
21+
*.Dockerfile text
22+
Dockerfile text
23+
24+
# Declare files that will always have CRLF line endings on checkout.
25+
*.sln text eol=crlf
26+
27+
# Denote all files that are truly binary and should not be modified.
28+
*.png binary
29+
*.jpg binary
30+
*.ico binary
31+
*.gif binary
32+
*.mp4 binary
33+
*.svg binary
34+
*.csv binary
35+

0 commit comments

Comments
 (0)