For the Hackathon I just want to try to implement a simple app, which connects to a MongoDB Atlas and allows to add records as well as see an overview of submitted data. In fact, whenever the page will be called, it will add a record and put the current number of records to the resulting page.
Choose Your Own Adventure: Web App showing record count with MongoDB Atlas for adding and retrieving records
Link to source code: Github
Note, that on MongoDB a free and shared cluster has been used. This is possibly the main difference to many other submissions for this Hackathon.
Here I will describe how to set up the project and try the app.
First we begin to create a database with MongoDB with a Certificate used to connect to it later. Because we want to add records, we need to create a Database "DevDatabase" and a Collection "Measurements". Then we need the repository's content and set up Node JS together with the needed modules.
If you use in the MongoDB portal "Connect" and then "Connect your Application" you should find what you need to change later in the code: The String shown has to be replaced in the code according to the example.
Also make sure to include the Certificate file Certificate.pem in the project, which is not part of the repository and needed for authentication.
If you now run the "app.js" file, a local server will start and allow you to visit http://localhost:3000/. Whenever it is opened (e.g. also by refreshing) it will add a record to the database and then retrieve the records to count them for the number to be displayed.
This has been just to practice, but you still are welcome to leave some feedback or questions. Thank you for reading!