diff --git a/v3-docs/docs/.vitepress/config.mts b/v3-docs/docs/.vitepress/config.mts
index 10ddb8fece..66de626a3c 100644
--- a/v3-docs/docs/.vitepress/config.mts
+++ b/v3-docs/docs/.vitepress/config.mts
@@ -40,7 +40,13 @@ export default defineConfig({
{
text: 'Migration from Meteor.js 2',
link: 'https://v3-migration-docs.meteor.com'
- }
+ },
+ {
+ text: 'Tutorials',
+ items: [
+ { text: 'Meteor.js 3 + Vue.js 3', link: '/tutorials/meteorjs-vue' },
+ ]
+ },
]
},
{
@@ -217,7 +223,7 @@ export default defineConfig({
link: '/api/top-level-await'
}
],
- collapsed: false,
+ collapsed: true,
},
{
text: "Packages",
@@ -349,6 +355,13 @@ export default defineConfig({
],
collapsed: true,
},
+ {
+ text: "Tutorials",
+ items: [
+ { link: "/tutorials/meteorjs-vue", text: "Meteor.js + Vue" },
+ ],
+ collapsed: true,
+ },
{
text: "Changelog",
items: [
diff --git a/v3-docs/docs/tutorials/meteorjs-vue.md b/v3-docs/docs/tutorials/meteorjs-vue.md
new file mode 100644
index 0000000000..f9c258cc89
--- /dev/null
+++ b/v3-docs/docs/tutorials/meteorjs-vue.md
@@ -0,0 +1,1380 @@
+# Meteor.js 3 + Vue.js 3 Tutorial
+
+In this tutorial, we will create a simple To-Do app using [Vue 3](https://vuejs.org/) and Meteor 3.0. Meteor works well with other frameworks like [Blaze](https://www.blazejs.org/), [React](https://react.dev/), [Solid](https://www.solidjs.com/), and [Svelte](https://svelte.dev/).
+
+Vue.js is a powerful JavaScript framework for making user interfaces. It helps you build interactive applications by using templates that connect to data and update automatically when the data changes. Vue.js templates use a simple syntax similar to HTML and work with Vue’s reactivity system to show components in the browser.
+
+To start building your Vue.js app, you'll need a code editor. If you're unsure which one to choose, [Visual Studio Code](https://code.visualstudio.com/) is a good option. After installing it, you can enhance your experience by adding extensions like [Meteor Toolbox](https://marketplace.visualstudio.com/items?itemName=meteor-toolbox.meteor-toolbox) and [Vue Language Features](https://marketplace.visualstudio.com/items?itemName=Vue.volar).
+
+Let’s begin building your app!
+
+## 1: Creating the app
+
+### 1.1: Install Meteor.js
+
+First, ensure you have Node.js version 20 installed. You can install the latest version of Meteor by using the command:
+
+```shell
+npx meteor
+```
+
+If you encounter any issues, please refer to the requirements and details in [our documentation](https://v3-docs.meteor.com/about/install.html).
+
+
+### 1.2: Create a Meteor.js Project
+
+To set up Meteor with Vue easily, run the following command, replacing `simple-todos-vue` with your chosen project name:
+
+```shell
+meteor create --vue simple-todos-vue --release=3.0.2
+```
+
+Meteor will create all the necessary files for you. The `--vue` flag generates a project using Vue, Vite and Tailwind CSS.
+
+You will find the `client` directory contains files for your client-side setup. Inside, there should be an empty `main.js` file required for Meteor's import mode. However, with Vite, the entry point is set in the `vite.config.js` file, pointing to `imports/ui/main.js`, which is where Meteor renders the main component.
+
+Check the server directory for the server setup where you will see `server/main.js` populating your MongoDB database with some default data. There's no need to install MongoDB separately, as Meteor includes an embedded version.
+
+To run your app, use:
+
+```shell
+meteor npm run start
+```
+
+Your Vue code will be located in the `imports/ui directory`, with `App.vue` as the root component of your app.
+
+Take a moment to explore the files created by Meteor. You don’t have to understand everything right away, but it helps to know where they are.
+
+
+### 1.3: Cleaning the UI Folder
+
+
+Let's remove some unnecessary files for a cleaner start. Keep only `App.vue`, `main.js`, and `router.js` in the `imports/ui` folder. Delete the following files: `About.vue`, `AppMenu.vue`, `Hello.vue`, `Home.vue`, and `Info.vue`.
+
+Next, update `router.js` to remove references to the deleted components:
+
+`imports/ui/router.js`
+
+```javascript
+import { createRouter, createWebHistory } from 'vue-router';
+import App from './App.vue';
+
+export const router = createRouter({
+ history: createWebHistory(),
+ routes: [
+ {
+ path: '/',
+ name: 'home',
+ component: App,
+ },
+ ],
+});
+```
+
+This file is where you set up your routes and decide which component to render for each path.
+
+Also, update the App component since some components no longer exist.
+
+`imports/ui/App.vue`
+
+```vue
+
+
+
Hello Meteor
+
+
+```
+
+
+### 1.4: Creating Sample Tasks
+
+
+We’ll create our Vue components in the `imports/ui/components` folder. Start by making this folder and adding a file named `Task.vue` inside it.
+
+This file will export a Vue component called `Task`, representing an individual task in your To-Do list.
+
+
+`imports/ui/components/Task.vue`
+
+```vue
+
+
+
+ {{ task.text }}
+
+```
+
+
+Since the `Task` component will be part of a list, it returns a `li` element.
+
+For now, we won’t connect to our database, so define some sample data in the `App.vue` file to display a list of tasks. Create an array and a function to return this array.
+
+
+`imports/ui/App.vue`
+
+```vue
+
+
+
+
+
Hello Meteor
+
+
+```
+
+
+### 1.5: Rendering Tasks
+
+
+Now let's add some simple rendering logic with Vue to display our list items using the `Task` component.
+
+Update the template of the `App` component to include the list of tasks:
+
+
+`imports/ui/App.vue`
+
+```vue
+
+
+
+
+```
+
+
+> For more information on Vue iterations, you can read [here](https://vuejs.org/api/built-in-directives.html#v-for).
+
+In the next step, we will connect to the MongoDB database to store our tasks.
+
+
+## 2: Collections
+
+
+Meteor already sets up MongoDB for you. In order to use our database we need to create a *collection*, which is where we will store our *documents*, in our case our `tasks`.
+
+> You can read more about collections [here](http://guide.meteor.com/collections.html).
+
+
+In this step we will implement all the necessary code to have a basic collection for our tasks up and running.
+
+### 2.1: Create Tasks Collection
+
+
+Before creating our collection, let's remove the `links.js` file from the `imports/api` folder because we won't use it. Now, you can create a new collection to store our tasks by creating a new file named `TasksCollection.js` inside the `imports/api` folder.
+
+`imports/api/TasksCollection.js`
+
+```javascript
+import { Mongo } from 'meteor/mongo';
+
+export const TasksCollection = new Mongo.Collection('tasks');
+```
+
+
+The code above instantiates a new MongoDB collection and exports it. You can read more about app structure and imports/exports [here](https://guide.meteor.com/structure.html).
+
+### 2.2: Initialize Tasks Collection
+
+
+To make our collection work, you need to import it on the server to set things up.
+
+You can use import `'./imports/api/TasksCollection'` or `import { TasksCollection } from './imports/api/TasksCollection'` if you plan to use `TasksCollection` in the same file. Just make sure it's imported.
+
+Now, it’s easy to check if there is data in our collection, or we can easily add some sample data.
+
+Replace the old content in `server/main.js` with the code below.
+
+
+`server/main.js`
+
+```javascript
+import { Meteor } from 'meteor/meteor';
+import { TasksCollection } from '../imports/api/TasksCollection';
+
+const insertTask = async text => await TasksCollection.insertAsync({text});
+
+Meteor.startup(async () => {
+ const tasksCount = await TasksCollection.find().countAsync();
+ if (tasksCount === 0) {
+ await insertTask('First Task');
+ await insertTask('Second Task');
+ await insertTask('Third Task');
+ await insertTask('Fourth Task');
+ await insertTask('Fifth Task');
+ await insertTask('Sixth Task');
+ await insertTask('Seventh Task');
+ }
+});
+```
+
+
+So you are importing the `TasksCollection` and adding a few tasks on it calling a function to insert this string as our `text` field in our `task` document.
+
+### 2.3: Render Tasks Collection
+
+
+Now comes the fun part, you will render the tasks using a “data container” to feed Meteor’s reactive data into Vue’s component hierarchy. We will use the [vue-meteor-tracker](https://www.npmjs.com/package/vue-meteor-tracker) package for this.
+
+> Meteor works with Meteor packages and NPM packages, usually Meteor packages are using Meteor internals or other Meteor packages.
+
+
+The `vue-meteor-tracker` package is already included in the Vue skeleton, so you don’t need to add it.
+
+> The `vue-meteor-tracker` package doesn't support async calls yet, so we need to use sync functions for now.
+
+
+When importing code from a Meteor package the only difference from NPM modules is that you need to prepend `meteor/` in the from part of your import.
+First we need to implement a subscription at the `App` component to get the tasks updated from the server. It can be done simply by using the `subscribe` and `autorun` functions from `vue-meteor-tracker`.
+
+
+`imports/ui/App.vue`
+
+```vue
+
+
+
+
+
+```
+
+
+To be able to fetch data in the client, you need to publish it in the server. To do it, create a file called `tasksPublications.js` and add the following code:
+
+`imports/api/tasksPublications.js`
+
+```javascript
+import { Meteor } from 'meteor/meteor';
+import { TasksCollection } from './TasksCollection';
+
+Meteor.publish('tasks', function publishTasks() {
+ return TasksCollection.find();
+});
+```
+
+
+Now, import it on the server:
+
+`server/main.js`
+
+```javascript
+import '../imports/api/tasksPublications';
+```
+
+
+If you want to learn more about how publications works, you can read the [Meteor Guide](https://docs.meteor.com/api/pubsub.html).
+
+Now, your app should look like this:
+
+
+
+You can change your data on MongoDB in the server and your app will react and re-render for you.
+
+You can connect to your MongoDB running `meteor mongo` in the terminal from your app folder or using a MongoDB UI client, like [NoSQLBooster](https://nosqlbooster.com/downloads) or [MongoDB Compass](https://www.mongodb.com/products/tools/compass). Your embedded MongoDB is running in the port `3001`.
+
+See how to connect:
+
+
+
+See your database:
+
+
+
+You can double-click your collection to see the documents stored on it:
+
+
+
+## 3: Forms and Events
+
+
+Now, we need to let users interact with the stored data. In our case, the first interaction is to add new tasks. One of the main ways in which a user can insert or edit data in a website is through forms, using the `