[go: up one dir, main page]

DEV Community

Cover image for Starting my API journey...
raisr
raisr

Posted on

Starting my API journey...

During my career i mostly worked in small to medium companies. In most of them i had to create some kind of web based apis for a lot of different use cases. Being it as a backend for SPAs, public facing apis for customers and so on. Creating a simple rest api using the asp.net stack is quite simple. But very soon you have to tackle a lot more complicated / sophisticated problems like Authentication, load balancing, routing, configuration management, scheduled tasks and so on.

There are a lot of free and or open source tools, libraries and frameworks that help you to solve those problems. But then the real challenge starts. The available solutions a often very powerful, written in different languages and require some effort to get started with. So you have to integrate them, manage the deployment / hosting on different OSes and keep all of this up to date. That is extremely challenging for a small to medium company. You just don't have all the skills on your team or the time and budget.

So, what can i do? I want to create yet another framework :)

No, i don't want to reinvent the wheel. My goal is to create some kind of framework that incorporates existing tools where possible and hides the magic behind but gives you the power to extend if required. In the end you should have everything at hand to create apis that provide your business value without havening to much to care about the rest of the infrastructure.

So what does that mean. Lets say you want to have a logging solution. Then you could just do something like this pseudo code.

   app.UseLoggingServer(); // Enable logging server on this machine
   app.UseLogging("logging server uri"); //Send logs to the logging server
   app.UseLoggingUI(); // Provide some ui to show the logs
Enter fullscreen mode Exit fullscreen mode

Under the hood it could use for example serilog. This code would configure serilog with settings that should be sufficient in most cases. But if not you could change the serilog configuration directly.

These are some of the key aspects that i want the framework to follow:

  • Modular

Cherrypick what you want. Just need an api gateway or logging? Pick this from the framework.

  • Scalable

It should be possible to run everything within a single web application or scale out stuff that is hitting the limits.

  • No rules for your code

The framework should handle the infrastructure stuff. It should not force you how to write your code in any way.

  • OS agnostic

The whole framework has to run on windows, linux, mac os.

Here my journey starts...


Photo by Clemens van Lay on Unsplash

Top comments (0)