Todolist implemented for MongoDB backend
-
Download XCode 8 on macOS or the latest linux Swift 3.0 Release
-
Download MongoDB
- macOS
$ brew install mongodb
- linux
$ sude apt-get 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 mkdir -p ~/log
More information can be found here
Additionally, you can view the database' shell with
$ mongo
-
Clone the TodoList-mongodb repository
-
You can start your database by running
mongod
-
Build the project and run it
- macOS
swift build
./build/debug/TodoList
```
- linux
swift build -Xcc -fblocks -Xlinker -rpath -Xlinker .build/debug
./build/debug/TodoList
```
- Open the TodoList Client and enjoy!
-
Get an account for Compose
-
Navigate to deployment section on the side bar. Select MongoDB and set your deployment name, location, and disable SSL access
-
Create Deployment and you should see a field for your connection info.
-
Setup a new database called
todolist
-
Setup a collection with
todolist
calledtodos
-
Add a new user to the
todolist
database
Now, you can access your Mongo Database with the given host and port or connect it to bluemix
-
Get an account for Bluemix
-
If you haven't already, setup MongoDB by Compose described in the section above
-
Select the MongoDB by Compose Service
-
Set the Service name as
TodoList-MongoDB
then initialize the Host, Port, Username, and Password to the values instantiated in the above section -
Upon creation, you should see your unbound service on the dashboard page
-
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.
-
Run
cf push
2 of 2 instances running
App started
- Run the test cases from within your local repository
$ git clone https://github.com/IBM-Swift/todolist-tests Tests
$ swift test
- Alternatively, checkout the specs on TodoList-Backend and set the appropriate url to test
This library is licensed under Apache 2.0. Full license text is available in LICENSE.