You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
⚠️ **Frontend does not run in dev mode**: `npm run watch:build` above will watch for changes by using `chokidar` command and automatically copied to the backend's `static` and `template` directories. So there will not be any hot reloading. Developers must refresh the browser to see updates.
49
+
### 3. Configure Environment Variables
50
+
```bash
51
+
cp .env.default .env
52
+
```
53
+
54
+
Edit the `.env` file to match your development environment. By default, it's configured to connect to a locally running backend at `http://localhost:5001`.
55
+
56
+
### 4. Run the Frontend in Development Mode
57
+
```bash
58
+
npm run dev
59
+
```
60
+
61
+
This will start the Vite development server with hot module replacement.
51
62
52
-
Apart from `npm watch:build`, these are other commands:
63
+
Other frontend development commands:
64
+
*`npm run build`: Build for production
53
65
*`npm run lint`: Lint the code
54
66
*`npm run format`: Format the code
55
67
56
-
### 3. Use the Makefile to start the backend
68
+
### 5. Use the Makefile to start the backend
57
69
* Open a new terminal tab and change directory to root of repo
58
70
* Copy and edit `config.dev.yaml` based on `config.default.yaml`
59
71
* (Optional) In `config.dev.yaml` there is a line for `dev_local_cookie_value`. To get it,
@@ -76,15 +88,16 @@ This will build the docker image for the montage backend and start the container
76
88
*`make logs` : Stream the backend container logs in real-time.
77
89
*`make restart` : Restart the backend container
78
90
79
-
### 4. Access the Application
80
-
* Open http://localhost:5001 in your browser.
91
+
### 6. Access the Application
92
+
* With development server: Open http://localhost:5173 in your browser (frontend)
93
+
* With backend serving frontend: Open http://localhost:5001 in your browser
81
94
82
95
The application server runs on localhost port 5001, visit [http://localhost:5001/meta](http://localhost:5001/meta) to see a list
83
96
of valid URL patterns and other details.
84
97
85
98
Almost all endpoints from backend (except for OAuth and `/static/`) return JSON as long as the proper Accept header is set (done by most libraries) or `format=json` is passed in the query string.
86
99
87
-
## Project struture (v2 only)
100
+
## Project structure
88
101
```bash
89
102
├── DEV.md
90
103
├── Dockerfile
@@ -105,6 +118,8 @@ Almost all endpoints from backend (except for OAuth and `/static/`) return JSON
105
118
│ ├── jsconfig.json
106
119
│ ├── package-lock.json
107
120
│ ├── package.json
121
+
│ ├── .env.default
122
+
│ ├── .env
108
123
│ ├── public
109
124
│ ├── src
110
125
│ └── vite.config.js
@@ -184,6 +199,8 @@ These provides a detailed explanation of the main components in the **Montage Pr
184
199
-**`src/`**: Source code, including components, routes, and utilities.
185
200
-**`public/`**: Static assets, such as images and global styles.
186
201
-**`vite.config.js`**: Configuration for the Vite build tool.
202
+
-**`.env.default`**: Template for environment configuration.
0 commit comments