The first step on my journey toward my own engine was the platform layer.
I wanted to support as many platforms as possible and write platform code that would not need to be changed frequently. The SDL2 library seemed like a good choice for me. It is lightweight, supports a large amount of platforms and is also well integrated into Steam. The API is nice to use as well.
The boundary between the platform code and the application code is designed to be very strict, so changing the platform layer to use a different method of communicating with the hardware would be possible without modifying the application code itself.
I did a lot of research into game engine architecture before writing my code and found Casey Muratori's Handmade Hero to be a good reference.
My code is written in C++.
The underlying architecture of my engine is as follows:
A separate compilation unit is created for everything that is platform dependent, that includes audio, input, managing the window, managing memory, etc. Essentially anything that has to talk to the hardware goes in that file. (sdl_xbEngine)
The platform layer communicates with the operating system and thus hardware via SDL2 and in the future Vulkan.
It also contains the main update loop.
From that loop, calls get made into the application code itself. (xbEngine)
The application code can then be totally platform independent and would not need to be changed when the platform code changes.