GithubHelp home page GithubHelp logo

aabeshde / realm-tutorial Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mongodb-university/realm-tutorial

0.0 1.0 0.0 833 KB

MongoDB Realm Tutorials

Ruby 3.52% Swift 18.31% JavaScript 11.89% Starlark 1.21% Java 3.96% Objective-C 2.78% Kotlin 11.45% HTML 1.03% TypeScript 45.61% CSS 0.25%

realm-tutorial's Introduction

Task Tracker Tutorial

The Task Tracker is a collaborative project management tool.

App Description

The mobile apps (Swift/iOS, Kotlin/Android, and React Native) implement the Task Tracker using MongoDB Realm Sync.

The web app implements the Task Tracker using the GraphQL integration.

Get Started

First, create a Realm app in the Realm UI and link a cluster.

Enable authentication

Under "Users" on the Realm UI, go to the Providers tab and enable the email/password provider.

  • Select "automatically confirm users"
  • Select "run a password reset function"
  • Click "create new" for the reset function and use the default that is created. This reset function always denies password reset requests, but you can change that later.

Collections

Under "Rules" on the Realm UI, add the following collections:

  • tasks
  • projects
  • users

Schemas

Define the schemas for each collection as follows. Please note: we may change these in future versions of the tutorial.

Tasks

{
  "title": "Task",
  "bsonType": "object",
  "required": [
    "_id",
    "_partition",
    "name",
    "status"
  ],
  "properties": {
    "_id": {
      "bsonType": "objectId"
    },
    "_partition": {
      "bsonType": "string"
    },
    "name": {
      "bsonType": "string"
    },
    "status": {
      "bsonType": "string",
      "enum": [
        "Open",
        "InProgress",
        "Complete"
      ]
    }
  }
}

Projects

{
  "title": "Project",
  "bsonType": "object",
  "required": [
    "_id",
    "_partition",
    "name"
  ],
  "properties": {
    "_id": {
      "bsonType": "objectId"
    },
    "_partition": {
      "bsonType": "string"
    },
    "name": {
      "bsonType": "string"
    }
  }
}

Users

{
  "title": "User",
  "required": [
    "_id",
    "user_id",
    "name"
  ],
  "properties": {
    "_id": {
      "bsonType": "objectId"
    },
    "user_id": {
      "bsonType": "string"
    },
    "name": {
      "bsonType": "string"
    },
    "image": {
      "bsonType": "string"
    },
    "_partition": {
      "bsonType": "string"
    }
  }
}

Enable Sync

On the Sync tab, enable Sync.

  • Set the partition key to _partition (string)

Troubleshooting

The most common issue is schema mismatch due to frequent little tweaks to the schema as you develop your app.

  • Be sure to check the logs in Realm UI for more information as well as the console in your app.
  • Delete the app from the simulator to purge local data.
  • Restart Sync in the Realm UI by clicking "Delete Synced Data" on the Sync page.
  • Be sure to deploy your changes in the Realm UI.
  • If your schema does not match the server, compare the class definitions from the SDKs tab in the Realm UI with those in the client code.
  • When creating objects, make sure the partition value of your new object matches the partition value you opened the Realm with.

realm-tutorial's People

Contributors

cbush avatar nlarew avatar nathan-contino-mongo avatar ianpward avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.