Skip to content

Commit b9e5af2

Browse files
authored
Cleanup for tutorial phase 2 (#516)
1 parent 86728c5 commit b9e5af2

File tree

7 files changed

+49
-141
lines changed

7 files changed

+49
-141
lines changed

source/includes/steps-tutorial-ios-swift.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ ref: define-the-object-models
9393
content: |
9494
Navigate to the Models.swift file to implement the Realm Object Models used in
9595
this app. First, implement the User model, which contains information about
96-
the user's membership in different projects:
96+
the user's membership in different projects. Notice that the Realm object
97+
models derive from ``Object`` from the ``RealmSwift`` library, which allows
98+
Realm to store them in the Realm Database:
9799
98100
.. literalinclude:: /tutorial/generated/code/final/Models.codeblock.user-model.swift
99101
:language: swift

source/tutorial.txt

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,31 @@ Create a Task Tracker App
1313
:class: singlecol
1414

1515
In this tutorial, you will build a collaborative task tracker app with
16-
{+service+}. After :doc:`setting up the backend for the tutorial
17-
</tutorial/realm-app>` in {+service+}, you can build clients for:
16+
{+service+}. With the app client, users can:
17+
18+
- Register themselves with email and password.
19+
- Sign in to their account with their email and password and sign out later.
20+
- View a list of projects they are a member of.
21+
- View, create, modify, and delete tasks in projects.
22+
- View a list of team members in their project.
23+
- Add and remove team members to their project.
24+
25+
To get started, first:
26+
27+
- :doc:`Set up the backend for the tutorial </tutorial/realm-app>`
28+
29+
Next, complete any of the following clients to work with your new backend:
1830

1931
- :doc:`iOS with Swift </tutorial/ios-swift>`
2032
- :doc:`Android with Kotlin </tutorial/android-kotlin>`
2133
- :doc:`React Native (iOS and Android) with JavaScript </tutorial/react-native>`
22-
- :doc:`The browser with GraphQL, TypeScript, and React </tutorial/web-graphql>`
34+
- :doc:`The browser with GraphQL, JavaScript, and React </tutorial/web-graphql>`
2335
- :doc:`A Node.js Command Line Interface (CLI) </tutorial/nodejs-cli>`
2436

25-
Additionally, you can create a headless :doc:`backend app
26-
</tutorial/backend>` that uses webhooks, functions, and triggers to
27-
integrate with GitHub and MongoDB.
37+
Additionally, you can create a headless backend app that uses webhooks,
38+
functions, and triggers to integrate with GitHub and MongoDB:
39+
40+
- :doc:`Write a GitHub Issue Tracker with MongoDB Realm </tutorial/backend>`
2841

2942
.. toctree::
3043
:titlesonly:
@@ -41,7 +54,13 @@ integrate with GitHub and MongoDB.
4154
iOS with Swift </tutorial/ios-swift>
4255
Android with Kotlin </tutorial/android-kotlin>
4356
React Native with JavaScript </tutorial/react-native>
44-
Web app with React, TypeScript, and GraphQL </tutorial/web-graphql>
45-
Serverless with GitHub Integration </tutorial/backend>
57+
Web app with React, JavaScript, and GraphQL </tutorial/web-graphql>
4658
A Node.js Command Line Interface (CLI) </tutorial/nodejs-cli>
4759

60+
.. toctree::
61+
:titlesonly:
62+
:caption: Additional Tutorial
63+
:hidden:
64+
65+
GitHub Issue Tracker with MongoDB Realm </tutorial/backend>
66+

source/tutorial/android-kotlin.txt

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ Android Kotlin Tutorial
1515
Overview
1616
--------
1717

18-
In this first phase of the tutorial, you will create a task
19-
tracker app that allows users to:
18+
In this tutorial, you will create a task tracker app that allows users to:
2019

2120
- Register themselves with email and password.
2221
- Sign in to their account with their email and password and sign out later.
@@ -44,28 +43,9 @@ Before you begin, ensure you have:
4443
- An Android emulator for testing.
4544
- :ref:`Set up the backend <tutorial-task-tracker-create-realm-app>`.
4645

47-
Define Data Access Permissions and Enable Sync
48-
----------------------------------------------
49-
50-
The backend app is set up with an email/password authentication provider that we
51-
can use to let users sign up and log in. Now, we need to define sync rules and
52-
enable sync so that sync clients can read and write objects.
53-
54-
55-
.. include:: /includes/steps/task-tracker-enable-sync.rst
56-
5746
Set Up the Mobile App
5847
---------------------
5948

60-
.. admonition:: Download the Complete Source Code
61-
:class: note
62-
63-
We host this tutorial application's :github:`complete and ready-to-compile
64-
source code <mongodb-university/realm-tutorial-android-kotlin>` on
65-
GitHub. Just follow the instructions in ``README.md`` to get started. Don't
66-
forget to update the ``build.gradle`` file with your App ID, which you can
67-
find in the {+ui+}.
68-
6949
.. include:: /includes/steps/tutorial-android-kotlin.rst
7050

7151
What's Next?

source/tutorial/ios-swift.txt

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ iOS Swift Tutorial
1515
Overview
1616
--------
1717

18-
In this first phase of the tutorial, you will create a task
19-
tracker app that allows users to:
18+
In this tutorial, you will create a task tracker app that allows users to:
2019

2120
- Register themselves with email and password.
2221
- Sign in to their account with their email and password and sign out later.
23-
- View, create, modify, and delete tasks.
22+
- View a list of projects they are a member of.
23+
- View, create, modify, and delete tasks in projects.
24+
- View a list of team members in their project.
25+
- Add and remove team members to their project.
2426

2527
This tutorial should take around 30 minutes.
2628

@@ -42,27 +44,9 @@ Before you begin, ensure you have:
4244
- `CocoaPods <https://guides.cocoapods.org/using/getting-started.html>`__ 1.6.0 or later.
4345
- :ref:`Set up the backend <tutorial-task-tracker-create-realm-app>`.
4446

45-
Define Data Access Permissions and Enable Sync
46-
----------------------------------------------
47-
48-
The backend app is set up with an email/password authentication provider that we
49-
can use to let users sign up and log in. Now, we need to define sync rules and
50-
enable sync so that sync clients can read and write objects.
51-
52-
.. include:: /includes/steps/task-tracker-enable-sync.rst
53-
5447
Set Up the Mobile App
5548
---------------------
5649

57-
.. admonition:: Download the Complete Source Code
58-
:class: note
59-
60-
We host this tutorial application's :github:`complete and ready-to-compile
61-
source code <mongodb-university/realm-tutorial/tree/main/swift-ios>` on GitHub.
62-
Just follow the instructions in ``README.md`` to get started. Don't forget to
63-
update the ``SceneDelegate.swift`` file with your App ID, which you can find in
64-
the {+ui+}.
65-
6650
.. include:: /includes/steps/tutorial-ios-swift.rst
6751

6852
What's Next?

source/tutorial/nodejs-cli.txt

Lines changed: 6 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,6 @@ This tutorial should take around 30 minutes to complete.
4747
includes copyable code examples and the essential information that you need
4848
to set up a MongoDB Realm application.
4949

50-
.. admonition:: Download the Complete Source Code
51-
:class: note
52-
53-
We host this tutorial application's :github:`complete and ready-to-compile
54-
source code <mongodb-university/realm-tutorial/tree/main/node-cli>` on
55-
GitHub. You will need to update the ``config.js`` file with your App ID,
56-
which you can find in the {+ui+}.
57-
5850
Prerequisites
5951
-------------
6052

@@ -65,16 +57,7 @@ Before you begin, ensure you have:
6557

6658
Once you're set up with these prerequisites, you're ready to start the tutorial.
6759

68-
A. Define Data Access Permissions and Enable Sync
69-
-------------------------------------------------
70-
71-
The backend app is set up with an email/password authentication provider that we
72-
can use to let users sign up and log in. Now, we need to define sync rules and
73-
enable sync so that sync clients can read and write objects.
74-
75-
.. include:: /includes/steps/task-tracker-enable-sync.rst
76-
77-
B. Clone the Client App Repository
60+
A. Clone the Client App Repository
7861
----------------------------------
7962

8063
We've already put together a task tracker CLI application that has most of
@@ -101,7 +84,7 @@ In your terminal, run the following command to install its dependencies:
10184

10285
npm install
10386

104-
C. Explore the App Structure & Components
87+
B. Explore the App Structure & Components
10588
-----------------------------------------
10689

10790
This application has a flat project structure: all of the files are in the root
@@ -152,7 +135,7 @@ following table describes the role of important files in this project:
152135
* - projects.js
153136
- Handles project retrieval and listing.
154137

155-
D. Connect to Your MongoDB Realm App
138+
C. Connect to Your MongoDB Realm App
156139
------------------------------------
157140

158141
To get the app working with your backend, you first need to add your Realm App ID
@@ -188,7 +171,7 @@ At this point, your app is pointing to your backend and opens a connection
188171
to it when you start the app. However, users cannot log in yet, so let's update
189172
that code next.
190173

191-
E. Enable authentication
174+
D. Enable authentication
192175
------------------------
193176

194177
In the ``users.js`` file, we have a ``logIn`` function that prompts the user for
@@ -203,7 +186,7 @@ Find the the ``logIn`` function and add the following code to create a
203186
.. literalinclude:: /tutorial/generated/code/final/users.codeblock.userLogin.js
204187
:emphasize-lines: 17, 18, 19, 22
205188

206-
F. Implement the CRUD methods
189+
E. Implement the CRUD methods
207190
-----------------------------
208191

209192
In the ``tasks.js`` and ``projects.js`` files, there are a number of functions to handle typical
@@ -294,7 +277,7 @@ In ``projects.js``:
294277
.. literalinclude:: /tutorial/generated/code/final/projects.codeblock.getProjects.js
295278
:emphasize-lines: 4, 5
296279

297-
G. Use Realm Functions
280+
F. Use Realm Functions
298281
----------------------
299282

300283
In the ``team.js`` file, there are functions that rely on :ref:`{+service-short+}

source/tutorial/react-native.txt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -51,27 +51,9 @@ Ensure that you have the following:
5151

5252
- :ref:`Set up the backend <tutorial-task-tracker-create-realm-app>`.
5353

54-
Define Data Access Permissions and Enable Sync
55-
----------------------------------------------
56-
57-
The backend app is set up with an email/password authentication provider that we
58-
can use to let users sign up and log in. Now, we need to define sync rules and
59-
enable sync so that sync clients can read and write objects.
60-
61-
.. include:: /includes/steps/task-tracker-enable-sync.rst
62-
6354
Set Up the Mobile App
6455
---------------------
6556

66-
.. admonition:: Download the Complete Source Code
67-
:class: note
68-
69-
We host this tutorial application's :github:`complete and ready-to-compile
70-
source code <mongodb-university/realm-tutorial/tree/main/rn>` on GitHub.
71-
Just follow the instructions in ``README.md`` to get started. Don't forget to
72-
update the ``getRealmApp.js`` file with your App ID, which you can find in
73-
the {+ui+}.
74-
7557
.. include:: /includes/steps/tutorial-react-native.rst
7658

7759
What's Next?

source/tutorial/web-graphql.txt

Lines changed: 7 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -73,49 +73,7 @@ Before you get started, you'll need the following:
7373

7474
Once you're set up with these prerequisites, you're ready to start the tutorial.
7575

76-
.. admonition:: Download the Complete Source Code
77-
:class: note
78-
79-
We host this tutorial application's :github:`complete and ready-to-run source
80-
code <mongodb-university/realm-tutorial/tree/main/web>` on GitHub. You can
81-
use it to check your work or download it to run the app locally.
82-
83-
To get started, follow the instructions in ``README.md``. Don't forget to
84-
update the ``/src/realm/RealmApp.tsx`` file with your App ID, which you can
85-
find in the {+ui+}.
86-
87-
A. Define Data Access Permissions
88-
---------------------------------
89-
90-
.. admonition:: Non-Sync Permissions
91-
:class: important
92-
93-
The permissions in this step only apply if you do not enable sync for the
94-
application. Sync permissions use a different rules system and override any
95-
non-sync permissions when sync is enabled. If you plan to or have already
96-
used the task tracker backend from one of the frontend apps that support
97-
sync, then you can skip this section in favor of the sync permissions
98-
described on the sync app's tutorial page.
99-
100-
The Realm Web SDK and GraphQL API do not use sync, so if you only intend to
101-
build a web client then use these rules.
102-
103-
The backend app is set up with an email/password authentication provider that we
104-
can use to let users sign up and log in and an automatically generated GraphQL
105-
API that we can use work with data.
106-
107-
By default, however, all GraphQL queries from a client application will fail.
108-
109-
To allow users to read and write data, you must first define data access rules
110-
that determine whether a given user has read or write permissions for a given
111-
document.
112-
113-
You define non-sync data access rules for your GraphQL API on the
114-
:guilabel:`Rules` screen of the Realm UI.
115-
116-
.. include:: /includes/steps/task-tracker-server-rules.rst
117-
118-
B. Clone the Client App Repository
76+
A. Clone the Client App Repository
11977
----------------------------------
12078

12179
We've already put together a task tracker browser application that has most of
@@ -143,7 +101,7 @@ tutorial, please check out the ``start`` branch:
143101

144102
git checkout
145103

146-
C. Explore the App Structure & Components
104+
B. Explore the App Structure & Components
147105
-----------------------------------------
148106

149107
The web client is a standard React web application written in
@@ -187,7 +145,7 @@ components and hooks use the code that you write.
187145
`official React website <https://reactjs.org>`_, which has excellent
188146
documentation and tutorials.
189147

190-
D. Connect to Your MongoDB Realm App
148+
C. Connect to Your MongoDB Realm App
191149
------------------------------------
192150

193151
The client app needs to connect to your Realm app so that users can register and
@@ -230,7 +188,7 @@ authentication.
230188
:emphasize-lines: 6
231189

232190

233-
E. Define the GraphQL Schema & Operations
191+
D. Define the GraphQL Schema & Operations
234192
-----------------------------------------
235193

236194
A GraphQL schema defines all of the types, enums, and scalars that a GraphQL
@@ -279,7 +237,7 @@ following functions and call the appropriate mutations:
279237
.. literalinclude:: useTaskMutations.codeblock.useAddTask.js
280238
:emphasize-lines: 3-8
281239

282-
F. Connect Apollo to the GraphQL API
240+
E. Connect Apollo to the GraphQL API
283241
------------------------------------
284242

285243
We've defined GraphQL CRUD operations and created custom query and mutation hooks
@@ -293,7 +251,7 @@ connect to your app's GraphQL API.
293251

294252
.. include:: /includes/steps/task-tracker-web-apollo.rst
295253

296-
G. Implement the Projects List
254+
F. Implement the Projects List
297255
------------------------------
298256

299257
As defined by our data model, ``projects`` are an embedded object of the ``users`` object.
@@ -306,7 +264,7 @@ current user's projects. We'll need to add the following code:
306264
.. literalinclude:: useProjects.codeblock.useProjects.js
307265
:emphasize-lines: 6
308266

309-
H. Use Realm functions
267+
G. Use Realm functions
310268
----------------------
311269

312270
In the ``EditPermissionsModal.js`` file, there are functions that rely on :ref:`{+service-short+}

0 commit comments

Comments
 (0)