/enter-the-mongodb-realm

My first attempt at a mongodb realm application.

Primary LanguageJavaScriptMIT LicenseMIT

Enter The Mongodb Realm

My first attempt at a mongodb realm application. You may find some of my notes odd or obvious. As a new developer many of these tips/skills are new to me, so this documentation is also to help me.

Current State of Project

  • Focus: Managing user login state better. I think there is a way to do it with the ApolloProvider component as it uses the context hook.
  • Major Wins: Connected to Realm app, Autheticated a user using the Realm SDK, Performed a query using the GraphQL SDK.

Quick Summary of Planned Tech Stack

  • React (functional/hooks) for front-end
    • Utilizing Realm Web SDK for user authentication
    • Utilizing Apollo library to interact with Realm GraphQL SDK
  • Realm for back-end (serverless)
    • GraphQL will handle some authorization of queries (hopefully)

Using Environment Variables with React

Installing Realm for Web

Log in a user to Realm

Setting up Apollo for React (used for GraphQL)

  • How add Apollo to your React application. This is recommended when using the GraphQL SDK to perform GraphQL queries: https://docs.mongodb.com/realm/graphql/connect/
    • Watch out when installing the necessary node modules. @apollo/react-hooks is used in the doucmentation, but not included in the command listed for installing necessary modules

Connect client to GraphQL

Preforming queries to Realm using GraphQL/Apollo