Skip to content

Commit 5bbf3dc

Browse files
authored
Merge pull request #90 from mongodb/development
Merge development into main branch
2 parents ac17650 + fe4f892 commit 5bbf3dc

20 files changed

Lines changed: 2370 additions & 347 deletions

.copier/config.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ workflows:
4343
- move: { from: "mflix/client", to: "client" }
4444
- move: { from: "mflix/server/java-spring", to: "server" }
4545
- copy: { from: "mflix/README-JAVA-SPRING.md", to: "README.md" }
46+
- copy: { from: "mflix/check-requirements-java.sh", to: "check-requirements.sh" }
4647
- copy: { from: "mflix/.gitignore-java", to: ".gitignore" }
4748
commit_strategy:
4849
pr_title: "Update MFlix application from docs-sample-apps"
@@ -67,7 +68,8 @@ workflows:
6768
transformations:
6869
- move: { from: "mflix/client", to: "client" }
6970
- move: { from: "mflix/server/js-express", to: "server" }
70-
- copy: { from: "mflix/README-JAVASCRIPT-EXPRESS.md", to: "README.md" }
71+
- copy: { from: "mflix/README-NODE-EXPRESS.md", to: "README.md" }
72+
- copy: { from: "mflix/check-requirements-js.sh", to: "check-requirements.sh" }
7173
- copy: { from: "mflix/.gitignore-js", to: ".gitignore" }
7274
commit_strategy:
7375
pr_title: "Update MFlix application from docs-sample-apps"
@@ -93,6 +95,7 @@ workflows:
9395
- move: { from: "mflix/client", to: "client" }
9496
- move: { from: "mflix/server/python-fastapi", to: "server" }
9597
- copy: { from: "mflix/README-PYTHON-FASTAPI.md", to: "README.md" }
98+
- copy: { from: "mflix/check-requirements-python.sh", to: "check-requirements.sh" }
9699
- copy: { from: "mflix/.gitignore-python", to: ".gitignore" }
97100
commit_strategy:
98101
pr_title: "Update MFlix application from docs-sample-apps"

.github/ISSUE_TEMPLATE.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,38 @@
55
## Sample App Information
66

77
**Which sample app are you using?**
8+
89
<!-- Check one -->
10+
911
- [ ] Java (Spring Boot)
10-
- [ ] JavaScript (Express.js)
12+
- [ ] Node (Express.js)
1113
- [ ] Python (FastAPI)
1214

1315
## Environment Details
1416

1517
**MongoDB Database Version:**
18+
1619
<!-- e.g., 7.0, 8.0, etc. -->
1720

1821
**MongoDB Driver Version:**
22+
1923
<!-- e.g., Java Driver 5.2.0, Node.js Driver 6.10.0, PyMongo 4.10.1, etc. -->
2024

2125
**Deployment Type:**
26+
2227
<!-- Check one -->
28+
2329
- [ ] Local MongoDB instance
2430
- [ ] MongoDB Atlas (cloud)
2531
- [ ] Docker container
2632
- [ ] Other (please specify):
2733

2834
**Operating System:**
35+
2936
<!-- e.g., macOS 14.5, Ubuntu 22.04, Windows 11, etc. -->
3037

3138
**Runtime Version:**
39+
3240
<!-- e.g., Java 17, Node.js 20.11.0, Python 3.11, etc. -->
3341

3442
## Steps to Reproduce
@@ -73,4 +81,3 @@ Before submitting this issue, please confirm:
7381
- [ ] I have verified my MongoDB connection string is correct
7482
- [ ] I have installed all required dependencies
7583
- [ ] I have searched existing issues to avoid duplicates
76-

.github/workflows/run-python-tests.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,13 @@ jobs:
107107
working-directory: mflix/server/python-fastapi
108108
run: pytest -m unit --verbose --tb=short --junit-xml=test-results-unit.xml
109109
env:
110-
MONGO_URI: mongodb://localhost:27017
111-
MONGO_DB: sample_mflix
110+
MONGODB_URI: mongodb://localhost:27017
112111

113112
- name: Run integration tests
114113
working-directory: mflix/server/python-fastapi
115114
run: pytest -m integration --verbose --tb=short --junit-xml=test-results-integration.xml
116115
env:
117-
MONGO_URI: mongodb://localhost:27017/?directConnection=true
118-
MONGO_DB: sample_mflix
116+
MONGODB_URI: mongodb://localhost:27017/?directConnection=true
119117

120118
- name: Upload test results
121119
uses: actions/upload-artifact@v4

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ The sample app provides a Next.js frontend in the `client` directory, with the
1414
choice of three backend stacks in the `server` directory:
1515

1616
- Java: Spring Boot
17-
- JavaScript: Express.js
17+
- Node.js: Express.js
1818
- Python: FastAPI
1919

