Skip to content

Last fixes #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 6, 2020
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
46 changes: 46 additions & 0 deletions tutorial/backend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Get Started

## 1. Install `mongodb-realm-cli`

You can import the ready-made MongoDB Realm backend using the
`mongodb-realm-cli`, which you can install with npm:

```bash
npm install -g mongodb-realm-cli
```

## 2. Create an Atlas cluster with MongoDB 4.4+

To have a backend for your Task Tracker app, you will need a MongoDB Atlas
cluster with MongoDB 4.4 or higher. To create an Atlas account, project, and cluster, visit the [Atlas
UI](https://cloud.mongodb.com/?tck=docs_realm).

> ⚠️ Sync requires MongoDB 4.4 or above. Be sure to select at least MongoDB
> version 4.4 when building your cluster!

## 3. Create an API Key and authenticate the CLI

To authenticate with the `realm-cli`, you must create an API key with **Project
Owner** permissions for your project in the **Project Access Manager** view.
Click the **Access Manager** at the top of the Atlas view to find it. Please
follow the [instructions on the MongoDB documentation
site](https://docs.mongodb.com/realm/deploy/realm-cli-reference/#authenticate-a-cli-user)
for more information.

Once created, pass the API keys to `realm-cli login` to log in:

```bash
realm-cli login --api-key=[public API key] --private-api-key=[private API key]
```

## 4. Import the Realm backend app

If logged in successfully, you can now import the app:

```bash
realm-cli import --app-name tasktracker --path ./backend/
```

Follow the prompts and wait for the app to deploy.

Congratulations! You now have a working MongoDB Realm backend with Sync enabled.
7 changes: 0 additions & 7 deletions tutorial/web/src/components/Sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,17 @@ export default function Sidebar({
setCurrentProject,
setIsEditingPermissions,
}) {
// :code-block-start: sidebarSetUp
const projects = useProjects();
const app = useRealmApp();
// :code-block-end:

// :code-block-start: sidebarContainer
return (
<SidebarContainer>
<Card>
<SectionHeading>Projects</SectionHeading>
<SectionList>
{projects.map((project) => (
<SectionListItem
// :hide-start:
key={project.partition}
// :replace-with:
// // TODO: Set the key to the project partition.
onClick={() => setCurrentProject(project)}
isSelected={project.partition === currentProject?.partition}
>
Expand All @@ -48,7 +42,6 @@ export default function Sidebar({
</SidebarContainer>
);
}
// :code-block-end:

const SidebarContainer = styled.div`
display: flex;
Expand Down