{"id":15549756,"url":"https://github.com/mrlynn/10-min-data-api-mongodb-stitch","last_synced_at":"2025-04-11T14:52:04.024Z","repository":{"id":137876250,"uuid":"150338769","full_name":"mrlynn/10-min-data-api-mongodb-stitch","owner":"mrlynn","description":"Creating a Data API in 10 minutes with MongoDB Stitch","archived":false,"fork":false,"pushed_at":"2019-04-17T13:09:10.000Z","size":59,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-25T11:01:57.971Z","etag":null,"topics":["api","functions","mongodb","nosql","serverless"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mrlynn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-25T22:54:53.000Z","updated_at":"2021-05-04T05:21:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"1abf39de-57bd-4d2e-9160-1ed64bc45324","html_url":"https://github.com/mrlynn/10-min-data-api-mongodb-stitch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlynn%2F10-min-data-api-mongodb-stitch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlynn%2F10-min-data-api-mongodb-stitch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlynn%2F10-min-data-api-mongodb-stitch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mrlynn%2F10-min-data-api-mongodb-stitch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mrlynn","download_url":"https://codeload.github.com/mrlynn/10-min-data-api-mongodb-stitch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248425185,"owners_count":21101318,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["api","functions","mongodb","nosql","serverless"],"created_at":"2024-10-02T13:41:32.108Z","updated_at":"2025-04-11T14:52:04.007Z","avatar_url":"https://github.com/mrlynn.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"![MongoDB Stitch API in 10 Minutes](https://cdn-images-1.medium.com/max/800/1*6CLtZEbUdqbPViengE03og.png)\n# Creating a Data API in 10 minutes with MongoDB Stitch\n\nIf you're reading this and getting ready for the [MongoDB World Hackathon](https://mongodbworld19.devpost.com), you'd better get moving - not much time left! Fortunately, creating an app is super simple and shouldn't take long. An important part of any application is an API that exposes data. I'm going to show you how to create that very quickly with MongoDB Stitch.\n\nThis repository accompanies a video which walks through the process of creating a data endpoint API using MongoDB Stitch. \n\nCheck out the accompanying video on [Youtube](https://www.youtube.com/watch?v=WBEzGFpAnhY).\n\n[![Creating a Data API in 10 minutes with MongoDB Stitch](https://img.youtube.com/vi/WBEzGFpAnhY/0.jpg)](https://www.youtube.com/watch?v=WBEzGFpAnhY)\n\n## Article\n[Read the blog article](https://medium.com/@michael.lynn/creating-a-data-enabled-api-in-10-minutes-with-mongodb-stitch-6d23578fed6d) that explains how to create an API in 10 minutes (or less)\n\n## Requirements\nIF you want to follow along, you will need the following:\n\n1. Free [MongoDB Atlas](http://cloud.mongodb.com) account.\n1. [Postman](http://getpostman.com) - Data/API Testing Tool (Optional)\n\n## Importing the Sample Application\n\nMongoDB Stitch enables you to import a pre-existing Stitch App. To do this, install the [stitch-cli](https://docs.mongodb.com/stitch/import-export/stitch-cli-reference/) and create a `.env` file.\n\n```\nexport STITCH_API_KEY=\u003cAPI_KEY\u003e\nexport STITCH_USERNAME=\u003cCLOUD_USERNAME\u003e\nexport STITCH_APPID=\u003cAPPID\u003e\n```\n\nNext, make the scripts executable:\n\n```\n\u003e chmod +x deploy\n\u003e chmod +x export\n```\n\n## Importing Data Into Your Cluster\n\nAny application needs data, right? Well - importing data into MongoDB is super simple. I've made it even simpler with a script and an example data file. Check `contacts.csv` for an example data file and take a look at [import.sh](./import.sh) - this is a script I wrote which automates the process of importing data into your cluster. You'll need to create a .env file with values for the following:\n\n```\nCLUSTER=clustername-shard-0/clustername-shard-00-00-pmvyt.mongodb.net:27017,clustername-shard-00-01-pmvyt.mongodb.net:27017,clustername-shard-00-02-pmvyt.mongodb.net:27017\nFILENAME=contacts.csv\nDATABASE=hackathon\nCOLLECTION=contacts\nUSER=workshop\nPASSWORD=workshop123\n```\n\nThe `CLUSTER` variable can be found in your Atlas console - click the `CONNECT` button and you'll see an option for `COMMAND LINE TOOLS`. Click that button to see a list of command line tools - one of them being `mongoimport`. Look at the detail there and you'll find the CLUSTER reference. Copy/Paste that into the .env file as the value for the `CLUSTER` variable.\n\nNext, make sure the values for `DATABASE`, `COLLECTION`, `USER`, and `PASSWORD` match your specific installation and you should be good to go.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlynn%2F10-min-data-api-mongodb-stitch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrlynn%2F10-min-data-api-mongodb-stitch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrlynn%2F10-min-data-api-mongodb-stitch/lists"}