2020
```
@@ -34,7 +34,7 @@ choice of three backend stacks in the `server` directory:
3434
This repository serves as the source for the following artifact repositories:
3535

3636
- Java: [mongodb/sample-app-java-mflix](https://github.com/mongodb/sample-app-java-mflix)
37-
- JavaScript: [mongodb/sample-app-nodejs-mflix](https://github.com/mongodb/sample-app-nodejs-mflix)
37+
- Node.js: [mongodb/sample-app-nodejs-mflix](https://github.com/mongodb/sample-app-nodejs-mflix)
3838
- Python: [mongodb/sample-app-python-mflix](https://github.com/mongodb/sample-app-python-mflix)
3939

4040
## Development
@@ -46,9 +46,9 @@ to a target repository for each sample app. For configuration details, refer to
4646
### Branching Model
4747

4848
For development, work from the `development` branch. Make incremental PRs
49-
containing new features and bug fixes to `development`, *not* `main`.
49+
containing new features and bug fixes to `development`, _not_ `main`.
5050

51-
When all development work is complete, *then* create a release PR from
51+
When all development work is complete, _then_ create a release PR from
5252
`development` to `main`. Upon merging to `main,` the copier tool runs
5353
automatically. It creates a new PR in the target repository, which must be
5454
tested and merged manually.
@@ -91,7 +91,7 @@ To test and verify the PR, navigate to the target repository - see
9191
- [ ] Run the tests
9292
- [ ] Run the application and verify that it functions as expected.
9393
- [ ] Review the `deprecated_examples.json` file for any files that need to be
94-
deleted. If files are deleted:
94+
deleted. If files are deleted:
9595
- [ ] Add a commit to the copier PR to delete the files from the target repository.
9696
- [ ] Merge the PR.
9797

@@ -100,7 +100,7 @@ To test and verify the PR, navigate to the target repository - see
100100
If you are a developer having issues with the sample app, feel free to open an
101101
issue in this repository. Please include the following information:
102102

103-
- [ ] The sample app you are using (Java, JavaScript, or Python)
103+
- [ ] The sample app you are using (Java, Node.js, or Python)
104104
- [ ] The version of the MongoDB database you are using
105105
- [ ] The version of the MongoDB driver you are using
106106
- [ ] What type of deployment you're using (local, Atlas, etc.)

mflix/README-JAVA-SPRING.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@ The `sample_mflix` dataset contains movies released up to **2016**. Searching fo
2828
- **Voyage AI API key** (For MongoDB Vector Search)
2929
- [Get a Voyage AI API key](https://www.voyageai.com/)
3030

31+
## Verify Requirements
32+
33+
Before getting started, run the verification script to check if you have the required runtime:
34+
35+
```bash
36+
./check-requirements-java.sh --pre
37+
```
38+
39+
This checks that Java and JAVA_HOME are configured correctly. Run with `--help` for more options.
40+
3141
## Getting Started
3242

3343
### 1. Configure the Backend
@@ -48,28 +58,19 @@ Edit the `.env` file and set your MongoDB connection string:
4858

4959
```env
5060
# MongoDB Connection
51-
# Replace with your MongoDB Atlas connection string or local MongoDB URI
5261
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority
5362
54-
# Voyage AI Configuration
55-
# API key for Voyage AI embedding model (required for Vector Search)
63+
# Voyage AI Configuration (optional - required for Vector Search)
5664
VOYAGE_API_KEY=your_voyage_api_key
5765
5866
# Server Configuration
59-
# Port on which the Spring Boot application will run
6067
PORT=3001
6168
6269
# CORS Configuration
63-
# Allowed origin for cross-origin requests (frontend URL)
64-
# For multiple origins, separate with commas
65-
CORS_ORIGIN=http://localhost:3000
66-
67-
# Optional: Enable MongoDB Search tests
68-
# Uncomment the following line to enable Search tests
69-
# ENABLE_SEARCH_TESTS=true
70+
CORS_ORIGINS=http://localhost:3000
7071
```
7172

72-
**Note:** Replace `username`, `password`, and `cluster` with your
73+
**Note:** Replace `<username>`, `<password>`, and `<cluster>` with your
7374
actual MongoDB Atlas credentials. Replace `your_voyage_api_key` with
7475
your key.
7576

@@ -190,6 +191,16 @@ cd client
190191
npm run lint
191192
```
192193

194+
## Verify Setup
195+
196+
After completing the setup, run the full verification to ensure everything is configured correctly:
197+
198+
```bash
199+
./check-requirements-java.sh
200+
```
201+
202+
This checks your Java environment, Maven dependencies, `.env` configuration, and frontend setup.
203+
193204
## Issues
194205

195206
If you have problems running the sample app, please check the following:
Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# JavaScript Express.js MongoDB Sample MFlix Application
1+
# Node Express.js MongoDB Sample MFlix Application
22

33
This is a full-stack movie browsing application built with Express.js and Next.js, demonstrating MongoDB operations using the `sample_mflix` dataset. The application showcases CRUD operations, aggregations, and MongoDB Search using the native MongoDB Node.js driver.
44

