Skip to content
Anthony Amanse edited this page Mar 9, 2018 · 14 revisions

Short Name

Create a Map Server using Mongoose

Short Description

Build a Node.js app that uses Mongoose for MongoDB and Express to make APIs

Offering Type

Cloud

Introduction

Mongoose provides an easy way to model your data with MongoDB. It connects to a MongoDB database and from there, you can configure your Node.js app to create, read, update or delete documents in the database. The express framework helps making RESTful APIs quickly and easily for our database operations using mongoose.

Author

By Anthony Amanse

Code

https://github.com/IBM/kubernetes-mongoose

Video

Overview

The pattern shows developers how they can conveniently configure their application to use a database for their data storage. The application will be deployed in a Kubernetes platform. This Code Pattern is part of a bigger application. This application is a map server where data like booths, events, and beacons (for generating a heat map of the event) are stored. The map server will be used as a backend for a user facing dashboard. The dashboard, using the data from the configured APIs of our server, will visualize that data and show a map or floor plan to the users. This map server will also be used to generate an indoor-map in an iOS app.

When the reader has completed this Code Pattern, they will understand how to:

  • Implement Mongoose with NodeJS
  • Make RESTful APIs with database operations

Flow

Architecture

  1. A MongoDB is set up. Compose for MongoDB is used in this pattern.
  2. User adds in mock data that matches the schema of the models set in the application.
  3. User interacts with the deployed app via its APIs. The user can view an indoor map in SVG or PDF.

Included components

  • Compose for MongoDB: MongoDB with its powerful indexing and querying, aggregation and wide driver support, has become the go-to JSON data store for many startups and enterprises.
  • Kubernetes Cluster: Create and manage your own cloud infrastructure and use Kubernetes as your container orchestration engine.

Featured technologies

  • Mongoose: A JavaScript framework that serves as a MongoDB object modeling tool.
  • Node.js: An open-source JavaScript run-time environment for executing server-side JavaScript code.
  • Databases: Repository for storing and managing collections of data.

Blog

Link to blog http://developer.ibm.com/code/?p=28657&preview=1&_ppp=2989bdf1c6

Video

Link to video https://www.youtube.com/watch?v=ZcRaV_Yo4kw

Links

  • Node.js Code Patterns: Enjoyed this Code Pattern? Check out our other Node.js Code Patterns
  • Mongoose: Mongoose provides a straight-forward, schema-based solution to model your application data.