Because I Node you so.

A month into my dive into React, and it is time to fire up the other parts of my app. Since I am already working in Node, I will create an API in ExpressJS to provide and store data from my application. The data will be stored and saved in a MongoDB database.

MongoDB is a wonderful shift for me. Since like most developers you began with SQL moving from tables to documents and collections is great, especially for small websites with minor data requirements like mine. I can easily scrap collections, documents without having to go through all the hoops of MySQL or MS SQL. I am also utilizing the free host service from MongoDB. This means that I can access my database remotely and not have to install MongoDB on the local server.

Originally, the club website was built using a WAMP stack. This meant that it was configured to run on the web server and link to MySQL. Having very limited access to a cheap MySQL server, I decided to store my data locally on a JSON file which I use PHP to write from. Not quite the LAMP stack, but it worked well.  This time though I am using Heroku to host my API which is both ExpressJS and Mongoose to control the definition of data being sent from and to MongoDB. Mongoose is considered middleware as it utilizes schemas to enforce data models, providing structure and consistency to your data being sent.

Security is also an issue I want to get ahead of. I want to have some control over permissions and what users can access. Auth0 provides a service which allows for user authentication. This allows me to have user lever access without having to code anything. YES! Integration is very simple and all it take is a download of a module to get things working.

So in the end, my current stack looks like



Post a Comment

Previous Post Next Post