Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .copier/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ workflows:
- move: { from: "mflix/client", to: "client" }
- move: { from: "mflix/server/java-spring", to: "server" }
- copy: { from: "mflix/README-JAVA-SPRING.md", to: "README.md" }
- copy: { from: "mflix/check-requirements-java.sh", to: "check-requirements.sh" }
- copy: { from: "mflix/.gitignore-java", to: ".gitignore" }
commit_strategy:
pr_title: "Update MFlix application from docs-sample-apps"
Expand All @@ -67,7 +68,8 @@ workflows:
transformations:
- move: { from: "mflix/client", to: "client" }
- move: { from: "mflix/server/js-express", to: "server" }
- copy: { from: "mflix/README-JAVASCRIPT-EXPRESS.md", to: "README.md" }
- copy: { from: "mflix/README-NODE-EXPRESS.md", to: "README.md" }
- copy: { from: "mflix/check-requirements-js.sh", to: "check-requirements.sh" }
- copy: { from: "mflix/.gitignore-js", to: ".gitignore" }
commit_strategy:
pr_title: "Update MFlix application from docs-sample-apps"
Expand All @@ -93,6 +95,7 @@ workflows:
- move: { from: "mflix/client", to: "client" }
- move: { from: "mflix/server/python-fastapi", to: "server" }
- copy: { from: "mflix/README-PYTHON-FASTAPI.md", to: "README.md" }
- copy: { from: "mflix/check-requirements-python.sh", to: "check-requirements.sh" }
- copy: { from: "mflix/.gitignore-python", to: ".gitignore" }
commit_strategy:
pr_title: "Update MFlix application from docs-sample-apps"
Expand Down
11 changes: 9 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,30 +5,38 @@
## Sample App Information

**Which sample app are you using?**

<!-- Check one -->

- [ ] Java (Spring Boot)
- [ ] JavaScript (Express.js)
- [ ] Node (Express.js)
- [ ] Python (FastAPI)

## Environment Details

**MongoDB Database Version:**

<!-- e.g., 7.0, 8.0, etc. -->

**MongoDB Driver Version:**

<!-- e.g., Java Driver 5.2.0, Node.js Driver 6.10.0, PyMongo 4.10.1, etc. -->

**Deployment Type:**

<!-- Check one -->

- [ ] Local MongoDB instance
- [ ] MongoDB Atlas (cloud)
- [ ] Docker container
- [ ] Other (please specify):

**Operating System:**

<!-- e.g., macOS 14.5, Ubuntu 22.04, Windows 11, etc. -->

**Runtime Version:**

<!-- e.g., Java 17, Node.js 20.11.0, Python 3.11, etc. -->

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

6 changes: 2 additions & 4 deletions .github/workflows/run-python-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,13 @@ jobs:
working-directory: mflix/server/python-fastapi
run: pytest -m unit --verbose --tb=short --junit-xml=test-results-unit.xml
env:
MONGO_URI: mongodb://localhost:27017
MONGO_DB: sample_mflix
MONGODB_URI: mongodb://localhost:27017

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

- name: Upload test results
uses: actions/upload-artifact@v4
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The sample app provides a Next.js frontend in the `client` directory, with the
choice of three backend stacks in the `server` directory:

- Java: Spring Boot
- JavaScript: Express.js
- Node.js: Express.js
- Python: FastAPI

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

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

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

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

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

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

