Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

mongodb-developer/realm-binary-tree

Repository files navigation

Notice: Repository Deprecation

This repository is deprecated and no longer actively maintained. It contains outdated code examples or practices that do not align with current MongoDB best practices. While the repository remains accessible for reference purposes, we strongly discourage its use in production environments. Users should be aware that this repository will not receive any further updates, bug fixes, or security patches. This code may expose you to security vulnerabilities, compatibility issues with current MongoDB versions, and potential performance problems. Any implementation based on this repository is at the user's own risk. For up-to-date resources, please refer to the MongoDB Developer Center.

BinaryTree

A simple implementation of a Realm-backed Binary Tree.

This library is a demo on how to use DocC. See beelow how your new docs will look! 👇

You can read a series of posts about how to create a small guessing game in the Realm/MongoDB blog, starting with Creating a framework that uses Realm as a 3rd party dependency

Realm + Swift Packages

Also it shows how to integrate and use Realm in your Swift Packages. For details, have a look at Package.swift

Generating DocC using Github Actions

This repo also has a Github Action to automatically generate the DocC docs on each push. You can read about this in the MongoDB Developer Center article Continuously Building and Hosting our Swift DocC Documentation using Github Actions and Netlify

For the impatient, check the main.yml file

Generated DocC files can be found in this repo

Local testing

Every time you build the documentation from Xcode the documentation browser will allow you to check how your docs look. You can export the docs as a Documentation Archive.

But this docs are a web site that we can serve locally. Let's see how to do it using Docker

To host your generated docs in a local web server, if you have Docker installed you can create your own image or mount the generated doc folder

Creating an Image

Create an image based on this Docker file: it'll have an Apache httpd server and the doccarchive files

docker build -t docs .

then run the image in a container

docker run -dit --name my-running-app -p 8080:80 docs

Mounting the generated doc folder

docker run -dit -v /Users/dfreniche/Code/DocC/BinaryTree/docs/BinaryTree.doccarchive:/usr/local/apache2/htdocs/  -p 8080:80 httpd:2.4

Change the path to where you exported the doccarchive

Resources

To learn more about Realm/MongoDB you have all these fantastic resources:

About

Swift Package for the Realm-Powered Binary Tree Sample

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •