Coder Social home page Coder Social logo

todolist-mongodb's Introduction

Todolist MongoDB

Todolist implemented for Cloudant (MongoDB) backend

Build Status ![Swift 3 6-06](https://img.shields.io/badge/Swift%203-6/20 SNAPSHOT-blue.svg)

Initial Setup:

  • Download the Swift DEVELOPMENT 06-06 snapshot

  • Download MongoDB

    You can use brew install mongodb If you are using mongodb for the first time create the directory to which the mongod process will write data mkdir -p /data/db

    More information can be found here

    Additionally, you can view the database' shell with mongo

  • Clone the TodoList-mongodb repository

Running Locally:

  1. You can start your database by running mongod

  2. Build the project and run it

    swift build
    ./build/debug/todolist-mongodb
    
  3. Open the TodoList Client and enjoy!

Setting up MongoDB by Compose

  1. Get an account for Compose

  2. Navigate to deployment section on the side bar. Select MongoDB and set your deployment name, location, and disable SSL access

    MongoDB by Compose

  3. Create Deployment and you should see a field for your connection info.

    MongoDB by Compose

  4. Setup a new database called todolist

  5. Setup a collection with todolist called todos

    MongoDB by Compose

  6. Add a new user to the todolist database

    MongoDB by Compose

    MongoDB by Compose

Now, you can access your Mongo Database with the given host and port or connect it to bluemix

Deploying To Bluemix:

  1. Get an account for Bluemix

    Setup the MongoDB Service

  2. If you haven't already, setup MongoDB by Compose described in the section above

  3. Select the MongoDB by Compose Service

    MongoDB by Compose

  4. Set the Service name as TodoList-MongoDB then initialize the Host, Port, Username, and Password to the values instantiated in the above section

    MongoDB by Compose

  5. Upon creation, you should see your unbound service on the dashboard page

    Next Steps: Push to Bluemix

  6. Download and install the Cloud Foundry tools:

cf login
bluemix api https://api.ng.bluemix.net
bluemix login -u username -o org_name -s space_name
Be sure to change the directory to the todolist-mongodb directory where the manifest.yml file is located.
  1. Run cf push

    Note: The uploading droplet stage should take a long time, roughly 4-6 minutes. If it worked correctly, it should say:

2 of 2 instances running
App started

Testing:

  • Run the test cases locally with
git submodule init
git submodule update
swift test
  • Alternatively, checkout the specs on TodoList-Backend and set the appropriate url to test

License

This library is licensed under Apache 2.0. Full license text is available in LICENSE.

todolist-mongodb's People

Contributors

rfdickerson avatar sandmman avatar

Watchers

 avatar  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.