@@ -5,9 +5,9 @@ This is a full-stack movie browsing application built with Express.js and Next.j
55## Project Structure
66
77```
8- ├── README-JAVASCRIPT-EXPRESS .md
8+ ├── README.md
99├── client/ # Next.js frontend (TypeScript)
10- └── server/js-express/ # Express.js backend
10+ └── server # Express.js backend
1111 ├── src/
1212 ├── package.json
1313 ├── .env.example
@@ -30,7 +30,7 @@ This is a full-stack movie browsing application built with Express.js and Next.j
3030Navigate to the Express server directory:
3131
3232``` bash
33- cd server/js-express
33+ cd server
3434```
3535
3636Create a ` .env ` file from the example:
@@ -42,41 +42,54 @@ cp .env.example .env
4242Edit the ` .env ` file and set your MongoDB connection string:
4343
4444``` env
45- # MongoDB Configuration
46- # Replace with your MongoDB Atlas connection string
45+ # MongoDB Connection
46+ # Replace with your MongoDB Atlas connection string or local MongoDB URI
4747MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority
4848
49+ # Voyage AI Configuration
50+ # API key for Voyage AI embedding model (required for Vector Search)
51+ VOYAGE_API_KEY=your_voyage_api_key
52+
4953# Server Configuration
5054PORT=3001
5155NODE_ENV=development
5256
53- # CORS Configuration (frontend URL)
57+
58+ # CORS Configuration
59+ # Allowed origin for cross-origin requests (frontend URL)
60+ # For multiple origins, separate with commas
5461CORS_ORIGIN=http://localhost:3000
5562
5663# Optional: Enable MongoDB Search tests
5764# Uncomment the following line to enable Search tests
5865# ENABLE_SEARCH_TESTS=true
5966```
6067
61- ** Note:** Replace ` <username> ` , ` <password> ` , and ` <cluster> ` with your actual MongoDB Atlas credentials.
68+ ** Note:** Replace ` <username> ` , ` <password> ` , and ` <cluster> ` with
69+ your actual MongoDB Atlas credentials. Replace ` your_voyage_api_key ` with
70+ your key.
6271
6372### 2. Install Backend Dependencies
6473
65- From the ` server/js-express ` directory, run:
74+ From the ` server ` directory, run:
6675
6776``` bash
6877npm install
6978```
7079
7180### 3. Start the Backend Server
7281
73- From the ` server/js-express ` directory, run:
82+ From the ` server ` directory, run:
7483
7584``` bash
7685# Development mode with hot reloading
7786npm run dev
87+ ```
7888
79- # Or production mode
89+
90+ Or for production mode, run:
91+
92+ ``` bash
8093npm run build
8194npm start
8295```
@@ -140,14 +153,14 @@ The Express.js backend uses:
140153To run tests:
141154
142155``` bash
143- cd server/js-express
156+ cd server
144157npm test
145158```
146159
147160To run tests with coverage:
148161
149162``` bash
150- cd server/js-express
163+ cd server
151164npm run test:coverage
152165```
153166
@@ -204,5 +217,5 @@ If you have problems running the sample app, please check the following:
204217- [ ] Verify that you have no firewalls blocking access to the server or client ports.
205218
206219If you have verified the above and still have issues, please
207- [ open an issue] ( https://github.com/mongodb/sample-app-nodejs-mflix /issues/new/choose )
208- on the source repository ` mongodb/sample-app-nodejs-mflix ` .
220+ [ open an issue] ( https://github.com/mongodb/docs- sample-apps /issues/new/choose )
221+ on the source repository ` mongodb/docs- sample-apps ` .
0 commit comments