Skip to content

Commit 6cee2ee

Browse files
Merge pull request #6 from Zipstack/fix/oss-cleanup-and-credit-check
FIX: OSS Repo Cleanup and Cloud Credit Check Bug Fix
2 parents d943411 + 729e2c4 commit 6cee2ee

3 files changed

Lines changed: 31 additions & 356 deletions

File tree

README.md

Lines changed: 29 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -61,43 +61,22 @@ Visitran is an **open-source** data transformation tool that supports **no-code*
6161

6262
## Getting Started
6363

64-
Choose your preferred installation method:
65-
66-
- [Docker Compose](#option-1-docker-compose) — Recommended for quick evaluation
67-
- [Direct Installation (localhost)](#option-2-direct-installation-localhost) — For development and customization
68-
69-
### Option 1: Docker Compose
70-
71-
The fastest way to get Visitran running. Requires [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
64+
Requires [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
7265

7366
```bash
74-
# Clone the repository
7567
git clone https://github.com/Zipstack/visitran.git
7668
cd visitran
77-
78-
# Set up backend environment variables
7969
cp backend/sample.env backend/.env
80-
```
81-
82-
**Edit `backend/.env`** — default values are provided for quick start. For production, replace these keys:
83-
84-
| Variable | Default | How to Generate (production) |
85-
|----------|---------|------------------------------|
86-
| `SECRET_KEY` | Provided | Use [djecrety.ir](https://djecrety.ir/) or run: `python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"` |
87-
| `VISITRAN_ENCRYPTION_KEY` | Provided | Run: `python -c "from base64 import b64encode; from cryptography.fernet import Fernet; print(b64encode(Fernet.generate_key()).decode())"` |
88-
| `VISITRAN_RSA_PRIVATE_KEY` | Provided | Generate a 2048-bit RSA key pair (see `sample.env` for the command) |
89-
| `VISITRAN_RSA_PUBLIC_KEY` | Provided | Derived from the private key above |
90-
| `VISITRAN_AI_KEY` | Empty | Optional — get from [app.visitran.com](https://app.visitran.com) to enable AI features |
91-
92-
> **Note:** The sample.env is pre-configured for Docker — `DB_HOST=postgres` and `REDIS_HOST=redis` point to the Docker Compose service names. No hostname changes needed. You can run `docker compose up --build -d` immediately after copying.
93-
94-
```bash
95-
# Build and start all services
9670
cd docker
9771
docker compose up --build -d
9872
```
9973

100-
This starts:
74+
Open [http://localhost:3000](http://localhost:3000) and **Sign Up** to create your account — that's it!
75+
76+
> **AI Features (optional):** Get an API key from [app.visitran.com](https://app.visitran.com) and add `VISITRAN_AI_KEY=vtk_...` to `backend/.env`, then restart with `docker compose restart backend`.
77+
78+
<details>
79+
<summary><strong>Services started by Docker Compose</strong></summary>
10180

10281
| Service | Port | Description |
10382
|---------|------|-------------|
@@ -108,23 +87,27 @@ This starts:
10887
| Celery Worker || Background job processing |
10988
| Celery Beat || Scheduled task processing |
11089

111-
Open `http://localhost:3000` in your browser.
90+
To stop: `docker compose down`
91+
To stop and delete all data: `docker compose down -v`
11292

113-
**First-time setup:** On first launch, click **Sign Up** to create a local admin account. There is no default username/password — you set your own credentials during signup.
93+
</details>
11494

115-
To stop:
95+
<details>
96+
<summary><strong>Environment variables</strong></summary>
11697

117-
```bash
118-
docker compose down
119-
```
98+
The `sample.env` ships with working defaults — no edits needed to get started. For production, replace these keys:
12099

121-
To stop and **delete all data** (PostgreSQL volume):
100+
| Variable | Default | How to Generate (production) |
101+
|----------|---------|------------------------------|
102+
| `SECRET_KEY` | Provided | Use [djecrety.ir](https://djecrety.ir/) or `python -c "from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())"` |
103+
| `VISITRAN_ENCRYPTION_KEY` | Provided | `python -c "from base64 import b64encode; from cryptography.fernet import Fernet; print(b64encode(Fernet.generate_key()).decode())"` |
104+
| `VISITRAN_RSA_PRIVATE_KEY` | Provided | Generate a 2048-bit RSA key pair (see `sample.env`) |
105+
| `VISITRAN_RSA_PUBLIC_KEY` | Provided | Derived from the private key above |
122106

123-
```bash
124-
docker compose down -v
125-
```
107+
</details>
126108

127-
### Option 2: Direct Installation (localhost)
109+
<details>
110+
<summary><strong>Local development (without Docker)</strong></summary>
128111

129112
For development or when you want full control over each component.
130113

@@ -137,67 +120,42 @@ For development or when you want full control over each component.
137120
**Backend**
138121

139122
```bash
140-
# Clone the repository
141123
git clone https://github.com/Zipstack/visitran.git
142124
cd visitran
143-
144-
# Set up environment variables
145125
cp backend/sample.env backend/.env
146126
```
147127

148-
**Edit `backend/.env`** for local development:
128+
Edit `backend/.env` for local development:
149129

150130
| Variable | Required | Value for localhost |
151131
|----------|----------|---------------------|
152-
| `SECRET_KEY` | Yes | Default provided — replace in production |
153-
| `VISITRAN_ENCRYPTION_KEY` | Yes | Default provided — replace in production |
154-
| `DB_HOST` | No | Leave **empty** for SQLite (no PostgreSQL needed), or `localhost` if you have PostgreSQL running |
132+
| `DB_HOST` | No | Leave **empty** for SQLite, or `localhost` for local PostgreSQL |
155133
| `REDIS_HOST` | Yes | `localhost` |
156-
| `DB_SAMPLE_HOST` | No | `localhost` (to enable sample project — requires PostgreSQL) or leave empty to skip |
134+
| `DB_SAMPLE_HOST` | No | `localhost` (requires PostgreSQL) or leave empty to skip |
157135

158-
> **Important for localhost:** Change `DB_HOST=postgres``DB_HOST=` (empty for SQLite) or `DB_HOST=localhost` (for local PostgreSQL). Change `REDIS_HOST=redis``REDIS_HOST=localhost`.
136+
> **Important:** Change `DB_HOST=postgres``DB_HOST=` (empty) and `REDIS_HOST=redis``REDIS_HOST=localhost`.
159137
160138
```bash
161-
# Install backend dependencies
162139
cd backend
163140
pip install uv
164141
uv sync
165-
166-
# Activate virtual environment
167142
source .venv/bin/activate
168-
169-
# Run database migrations
170143
python manage.py migrate
171-
172-
# Start backend server (port 8000)
173144
python manage.py runserver
174145
```
175146

176147
**Frontend**
177148

178149
```bash
179150
cd frontend
180-
181-
# Set up environment variables
182151
cp sample.env .env
183-
```
184-
185-
**Edit `frontend/.env`** if needed:
186-
187-
| Variable | Default | Description |
188-
|----------|---------|-------------|
189-
| `REACT_APP_BACKEND_URL` | `http://localhost:8000` | Backend API URL |
190-
| `REACT_APP_SOCKET_SERVICE_BASE_URL` | `http://localhost:4000` | WebSocket server URL |
191-
192-
```bash
193-
# Install dependencies
194152
npm install
195-
196-
# Start dev server (port 3000)
197153
npm start
198154
```
199155

200-
Open `http://localhost:3000` in your browser and **sign up** to create your account.
156+
Open [http://localhost:3000](http://localhost:3000) and **sign up** to create your account.
157+
158+
</details>
201159

202160
## Project Structure
203161

backend/backend/core/routers/chat/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@ def fetch_token_balance(
107107
f"Token balance check passed for organization {organization.organization_id}. "
108108
f"Required: {tokens_required}, Available: {balance_info.get('current_balance', 0)}"
109109
)
110-
except Exception:
110+
except ImportError:
111+
# OSS mode: pluggable_apps not installed, skip billing check
111112
pass
112113

113114
def persist_prompt(self, request: Request, project_id: str, *args, **kwargs) -> Response:

0 commit comments

Comments
 (0)