Your Web News in One Place
July 11, 2019 09:50 pm GMT

The journey begins with coolNote

We @ coolLabs are working on several ideas simultaneously and it's really hard to keep everything in our heads. So what are we doing then?

Simple, write it down.

writes all the time

Personally, I write notes / todos a lot. It helps me to focus when I start coding, or if I found some bug on the way but I cannot fix it ASAP, I just quickly write it down and get back to it later.

I have limited time to work on my projects - mostly when my kids are sleeping, because if they are not, I'm having fun with them. That means I need to concentrate more on what to do when I'm coding!

I used Google Keep for a while, it was good, but after I came up with the mission of coolLabs, I decided to write a similar application, but with our mission in mind.

So, another note taking application?

Yep, why not!

It's called coolNote, try it!

As this was our first application which uses backend & database, I had to figure out a lot more for it than I expected in the beginning.

All the things that I build now, needs to be usable by our future applications aswell, so I had to think everything twice at least!

  • Do we use API or Websocket server? (Both!)
  • How the authentication process should work?
  • How we structure our codebase to be able to integrate our future apps faster and easier?
  • How the database schemas should look like?
  • etc...

And if you read about our mission, then you probably guess what is the major problem we need to solve:

  • How should we do and simplify our builds & deploys of our frontends and backends? We do not want to do manually.

You know, all the FUN things!

excited

API vs Websocket

I used REST API backend in the beginning, but in a short time I realized that it would be much more efficient to use websockets and also the features I would like to add later on will be easier with it - where real time communication needed.

So we built a REST API for services like authentication & a Websocket server for real time, two-way communication, each of them with good code structure to be able extendable easier.

Authentication

This is our first application where the user can login, so I had to create some kind of authentication method in such way that we can use for all of our applications aswell.

We needed an SSO-like authentication - if you login to one of our application, you are logged in to all of our apps in that browser. It is a super user experience in my opinion.

That's when our login service was born.

The full code is under 100 lines, exactly 58. Cool right?

If you visit the page directly and sign in, you will be redirected to our main page, nothing interesting, but if you would like to experience the full process, try it in coolNote.

Deploy process

When I started coding this app - before the mission of coolLabs was totally clear - we used Heroku for our Node.js backend and Netlify for our frontends.
The deploy process was awesome, but they are using AWS (?! not 100% sure) for hosting.

After some days of thinking, I figured out a solution. We call it:

coolify - Our own Heroku-ish and Netlify-ish service.

(The name is not permanent . The service only available for us at the moment, but we are thinking of publishing it.)

Our development process is the same as it was with Heroku and Netlify.

We just push code to git and through Gitlab and Github webhooks the service builds, redeploys our applications and configures our reverse proxy! (All of the code are bundled into a docker container, no mather if we define a Dockerfile or not, reachable only through the reverse proxy!)

It even notify us through Discord!

coolBot

(Yes, 2 seconds to redeploy our API - it is using the super cache mechanism of Docker and some custom caching methods for special cases)

It costs us $5 / month, not free as Heroku/Netlify, but still a fair price .

I will write about this in a separate blog post. I think it's worth one with more technical details.

Thats a lot for a simple note app

Yeah, I did not think that I need to think and code that much, but I it!

wooh

The frontend code is open sourced.

Thanks for your time! See you later!

see you


Original Link: https://dev.to/coollabsio/the-journey-begins-with-coolnote-59gn

Share this article:  Share on Twitter  Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To