|
| 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. |
0 commit comments