- [ ] The sample app you are using (Java, JavaScript, or Python)
- [ ] The sample app you are using (Java, Node.js, or Python)
- [ ] The version of the MongoDB database you are using
- [ ] The version of the MongoDB driver you are using
- [ ] What type of deployment you're using (local, Atlas, etc.)
Expand Down
35 changes: 23 additions & 12 deletions mflix/README-JAVA-SPRING.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ The `sample_mflix` dataset contains movies released up to **2016**. Searching fo
- **Voyage AI API key** (For MongoDB Vector Search)
- [Get a Voyage AI API key](https://www.voyageai.com/)

## Verify Requirements

Before getting started, run the verification script to check if you have the required runtime:

```bash
./check-requirements-java.sh --pre
```

This checks that Java and JAVA_HOME are configured correctly. Run with `--help` for more options.

## Getting Started

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

```env
# MongoDB Connection
# Replace with your MongoDB Atlas connection string or local MongoDB URI
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority

# Voyage AI Configuration
# API key for Voyage AI embedding model (required for Vector Search)
# Voyage AI Configuration (optional - required for Vector Search)
VOYAGE_API_KEY=your_voyage_api_key

# Server Configuration
# Port on which the Spring Boot application will run
PORT=3001

# CORS Configuration
# Allowed origin for cross-origin requests (frontend URL)
# For multiple origins, separate with commas
CORS_ORIGIN=http://localhost:3000

# Optional: Enable MongoDB Search tests
# Uncomment the following line to enable Search tests
# ENABLE_SEARCH_TESTS=true
CORS_ORIGINS=http://localhost:3000
```

**Note:** Replace `username`, `password`, and `cluster` with your
**Note:** Replace `<username>`, `<password>`, and `<cluster>` with your
actual MongoDB Atlas credentials. Replace `your_voyage_api_key` with
your key.

Expand Down Expand Up @@ -190,6 +191,16 @@ cd client
npm run lint
```

## Verify Setup

After completing the setup, run the full verification to ensure everything is configured correctly:

```bash
./check-requirements-java.sh
```

This checks your Java environment, Maven dependencies, `.env` configuration, and frontend setup.

## Issues

If you have problems running the sample app, please check the following:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# JavaScript Express.js MongoDB Sample MFlix Application
# Node Express.js MongoDB Sample MFlix Application

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.

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

## Verify Requirements

Before getting started, run the verification script to check if you have the required runtime:

```bash
./check-requirements-js.sh --pre
```

This checks that Node.js and npm are installed with the correct versions. Run with `--help` for more options.

## Getting Started

### 1. Configure the Backend
Expand Down Expand Up @@ -61,7 +71,7 @@ NODE_ENV=development
# CORS Configuration
# Allowed origin for cross-origin requests (frontend URL)
# For multiple origins, separate with commas
CORS_ORIGIN=http://localhost:3000
CORS_ORIGINS=http://localhost:3000

# Optional: Enable MongoDB Search tests
# Uncomment the following line to enable Search tests
Expand Down Expand Up @@ -89,7 +99,6 @@ From the `server` directory, run:
npm run dev
```


Or for production mode, run:

```bash
Expand All @@ -98,6 +107,7 @@ npm start
```

The server will start on `http://localhost:3001`. You can verify it's running by visiting:

- API root: http://localhost:3001/
- API documentation (Swagger UI): http://localhost:3001/api-docs

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

Open your browser and navigate to:

- **Frontend:** http://localhost:3000
- **Backend API:** http://localhost:3001
- **API Documentation:** http://localhost:3001/api-docs
Expand All @@ -147,6 +158,7 @@ Open your browser and navigate to:
### Backend Development

The Express.js backend uses:

- **Express.js 5** for REST API
- **MongoDB Node.js Driver** for database operations
- **TypeScript** for type safety
Expand All @@ -170,6 +182,7 @@ npm run test:coverage
### Frontend Development

The Next.js frontend uses:

- **React 19** with TypeScript
- **Next.js 16** with App Router
- **Turbopack** for fast development builds
Expand All @@ -196,6 +209,7 @@ npm start # Starts production server
```

The production build:

- Minifies and optimizes JavaScript and CSS
- Optimizes images and assets
- Generates static pages where possible
Expand All @@ -210,6 +224,16 @@ cd client
npm run lint
```

## Verify Setup

After completing the setup, run the full verification to ensure everything is configured correctly:

```bash
./check-requirements-js.sh
```

This checks your Node.js environment, npm dependencies, `.env` configuration, and frontend setup.

## Issues

If you have problems running the sample app, please check the following:
Expand Down
38 changes: 29 additions & 9 deletions mflix/README-PYTHON-FASTAPI.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,16 @@ The `sample_mflix` dataset contains movies released up to **2016**. Searching fo
- **Voyage AI API key** (For MongoDB Vector Search)
- [Get a Voyage AI API key](https://www.voyageai.com/)

## Verify Requirements

Before getting started, run the verification script to check if you have the required runtime:

```bash
./check-requirements-python.sh --pre
```

This checks that Python and pip are installed with the correct versions. Run with `--help` for more options.

## Getting Started

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

```env
# MongoDB Configuration
MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority
MONGO_DB=sample_mflix
# MongoDB Connection
MONGODB_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/sample_mflix?retryWrites=true&w=majority

# Voyage AI Configuration
# API key for Voyage AI embedding model (required for Vector Search)
# Voyage AI Configuration (optional - required for Vector Search)
VOYAGE_API_KEY=your_voyage_api_key

# Server Configuration
PORT=3001

# CORS Configuration
# Comma-separated list of allowed origins for CORS
CORS_ORIGINS=http://localhost:3000,http://localhost:3001
CORS_ORIGINS=http://localhost:3000
```

**Note:** Replace `username`, `password`, and `cluster` with your actual MongoDB Atlas
credentials.
**Note:** Replace `<username>`, `<password>`, and `<cluster>` with your actual MongoDB Atlas
credentials. Replace `your_voyage_api_key` with your key.

Make a virtual environment:

Expand Down Expand Up @@ -196,6 +206,16 @@ cd client
npm run lint
```

## Verify Setup

After completing the setup, run the full verification to ensure everything is configured correctly:

```bash
./check-requirements-python.sh
```

This checks your Python environment, dependencies, `.env` configuration, and frontend setup.

## Issues

If you have problems running the sample app, please check the following:
Expand Down
Loading