Server Architecture Setup.

May 27, 2019 2.1k views
Docker Initial Server Setup Apache Nginx Kubernetes Ubuntu 18.04

Hello there!

Let’s start with some backstory, I’m not an experience coder at all. I know some HTML & CSS and some simple python, some fundamentals you know. I have decided to start a project to get more familiar with Web Server building. So let me tell what I need help with, I don’t know what types of systems I should use, and what system does what thing. So I need kinda of a push in the right direction I should go.

This is how I want my server setup.

Front-End and Back-End needs to separate.

Front-End is supposed to be my personal website that everyone can see but with an login function to control some back-end, like hangfire processing service, or If I just wanna setup some front end stuff that requires to be logged in to see.

I want all my stuff separate through containers which I guess Docker compose will do.

Back-End I want to be able to upload web applications that either I can run through my login function or if I wanna publish my work to anyone through my front-end.

Thats kinda it. I know its alot, but I also wanna say that all I really need help with is like a simple simple list of services to use, like this for example. (Examples are like NGINX, Docker, NodeJs, Kubernetes etc, etc)

Frontend = ?

Login & Auth server= ? (Auth I guess Jws auth server?)

Container = ?

Backend = ?

Frontend & Backend Communicator = ?

MySQL database for login = ?

I would assume that alot of microservices will be involved.

If you have any question feel to ask me. I tried my best explaining my situation, i’ve tried googling alot. I also know that there is alot alot of work ahead of me, this is project that I will try to finish within 1-3 years honestly, since there is most likely going to involve learning a couple of programming language.

2 Answers

Hey, I’m no expert, but may be able to point you in a helpful direction. A lot of this is really up for you to decide, as you can architect web applications like this in many ways. To jump directly into each question individually:

Frontend = ?

This depends on what you know. If you only know HTML and CSS, then you could simply use many web servers to directly render those pages. You could also use a more barebones templating engine like Handlebars if you want a little more control without a full blown framework, or something like Angular/Vue/React if you want a more robust front-end framework. What suits your needs heavily depends on what this front end application of yours is supposed to do, and I’d recommend thinking that through before deciding on a front end design. There’s a front-end javascript framework for everything these days so go shopping.

Login & Auth server= ? (Auth I guess Jws auth server?)

I would think this really depends on your backend. For example, you can use Node with Express and create auth middleware that will execute to authorize requests before doing anything else on your application, but you could also direct login routes to a separate auth server running on the backend and have your applications backend receive the “successful auth” message from that external service. This is definitely the aspect I’m least versed in, so sorry for the lack of a better answer.

Container = ?

Like you said, Docker can probably do the job here. I’m no docker expert but I don’t see why you couldn’t containerize both your front and back end so long as you configure the containers and the networking such that they can communicate.

Backend = ?

Almost whatever you want and are most comfortable with, but here are my thoughts. I would think primarily about Python (Django, Flask), Javascript (Node + Express), and PHP (Laravel, etc.) One huge benefit for you about using a Javascript backend is that you don’t need to learn a separate language for the front end and back end work, it’s all javascript. Since you said you expect to need to learn some languages, this might cut down on that. Otherwise, if you’re comfortable with either PHP or Python, or something else I’m not mentioning here, go for it!

Frontend & Backend Communicator = ?

I have personally found great success in using the backend to create a RESTful API, and interacting with that API from the front end to “communicate”. I find this very clean and convenient, and has the added benefit that if it ever becomes a future requirement, accessing your backend API from other applications is simple so long as it is written RESTfully and the networking for it’s container is configured (since you said you want containers).

MySQL database for login = ?

MySQL is a specific SQL database, so I’m going to assume that you mean which SQL database to use. I’ve been enjoying postgres recently, and I know DO uses postgres for DBaaS. Otherwise MySQL would do fine - though I’d avoid Oracle SQL because I have had bad experiences there in the past.

See Edit: If you don’t care about the database being SQL, you could always go for something non-relational like Mongo, but if you’re already familiar with SQL this would just be another new thing to learn. Up to you on that one really.

Edit: I have been informed that Mongo has not been recommended recently and people have many gripes with it. Given that, I’d look into other NoSQL options if you want to go down that route - I’m mostly a SQL guy myself.

Again I’m no expert, but these are my 2 cents. Figured I’d leave a comment since no one else has yet.

Have another answer? Share your knowledge.