Skip to content

Commit 04bfefd

Browse files
add deploy note
1 parent 0ce748a commit 04bfefd

File tree

5 files changed

+23
-21
lines changed

5 files changed

+23
-21
lines changed

tutorial/simple-todos/09-methods.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Meteor Method is a way to communicate with your server using the function `Meteo
1212

1313
> You can read more about Methods [here](https://guide.meteor.com/methods.html).
1414
15-
## 8.1: Disable Quick Prototyping
15+
## 9.1: Disable Quick Prototyping
1616

1717
Every newly created Meteor project has the `insecure` package installed by default.
1818

@@ -26,7 +26,7 @@ meteor remove insecure
2626

2727
Now your app changes don't work anymore as you have revoked all client-side database permissions. Try to insert a new task for example, you are going to see `insert failed: Access denied` in your browser console.
2828

29-
## 8.2: Add Task Methods
29+
## 9.2: Add Task Methods
3030

3131
Now you need to define methods.
3232

@@ -114,7 +114,7 @@ import '/imports/api/tasksMethods';
114114

115115
See that you don't need to get any symbol back from the import, you only need to ask for your server to import the file then `Meteor.methods` will be evaluated and will register your methods on server startup.
116116

117-
## 8.3: Implement Method Calls
117+
## 9.3: Implement Method Calls
118118

119119
As you have defined your methods, you need to update the places we were operating the collection to use them instead.
120120

@@ -173,7 +173,7 @@ Now your inputs and buttons will start working again. What have you gained?
173173
1. We can add extra validation logic to the methods later if we want.
174174
1. Our client code is more isolated from our database logic. Instead of a lot of stuff happening in our event handlers, we have methods callable from anywhere.
175175

176-
## 8.4: api and db folders
176+
## 9.4: api and db folders
177177

178178
We would like to take a moment here to think, the folder where the collection file is located is `api` but API in your project means a communication layer between server and client but the collection is not performing this role anymore. So you should move your `TasksCollection` file to a new folder called `db`.
179179

tutorial/simple-todos/10-publications.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: '10: Publications'
44

55
Now we have moved all of our app's sensitive code into methods, we need to learn about the other half of Meteor's security story. Until now, we have worked assuming the entire database is present on the client, meaning if we call `Tasks.find()` we will get every task in the collection. That's not good if users of our application want to store privacy-sensitive data. We need a way of controlling which data Meteor sends to the client-side database.
66

7-
## 9.1: autopublish
7+
## 10.1: autopublish
88

99
Just like with `insecure` in the last step, all new Meteor apps start with the `autopublish` package, which automatically synchronizes all the database contents to the client. So you should remove it:
1010

@@ -17,7 +17,7 @@ When the app refreshes, the task list will be empty. Without the `autopublish` p
1717
- `Meteor.publish`: allows the data to be published from the server to the client;
1818
- `Meteor.subscribe`: allows the client code to ask for data to the client.
1919

20-
## 9.2: Tasks Publication
20+
## 10.2: Tasks Publication
2121

2222
You need to add first a publication to your server, this publication should publish all the tasks from the authenticated user. As in the `Methods` you can also use `this.userId` in publication functions to get the authenticated `userId`.
2323

@@ -48,7 +48,7 @@ import '/imports/api/tasksMethods';
4848
import '/imports/api/tasksPublications';
4949
```
5050

51-
## 9.3: Tasks Subscription
51+
## 10.3: Tasks Subscription
5252

5353
Then we can subscribe to that publication in the client.
5454