@@ -27,6 +27,16 @@ The `sample_mflix` dataset contains movies released up to **2016**. Searching fo
2727
- **Voyage AI API key** (For MongoDB Vector Search)
2828
- [Get a Voyage AI API key](https://www.voyageai.com/)
2929

30+
## Verify Requirements
31+
32+
Before getting started, run the verification script to check if you have the required runtime:
33+
34+
```bash
35+
./check-requirements-js.sh --pre
36+
```
37+
38+
This checks that Node.js and npm are installed with the correct versions. Run with `--help` for more options.
39+
3040
## Getting Started
3141

3242
### 1. Configure the Backend
@@ -61,7 +71,7 @@ NODE_ENV=development
6171
# CORS Configuration
6272
# Allowed origin for cross-origin requests (frontend URL)
6373
# For multiple origins, separate with commas
64-
CORS_ORIGIN=http://localhost:3000
74+
CORS_ORIGINS=http://localhost:3000
6575
6676
# Optional: Enable MongoDB Search tests
6777
# Uncomment the following line to enable Search tests
@@ -89,7 +99,6 @@ From the `server` directory, run:
8999
npm run dev
90100
```
91101

92-
93102
Or for production mode, run:
94103

95104
```bash
@@ -98,6 +107,7 @@ npm start
98107
```
99108

100109
The server will start on `http://localhost:3001`. You can verify it's running by visiting:
110+
101111
- API root: http://localhost:3001/
102112
- API documentation (Swagger UI): http://localhost:3001/api-docs
103113

@@ -126,6 +136,7 @@ The Next.js application will start on `http://localhost:3000`.
126136
### 5. Access the Application
127137

128138
Open your browser and navigate to:
139+
129140
- **Frontend:** http://localhost:3000
130141
- **Backend API:** http://localhost:3001
131142
- **API Documentation:** http://localhost:3001/api-docs
@@ -147,6 +158,7 @@ Open your browser and navigate to:
147158
### Backend Development
148159

149160
The Express.js backend uses:
161+
150162
- **Express.js 5** for REST API
151163
- **MongoDB Node.js Driver** for database operations
152164
- **TypeScript** for type safety
@@ -170,6 +182,7 @@ npm run test:coverage
170182
### Frontend Development
171183

172184
The Next.js frontend uses:
185+
173186
- **React 19** with TypeScript
174187
- **Next.js 16** with App Router
175188
- **Turbopack** for fast development builds
@@ -196,6 +209,7 @@ npm start # Starts production server
196209
```
197210

198211
The production build:
212+
199213
- Minifies and optimizes JavaScript and CSS
200214
- Optimizes images and assets
201215
- Generates static pages where possible
@@ -210,6 +224,16 @@ cd client
210224
npm run lint
211225
```
212226

227+
## Verify Setup
228+
229+
After completing the setup, run the full verification to ensure everything is configured correctly:
230+
231+
```bash
232+
./check-requirements-js.sh
233+
```
234+
235+
This checks your Node.js environment, npm dependencies, `.env` configuration, and frontend setup.
236+
213237
## Issues
214238

215239
If you have problems running the sample app, please check the following:

mflix/README-PYTHON-FASTAPI.md

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ The `sample_mflix` dataset contains movies released up to **2016**. Searching fo
3131
- **Voyage AI API key** (For MongoDB Vector Search)
3232
- [Get a Voyage AI API key](https://www.voyageai.com/)
3333

34+
## Verify Requirements
35+
36+
Before getting started, run the verification script to check if you have the required runtime:
37+
38+
```bash
39+
./check-requirements-python.sh --pre
40+
```
41+
42+
This checks that Python and pip are installed with the correct versions. Run with `--help` for more options.
43+
3444
## Getting Started
3545

3646
### 1. Configure the Backend
@@ -50,21 +60,21 @@ cp .env.example .env
5060
Edit the `.env` file and set your MongoDB connection string:
5161

5262
```env
53-
# MongoDB Configuration
54-
MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority
55-
MONGO_DB=sample_mflix
63+
# MongoDB Connection
64+
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority
5665
57-
# Voyage AI Configuration
58-
# API key for Voyage AI embedding model (required for Vector Search)
66+
# Voyage AI Configuration (optional - required for Vector Search)
5967
VOYAGE_API_KEY=your_voyage_api_key
6068
69+
# Server Configuration
70+
PORT=3001
71+
6172
# CORS Configuration
62-
# Comma-separated list of allowed origins for CORS
63-
CORS_ORIGINS=http://localhost:3000,http://localhost:3001
73+
CORS_ORIGINS=http://localhost:3000
6474
```
6575

66-
**Note:** Replace `username`, `password`, and `cluster` with your actual MongoDB Atlas
67-
credentials.
76+
**Note:** Replace `<username>`, `<password>`, and `<cluster>` with your actual MongoDB Atlas
77+
credentials. Replace `your_voyage_api_key` with your key.
6878

6979
Make a virtual environment:
7080

@@ -196,6 +206,16 @@ cd client
196206
npm run lint
197207
```
198208

209+
## Verify Setup
210+
211+
After completing the setup, run the full verification to ensure everything is configured correctly:
212+
213+
```bash
214+
./check-requirements-python.sh
215+
```
216+
217+
This checks your Python environment, dependencies, `.env` configuration, and frontend setup.
218+
199219
## Issues
200220

201221
If you have problems running the sample app, please check the following:

0 commit comments

Comments
 (0)