. Happend. I made a mistake and I am straightening it up publicly. If you were following either my code or my posts carefully, you probably noticed I referred to environmental values a lot. From everywhere. That isn’t a good practice, in fact, it’s terrible, to follow that pattern. From different reasons, which I won’t be covering in this post.

What I will say, is that it doesn’t mean to not use them at all. In fact, I still am by myself. What I do is I wrap all my environmental variables into one config file. That way, you can still declare vals in your startup process, and have them together with all other useful configs at one file. One variable. One import.


That was quite a task, to get this going. I even had a serious problem with getting git commits separated from each other, so I ended up committing it all together.

Introduction

As I mentioned earlier, I was arguing with myself on using either WebSockets which I am familiar with, or FireBase, which I got little idea of, but that’d shorten my development time, and would give me alot of performance advantages. Right. It would.

But finally, I decided to go with WebSockets — on top of Socket.IO. Decision was pretty simple, I’ve used WS before, and as I’m pretty limited if goes about time I can spend on this project — that was the easiest solution. …


Every webapp needs a database, right? I believe, there isn’t a single person, that’d try to argue over this statement. But what database, and how to structure — that is where the war begins.

For this project, I use MongoDB with mongoose on the top of it. Mongo is a noSQL, and no-relational database. Although it’s named non-relational, it doesn’t mean you can not have relations around you DB. You can. What you can’t do, is to merge them on the go, you can’t expect the DB to populate the results for you — you can make extra query, or you can specify the query, to populate results for you. …

About

Patryk Cieszkowski

JavaScript Developer. Email me at me@polethedev.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store