@@ -84,7 +84,7 @@ It's also a good moment for us to refactor our code to use a single `useTracker`
8484
..
8585
```
8686

87-
## 9.4: Loading state
87+
## 10.4: Loading state
8888

8989
You should also add a loading state for your app, that means, while the subscription data is not ready you should inform to your user. To discover if the subscription is ready or not you should get the return of the `subscribe` call, it is an object with the subscription state including the `ready` function that will return a `boolean`.
9090

@@ -125,7 +125,7 @@ Once you have done this, all the tasks will reappear.
125125

126126
Calling `Meteor.publish` on the server registers a publication named `tasks`. When `Meteor.subscribe` is called on the client with the publication name, the client subscribes to all the data from that publication, which in this case is all the tasks in the database for the authenticated user.
127127

128-
## 9.5: Check User Permission
128+
## 10.5: Check User Permission
129129

130130
Only the owner of a task should be able to change certain things. You should change your methods to check if the user that is authenticated is the same user that created the tasks.
131131

tutorial/simple-todos/11-running-on-mobile.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Meteor makes it easy to set up all the tools required to build mobile apps, but
1010

1111
> Important: Mobile set up and settings are very dynamic, if you find any step below not working as specified or any linked document that is not up-to-date, please open an issue, and we are going to update it. You can also open PRs if you know what the change should be.
1212
13-
## 10.1: iOS Simulator
13+
## 11.1: iOS Simulator
1414

1515
If you have a Mac, you can run your app inside the iOS simulator.
1616

@@ -27,7 +27,7 @@ You will see the iOS simulator pop up with your app running inside.
2727

2828
<img width="300px" src="/simple-todos/assets/step11-ios-simulator.png"/>
2929

30-
## 10.2: Android Emulator
30+
## 11.2: Android Emulator
3131

3232
Follow this [guide](https://guide.meteor.com/cordova.html#installing-prerequisites-android) to install all the development prerequisites for Android.
3333

@@ -47,7 +47,7 @@ After some initialization, you will see an Android emulator pop up, running your
4747

4848
<img width="300px" src="/simple-todos/assets/step11-android-emulator.png"/>
4949

50-
## 10.3: Android Device
50+
## 11.3: Android Device
5151

5252
First, complete all the steps above to set up the Android tools on your system. Then, make sure you have [USB Debugging](http://developer.android.com/tools/device.html#developer-device-options) enabled on your phone and it is plugged into your computer with a USB cable. Also, you must quit the Android emulator before running on a device.
5353

@@ -59,7 +59,7 @@ meteor run android-device
5959

6060
The app will be built and installed on your device.
6161

62-
## 10.4: iPhone or iPad
62+
## 11.4: iPhone or iPad
6363

6464
> This requires an Apple developer account.
6565

tutorial/simple-todos/12-testing.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Now we've created a few features for our application, let's add a test to ensure
66

77
We'll write a test that executes one of our Methods and verifies that it works correctly.
88

9-
## 11.1: Install Dependencies
9+
## 12.1: Install Dependencies
1010

1111
We'll add a test driver for the Mocha JavaScript test framework, along with a test assertion library:
1212

@@ -39,7 +39,7 @@ When you run with these options, you can also see the results of the tests in th
3939

4040
<img width="500px" src="/simple-todos/assets/step12-test-report.png"/>
4141

42-
## 11.2: Scaffold Test
42+
## 12.2: Scaffold Test
4343

4444
However, if you would prefer to split your tests across multiple modules, you can do that too. Add a new test module called `imports/api/tasksMethods.tests.js`.
4545

@@ -65,7 +65,7 @@ And import it on `tests/main.js` like `import '/imports/api/tasksMethods.tests.j
6565
import '/imports/api/tasksMethods.tests.js';
6666
```
6767

68-
## 11.3: Prepare Database
68+
## 12.3: Prepare Database
6969

7070
In any test you need to ensure the database is in the state we expect before beginning. You can use Mocha's `beforeEach` construct to do that easily:
7171

@@ -97,7 +97,7 @@ if (Meteor.isServer) {
9797

9898
Here you are creating a single task that's associated with a random userId that'll be different for each test run.
9999

100-
## 11.4: Test Task Removal
100+
## 12.4: Test Task Removal
101101

102102
Now you can write the test to call the `tasks.remove` method as that user and verify the task got deleted, as you are going to test a method and we want to mock the authenticated user you can install this utility package to make your life easier:
103103

@@ -142,7 +142,7 @@ if (Meteor.isServer) {
142142

143143
Remember to import `assert` from `chai` (`import { assert } from 'chai';`)
144144

145-
## 11.5: More tests
145+
## 12.5: More tests
146146

147147
You can add as many tests you want, below you can find a few other tests that can be helpful for you to have more ideas of what to test and how.:
148148

tutorial/simple-todos/13-deploying.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The best place to run your Meteor app is [Galaxy](https://www.meteor.com/cloud).
88

99
> If you have any trouble with this step you should send an email to Galaxy support and they are going to help you, send your message to `support@meteor.com`. Try to explain in detail what is the issue and you are going to receive help as soon as possible. Also make sure you include the subject: `React Tutorial` so you know where are you coming from.
1010
11-
## 12.1: Create your account
11+
## 13.1: Create your account
1212

1313
Do you have a Meteor Cloud Account? No? Ok, let's fix it.
1414

@@ -20,7 +20,7 @@ Sign up with GitHub and proceed from there. It's just going to ask you an userna
2020

2121
Done, your account is created. You can use this account to access [atmospherejs.com](https://atmospherejs.com/), [Forums](https://forums.meteor.com), and much more including Galaxy free deploy.
2222

23-
## 12.2: Deploy it
23+
## 13.2: Deploy it
2424

2525
Now you are ready to deploy, make sure you run `meteor npm install` before deploying to make sure all your dependencies are installed.
2626

@@ -63,12 +63,14 @@ This process usually takes around 5 minutes but it depends on your internet spee
6363
6464
You can check your logs on Galaxy, including the part that Galaxy is building your Docker image and deploying it.
6565

66-
## 12.3: Access and enjoy
66+
## 13.3: Access and enjoy
6767

6868
Now you should be able to access your Galaxy dashboard at `https://galaxy.meteor.com/app/react-tutorial.meteorapp.com` (replacing `react-tutorial` with your sub-domain)
6969

7070
And, of course, be able to access and use your app in the domain that you chose, in our case here [react-tutorial.meteorapp.com](http://react-tutorial.meteorapp.com). Congrats!
7171

72+
Don't forget to update your URLs on Github OAuth Application. Find your application on [this link](https://github.com/settings/developers), and update the `Homepage URL` and `Authorization callback URL` to your app domain, in our case [react-tutorial.meteorapp.com](http://react-tutorial.meteorapp.com)
73+
7274
> We deployed to Galaxy running in the US (us-east-1), we also have Galaxy running in other regions in the world, check the list [here](https://cloud-guide.meteor.com/deploy-region.html)
7375
7476
This is huge, you have your Meteor app running on Galaxy, ready to be used by anyone in the world!

0 commit comments

Comments
 (0)