Skip to content

Commit 5f7c031

Browse files
Merge pull request #1 from Valeria110/dev
[dev] fix layout when resizing the window, upd env config and readme
2 parents 92fa391 + a2755ed commit 5f7c031

File tree

10 files changed

+181
-166
lines changed

10 files changed

+181
-166
lines changed

.env.dev.example

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
2+
OPENAI_BASE_URL=YOUR_OPENAI_BASE_URL
3+
4+
# Development mode (docker-compose.dev.yml)
5+
VITE_SOCKET_URL_DOCKER=http://localhost:3001
6+
FRONTEND_ORIGIN_DOCKER=http://localhost:3000

.env.example

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
22
OPENAI_BASE_URL=YOUR_OPENAI_BASE_URL
33

4-
FRONTEND_ORIGIN_DOCKER=http://localhost:80
5-
VITE_SOCKET_URL_DOCKER=http://localhost:3001
4+
VITE_SOCKET_URL_DOCKER=http://localhost:3001
5+
FRONTEND_ORIGIN_DOCKER=http://localhost

README.md

Lines changed: 45 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,28 +48,63 @@ the user's request provided via the chatbot, is sent to LLM, which then calls a
4848
- `gpt-4.1-nano` has noticeable limitations in following the schema.
4949
- If experimenting with other providers, make sure they support **function calling**.
5050

51-
## Quick start (with Docker)
51+
## Quick start
52+
53+
### Option 1: Production mode (Docker)
5254

5355
```bash
5456
git clone https://github.com/DHTMLX/gantt-maker-ai-demo.git
55-
cd gantt-ai-chat-demo
57+
cd gantt-maker-ai-demo
5658
cp .env.example .env
59+
# Edit .env with your API keys
5760
docker compose up --build
5861
```
5962

60-
Open http://localhost:3000 in your browser.
61-
The frontend will connect to the backend running on http://localhost:3001. Make sure you have a valid OpenAI API key or another LLM provider configured in your .env.
63+
Open http://localhost in your browser. The frontend runs on port 80, backend on port 3001. Make sure you have a valid OpenAI API key or another LLM provider configured in your .env.
64+
65+
### Option 2: Development mode (Docker)
66+
67+
Run with hot-reload for development:
68+
69+
```bash
70+
git clone https://github.com/DHTMLX/gantt-maker-ai-demo.git
71+
cd gantt-maker-ai-demo
72+
cp .env.dev.example .env
73+
# Edit .env with your API keys
74+
docker compose -f docker-compose.dev.yml up --build
75+
```
76+
77+
Open **http://localhost:3000** in your browser. Changes to code will auto-reload.
78+
79+
### Option 3: Local development (without Docker)
80+
81+
If you prefer running locally without Docker:
82+
83+
```bash
84+
npm install
85+
cp .env.dev.example .env
86+
# Edit .env with your API keys
87+
88+
npm run dev:backend # http://localhost:3001
89+
npm run dev:frontend # http://localhost:3000
90+
```
91+
92+
---
6293

63-
## .env format:
94+
## Environment Variables
6495

6596
```bash
6697
# LLM API configuration
6798
OPENAI_API_KEY=YOUR_OPENAI_API_KEY
6899
OPENAI_BASE_URL=YOUR_OPENAI_BASE_URL
69100

70-
# Frontend-backend communication
71-
VITE_SOCKET_URL_DOCKER=http://backend:3001
72-
FRONTEND_ORIGIN_DOCKER=http://frontend:3000
101+
# Production mode (docker-compose.yml)
102+
VITE_SOCKET_URL_DOCKER=http://localhost:3001
103+
FRONTEND_ORIGIN_DOCKER=http://localhost
104+
105+
# Development mode (docker-compose.dev.yml)
106+
VITE_SOCKET_URL_DOCKER=http://localhost:3001
107+
FRONTEND_ORIGIN_DOCKER=http://localhost:3000
73108
```
74109

75110
## Repo structure:
@@ -99,7 +134,9 @@ backend/
99134
└─ package.json
100135

101136
docker-compose.yml
137+
docker-compose.dev.yml
102138
.env.example
139+
.env.dev.example
103140
package.json
104141
README.md
105142
.gitignore

backend/package-lock.json

Lines changed: 14 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

backend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"socket.io": "^4.8.1"
2121
},
2222
"devDependencies": {
23+
"dotenv-cli": "^10.0.0",
2324
"nodemon": "^3.1.10"
2425
}
2526
}

docker-compose.dev.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ services:
55
dockerfile: Dockerfile.dev
66
container_name: gantt-ai-maker-frontend
77
ports:
8-
- "3000:3000"
8+
- '3000:3000'
99
volumes:
1010
- ./frontend:/app
1111
- /app/node_modules
1212
env_file:
1313
- .env
1414
environment:
15-
- VITE_SOCKET_URL=${VITE_SOCKET_URL_DOCKER:-http://backend:3001}
15+
- VITE_SOCKET_URL=${VITE_SOCKET_URL_DOCKER:-http://localhost:3001}
1616
depends_on:
1717
- backend
1818

@@ -22,7 +22,7 @@ services:
2222
dockerfile: Dockerfile.dev
2323
container_name: gantt-ai-maker-backend
2424
ports:
25-
- "3001:3001"
25+
- '3001:3001'
2626
volumes:
2727
- ./backend:/app
2828
- /app/node_modules
@@ -31,4 +31,4 @@ services:
3131
environment:
3232
- OPENAI_API_KEY=${OPENAI_API_KEY}
3333
- OPENAI_BASE_URL=${OPENAI_BASE_URL}
34-
- FRONTEND_ORIGIN=${FRONTEND_ORIGIN_DOCKER:-http://frontend:3000}
34+
- FRONTEND_ORIGIN=${FRONTEND_ORIGIN_DOCKER:-http://localhost:3000}

docker-compose.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ services:
66
- VITE_SOCKET_URL=${VITE_SOCKET_URL_DOCKER:-http://localhost:3001}
77
container_name: gantt-ai-maker-frontend
88
ports:
9-
- "80:80"
9+
- '80:80'
1010
volumes:
1111
- ./frontend:/app
1212
- /app/node_modules
@@ -22,7 +22,7 @@ services:
2222
context: ./backend
2323
container_name: gantt-ai-maker-backend
2424
ports:
25-
- "3001:3001"
25+
- '3001:3001'
2626
volumes:
2727
- ./backend:/app
2828
- /app/node_modules
@@ -31,4 +31,4 @@ services:
3131
environment:
3232
- OPENAI_API_KEY=${OPENAI_API_KEY}
3333
- OPENAI_BASE_URL=${OPENAI_BASE_URL}
34-
- FRONTEND_ORIGIN=${FRONTEND_ORIGIN_DOCKER:-http://frontend:3000}
34+
- FRONTEND_ORIGIN=${FRONTEND_ORIGIN_DOCKER:-http://localhost}

0 commit comments

Comments
 (0)