Skip to content

Commit 86728c5

Browse files
authored
Last fixes (#514)
* Add README to backend * Remove Sidebar.js annotation
1 parent 4da7b06 commit 86728c5

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
lines changed

tutorial/backend/README.md

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Get Started
2+
3+
## 1. Install `mongodb-realm-cli`
4+
5+
You can import the ready-made MongoDB Realm backend using the
6+
`mongodb-realm-cli`, which you can install with npm:
7+
8+
```bash
9+
npm install -g mongodb-realm-cli
10+
```
11+
12+
## 2. Create an Atlas cluster with MongoDB 4.4+
13+
14+
To have a backend for your Task Tracker app, you will need a MongoDB Atlas
15+
cluster with MongoDB 4.4 or higher. To create an Atlas account, project, and cluster, visit the [Atlas
16+
UI](https://cloud.mongodb.com/?tck=docs_realm).
17+
18+
> ⚠️ Sync requires MongoDB 4.4 or above. Be sure to select at least MongoDB
19+
> version 4.4 when building your cluster!
20+
21+
## 3. Create an API Key and authenticate the CLI
22+
23+
To authenticate with the `realm-cli`, you must create an API key with **Project
24+
Owner** permissions for your project in the **Project Access Manager** view.
25+
Click the **Access Manager** at the top of the Atlas view to find it. Please
26+
follow the [instructions on the MongoDB documentation
27+
site](https://docs.mongodb.com/realm/deploy/realm-cli-reference/#authenticate-a-cli-user)
28+
for more information.
29+
30+
Once created, pass the API keys to `realm-cli login` to log in:
31+
32+
```bash
33+
realm-cli login --api-key=[public API key] --private-api-key=[private API key]
34+
```
35+
36+
## 4. Import the Realm backend app
37+
38+
If logged in successfully, you can now import the app:
39+
40+
```bash
41+
realm-cli import --app-name tasktracker --path ./backend/
42+
```
43+
44+
Follow the prompts and wait for the app to deploy.
45+
46+
Congratulations! You now have a working MongoDB Realm backend with Sync enabled.

tutorial/web/src/components/Sidebar.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,17 @@ export default function Sidebar({
1111
setCurrentProject,
1212
setIsEditingPermissions,
1313
}) {
14-
// :code-block-start: sidebarSetUp
1514
const projects = useProjects();
1615
const app = useRealmApp();
17-
// :code-block-end:
1816

19-
// :code-block-start: sidebarContainer
2017
return (
2118
<SidebarContainer>
2219
<Card>
2320
<SectionHeading>Projects</SectionHeading>
2421
<SectionList>
2522
{projects.map((project) => (
2623
<SectionListItem
27-
// :hide-start:
2824
key={project.partition}
29-
// :replace-with:
30-
// // TODO: Set the key to the project partition.
3125
onClick={() => setCurrentProject(project)}
3226
isSelected={project.partition === currentProject?.partition}
3327
>
@@ -48,7 +42,6 @@ export default function Sidebar({
4842
</SidebarContainer>
4943
);
5044
}
51-
// :code-block-end:
5245

5346
const SidebarContainer = styled.div`
5447
display: flex;

0 commit comments

Comments
 (0)