Nimbella — Stateful Serverless App with Angular + Node + MongoDB — #DeveloperIPL
Our Team “Drafters” recently participated for a Exciting Hack-a-thon named “DeveloperIPL” on Hacker-earth Platform, and theme for it was Social Good.
(IPL: Indian Premier League is a professional Twenty20 cricket league in India)
[UPDATE] much awaited moment … We won second prize
About DeveloperIPL : It was perfect competition for us to build and explore more on Serverless Platform. Oover time as we were working on turning Idea to App, right from planning to implementation and finding out Which Technology will be best fit for solution, as Nimbella Supported almost every technology. As many participants were new to platform, for which Nimbella team organized various workshops right from How to Start building ?, How to use different features available ?, which was a great learning experience for us.
Also Whenever we used to face difficulty while implementing something, Nimbella Team was available on Slack Platform, and was easy to reach and get help, whenever doubts we had . We would love to participate again, in next season of DeveloperIPL and would encourage all the readers to try the Nimbella Platform (Serverless is the Future if you are from Tech.) and this is Free to Explore and I am sure will be Great Learning Experience for you as well.
About Nimbella :
Nimbella is a Serverless Cloud Platform [ Serverless means, developer does not have to manage any resources required for your app/workload like hosting, compute instance, database or storage, *nimbella’s re-serve everything for you in their underlying system], which allows developer to focus on code — build app and deploy/host within seconds.
:-) No need to stop and restart instance -> its serverless
This makes everything quick, easy and saves your time.
About Our Project : FoodTracker App
A week before competition, one of our team member, came across a news about food corruption [Under name of Free Food] and scarcity during pandemic that is still happening now, this idea of her, striked us, that we need to give a try on finding a working solution for.
In this Application, we have implemented a functionality, for Local Stores/Shops, who can maintain & track records of order/transactions of food items distributed to each Beneficiary/Customer.
And Shops in every region/area of country will be controlled by Govt/Agencies, who can calculate the consumptions in any regions with Application for particular time-period, this will help in stocking up of food in for any unforeseen scenarios.
Also We hear in news about Food Corruption, in which Beneficiary receives poor quality of food, on other side Good Quality Food is exported to somewhere else, With Review Functionality it will be easy to track and stop this bad practices.
Technologies used in Project:
- Front-End : Angular 8
- Back-End : Node JS
- Database : MongoDB (Document Store)
- Database : Redis (Key-Value Store) Provided By Nimbella
- Storage : Google Cloud Based Object Storage Provided By Nimbella
- Postman : API Testing
- Github : Repository + CI/CD
- STS/VSCode : Development
Git Repository of Project: https://github.com/precproject/nimbella-project
Development Phase :
- Initilly we read about Nimbella Serverless Platform, How it is built ? How the Project structure need to maintain ? and referred Sample Examples available on Git.
- We developed the backend part first with some functio developed with API NODE-JS and some with JAVA functions
- Database we used Redis (Provided by Nimbella) to store Stock Count Stats , User Details and other side We used MongoDB for storing Beneficiary Tranasactions
- To Store Images uploaded by Beneficiary as part of “Food Review” we used Object Storage (Provided by Nimbella) — its a Google Cloud Storage
- We deployed the BackEnd API on Nimbella and started with testing using POSTMAN
- After completion, we proceed with Front-End Development built with ANGULAR
- To Simplify the Development and Deployment Process, we configured CI/CD on Github (Actions)
Refer for Integration of Postman (Nimbella Provides a Plugin for same to Create Serverless API)
This package is a plugin to extend the functionality of the Nimbella command interface, plugins allow developers to…
And That’s so easy building Serverless Application on Nimbella.
We would continue to build and try different stuff on Nimbella. :-)
Demo Implementation Steps:
- We Created Account on Nimbella: https://nimbella.com/
- First thing was to understand the Nimbella Project Structure : https://nimbella.io/downloads/nim/nim.html#project-directory-structure
- Backend Code/Functions will be grouped as Package’s inside “packages” directory
- Front End UI generated static file will be inside “web” folder
3. Download Nimbella CLI : https://nimbella.com/blog/how-to-set-up-your-serverless-environment-and-get-started-in-less-than-2-minutes
- Enter Below Cmd in CLI [Token will be available After you login to Nimbella]
nim auth login [token]
- Verify Nimbella Installation & Login
nim auth list
- For Any Help About Command or Required Parameter
nim — — help
4. Download Any Sample Nimbella Project : https://github.com/nimbella/demo-projects
5. Go To Directory Where Downloaded Sample Project Folder is Present
- Deploy the Sample Project
nim project deploy [project/folder-name]
Woww! We Succesfully Deployed Project to Nimbella
Understanding Nimbella — Serverless Concepts
- In serverless, or think in our app every operation can be developed as a separate function/code and this Individual Function in Nimbella is called “ACTION”
- To Invoke this Action we get REST API Endpoint/URL, to which we either pass some payload/param [during POST] call or we expect some response in both [POST/GET] call.
- Let’s check in our last deployed project what were the Actions
nim action list
- Nimbella will generate URL for each action as per project package/folder structure linked to our account namespace
nim action get [action-name-from-list] — — url
- Now Invoke this URL from Postman / Browser (Check what is required payload/parameter if any)
#nimbella #postman #developeripl #hackerearth #serverless