File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ # Chat App Deployment Guide
2+
3+ This project has a separate frontend and backend.
4+
5+ ## Project structure
6+
7+ - ` frontend/ ` — browser app served by a small Node server
8+ - ` backend/ ` — Express API that stores messages in memory
9+
10+ ## Run locally
11+
12+ ### Backend
13+
14+ ``` bash
15+ cd chat-app/backend
16+ npm install
17+ npm start
18+ ```
19+
20+ ### Frontend
21+
22+ ``` bash
23+ cd chat-app/frontend
24+ npm install
25+ npm start
26+ ```
27+
28+ ## Environment variables
29+
30+ The frontend needs the backend URL at runtime.
31+
32+ - ` API_BASE_URL ` — backend public URL, for example:
33+
34+ ``` text
35+ https://enjoy15-chat-app.hosting.codeyourfuture.io
36+ ```
37+
38+ If ` API_BASE_URL ` is not set, the frontend will try relative ` /api ` requests.
39+
40+ ## Deploying to Coolify
41+
42+ Deploy the frontend and backend as separate services.
43+
44+ ### Frontend service
45+
46+ - Root directory: ` chat-app/frontend `
47+ - Use Nixpacks
48+ - Start command: ` npm start `
49+ - Set environment variable: ` API_BASE_URL=https://enjoy15-chat-app.hosting.codeyourfuture.io `
50+
51+ ### Backend service
52+
53+ - Root directory: ` chat-app/backend `
54+ - Use Nixpacks
55+ - Start command: ` npm start `
56+
57+ ## Verification
58+
59+ - Frontend should load and show messages
60+ - ` https://enjoy15-chat-app-frontend.hosting.codeyourfuture.io/config.js ` should contain the backend URL
61+ - ` https://enjoy15-chat-app.hosting.codeyourfuture.io/api/messages ` should return JSON
You can’t perform that action at this time.
0 commit comments