- Published on
Foundation...
- Authors
- Name
- Karani John
- @MKarani_
Its not about construction, what's inside ๐ ; "A foundation in the contsruction world is meant to be rigid. It is meant to hold the building well to the ultimate limit and not just permissible strength.(Trust me bro, I have done design of structures.) When we are doing structures, we want to calculate the expected load and multiply by a certain factor usually 1.3(in the Eurocode)."
Foundation โ
It's friday, I lost my first draft lol
Recently, I wanted to build a noedjs API. It was meant to be frail and trivial but should exhibit some good qualities in terms of what an API should do. I "speak not" of the standards but rather something that someone with a bit of experience should do. The work should be fairly simple. I have built an API, I know how to setup data and routes. I know how to setup authentication. I mean what could go wrong? Well, nothing went wrong, but I wanted to write more about how the foundations come in handy.
I am not a very experienced developer but I am a parrot when it comes to picking practices. I wanted the API to have authentication, role based access, data fetching and retrieval and a notification service. But I do not know how to use expressjs. I have used NestJs like over an year ago. Nest is pretty different in terms of approach though. During my time working as a dev, I have picked up a few languages and frameworks. I have built similar stuff. I have a foundation. That's the topic, a foundation is so much more than learning.
flexible โ
A foundation in the contsruction world is meant to be rigid. It is meant to hold the building well to the ultimate limit and not just permissible strength.(Trust me bro, I have done design of structures.) When we are doing structures, we want to calculate the expected load and multiply by a certain factor usually 1.3(in the Eurocode). For you a foundation is getting to use a framework but multiplying it by a factor to get outside the tool or framework. This allows you to be flexible. Why? Because you now have the ability to work your way into the tool and not work your way outside it. That way, collapse is not easy. For example, you used observers in laravel and want a similar approach in maybe nodejs. If you are stuck basing it on laravel, you will have a hard time going out to look for something similar. You are locked into it. You need to understand how observers work then you can go anywhere and describe your needs better. If you can describe it to the people in the ecosystem, they might help you faster. They may not know of laravel but they know of a tool that allows subscription and consumption of events. Anyways, read about observers here
approach โ
Once you are flexible, you can start switching to a more general approach. For example, I needed to enable authentication. I need it, I will get there in some way. Starting from scratch, nope. Using my foundation, I have worked with access tokens, sessions, signed jwt. I have choices to look at. What works well with nodejs for something as frail as what I am building? Jwt is the answer. But now I need this to be a middleware, since I know about middleware. Great, how do I set this up? Now I need an answer for that, I read through and work my way to learning about express how to set up middleware and run the app. I could have reached here eventually, but my approach allows me to work through the important stuff that I know I need which helps me catch up on other concepts. This is what a good foundation does. It changes the way you think.
lastly... โ
A good foundation may seem unrewarding. It is upto you to reward yourself to keep going. For me, I may not have hit they heights I want, but with this little things, I realise I can reach the sky once I reach the next floor. Afterwards, its all duplicate to the top. But with a good foundation, standing won't be problem.
Otherwise be happy! The secodn draft seems better lol. I lost the first one smh after writing the whole thing and edting.