Discover a comprehensive step-by-step guide on integrating Bubble.io with MongoDB Atlas to optimize your app development process.
MongoDB Atlas is a fully-managed cloud database service provided by MongoDB. It offers a secure and convenient way to host, handle and manage MongoDB databases. MongoDB Atlas automatically takes care of infrastructure, setup and configuration, allowing developers to focus on designing database structures and developing applications. It provides capabilities like automated scaling, backup, and recovery options, and it supports cross-region replication for maintaining high availability and data locality.
Book a call with an Expert
Starting a new venture? Need to upgrade your web or mobile app? RapidDev builds Bubble apps with your growth in mind.
Step 1: Creating Your MongoDB Database in Cloud
First, you'll need to create a MongoDB database. To accomplish this, navigate to the MongoDB Atlas website and create an account or login if you already have one. Once you're logged in, create a new project from the project dropdown on the left-hand side menu.
Step 2: Building Your Cluster
Once you've created your project, build a new cluster within it. Choose the free tier cluster for the purpose of testing. You'll be prompted to select your cloud provider and region and can leave the other settings as their default. Then, click "Create Cluster". This process may take a few minutes.
Step 3: Creating a MongoDB Database
After your cluster has deployed, head to the Collections tab and add a new database. You'll need to name your database and create one collection to start. Note these down as you'll need them later.
Step 4: Configuring Database Access
Navigate to the Database Access tab in the Security section on the left menu. Click "Add New Database User".
Fill in the following fields:
Click on the "Add User" button to finalize the creation of this user.
Step 5: Configuring Network Access
Navigate to the Network Access tab in the Security section on the left menu. Click "Add IP Address". Here, add the current IP address with the description if you'd like and click confirm. If you're unsure of what your IP address is, it will be filled automatically if you select "Add current IP Address".
Step 6: Connecting Cluster
In the Clusters, select "Connect" on your cluster. A new tab will pop-up with the options to connect. Select "Connect your application".
Choose Node.js as your driver and copy the connection string, but make sure to replace <password>
with the password you created earlier for the database user.
Step 7: Integrate with Bubble.io
Now it's time to integrate this information with Bubble.io. Head over to Bubble.io and open your application. In the Data tab, navigate to API and toggle on the setting for “Enable Data API”. Below this, select the "GET List of All Things" checkbox.
Underneath "Authentication", you will need to ensure you choose “Public with a public key and private key verifiable by a hash”
Step 8: Connecting to MongoDB
You'll now connect your app to your MongoDB Atlas database by navigating to the "Plugins" tab and click "Add Plugins". Search for "SQL Database Connector", created by Bubble, and click to install it.
Go to the "Settings" tab and click on the “Connections” option. Paste the connection string from MongoDB Atlas in the connection input.
Step 9: Creating and Testing Database Queries
With your connection established, you can now create and test your queries to ensure the proper data is generated and returned.
Under the API section, click "Add another API data source". Here you can establish your query parameters and use SQL syntax to define your query. Once complete, click "Initialize the call". Bubble will show data returned from the initial call if it's established correctly.
Step 10: Checking the Database
Finally, verify the connection by going back to the Data section and click on "App data". You should see your database information populated here if the Bubble app is connected correctly to your database.
And there you have it. You have successfully integrated MongoDB Atlas with Bubble.io. Your Bubble app now has the full power of a MongoDB Atlas database behind it.
Scenario: An e-commerce company is looking to build a comprehensive online shopping platform where customers can browse their products, place an order, and check their order status. They use Bubble.io to develop the front-end interface of their online platform, but they need a robust and secure database to store crucial information such as customer details, orders, and product inventory. It's vital that this database is highly responsive and can handle a large amount of data as their customer base grows.
Solution: Integrating Bubble.io with MongoDB Atlas
Website Building: The e-commerce company utilizes Bubble.io to craft an intuitive, user-friendly shopping interface complete with product displays, shopping carts, and user profiles.
Setting Up the Integration: The company connects Bubble.io to MongoDB Atlas by downloading a MongoDB plugin in Bubble.io and configuring it with their MongoDB Atlas connection string.
Data Management Workflow: Whenever a customer creates a profile, places an order, or makes changes to their order, triggers set up in Bubble.io prompt these activities. The triggered data, such as customer details and order information, is automatically directed to MongoDB Atlas via the configured MongoDB plugin action.
New Collection Creation in MongoDB Atlas: With each incoming data, a new document is created in MongoDB Atlas under appropriate collections like 'User Profiles', 'Orders', and 'Product Inventory'. This ensures an organized and systematically structured database.
Inventory Management on Bubble.io Platform: The e-commerce company utilizes Bubble.io to retrieve customer and order data from MongoDB Atlas, making real-time updates to their product inventory.
Disposition Monitoring and Analytics: All operations, interactions, and dispositions are thoroughly tracked through the seamless integration of Bubble.io and MongoDB Atlas. This allows the e-commerce company to monitor shopping behaviors, most popular products, and peak shopping times.
Benefits:
By integrating Bubble.io with MongoDB Atlas, the e-commerce company can proficiently manage their online shopping platform while providing a seamless and efficient shopping experience to their customers.
Delve into comprehensive reviews of top no-code tools to find the perfect platform for your development needs. Explore expert insights, user feedback, and detailed comparisons to make informed decisions and accelerate your no-code project development.
Discover our comprehensive WeWeb tutorial directory tailored for all skill levels. Unlock the potential of no-code development with our detailed guides, walkthroughs, and practical tips designed to elevate your WeWeb projects.
Discover the best no-code tools for your projects with our detailed comparisons and side-by-side reviews. Evaluate features, usability, and performance across leading platforms to choose the tool that fits your development needs and enhances your productivity.
Then all you have to do is schedule your free consultation. During our first discussion, we’ll sketch out a high-level plan, provide you with a timeline, and give you an estimate.