This is a prototype of a distributed web server built with Node js alongside Node js Framework Express with the purpose of demonstrating how a web server may be distributed internally.
We have built three distinct web servers distributed locally. Server Distributer as the main server, being the one responsible for handling client requests and feching files that are all hosted on the other two servers, Server A and Server B. As a matter of security, Server A and Server B will only allow requests coming from Server Distributer even though they are not necessarily connected to the internet. Servers A and B work as File Servers serving files to Server Distributer, which then send them to the clients accordingly.
This prototype project has its architecture entirely based on the one illustrated below.
- Distributer Server
|--- conf
src ---|--- controller
|--- routes
- Internal Servers (host servers A and B)
|--- conf
src ---|
|--- public
In Distributer Server conf.js file in conf folder you will find the following configuration:
- Host: Distributer HOST;
- Port: Distributer PORT;
- Servers: Object with all the Internal Servers available to fetch files from.
In Internal Servers conf.js files you will find the following configuration:
- Host: Internal Server HOST;
- Port: Internal Server PORT;
- Distributer: Domain to allow requests from (Distributer Server domain).
Files to be provided go in public folder of Internal Servers.
These below are the relative paths of each of the hosted applications we have included in our project.
/spotify/home
: PWA mini-player using Spotify data, with a search area for artists or songs and a 30-second audio player. This application is being hosted on Internal Server B and serves as an example on how widely distrubuted a distributed server can be, conceptually speaking. It brings up data from distributed web servers on the web while being hosted on an internal server that is part of another distributed web server. See more details about this project in particular here;/aria/home
: Html template downloaded from onepagelove. Hosted on Internal Server A;/dazzle/home
: Html template donwloaded from onepagelove. Hosted on Internal Server B.
- nodejs >= 10.0
- npm >= 6.10.0 OR yarn@latest
Follow the steps below
- Download the project or clone it;
- Run
npm install
oryarn install
on terminal on each server root directory; - Run
npm run dev
oryarn run dev
on terminal on each server root directory.
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details.