Skip to content

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.

License

Notifications You must be signed in to change notification settings

melquibrito/distributed-web-server

Repository files navigation

Distributed Web Server - Prototype

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.

Architecture

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. illustration

File Structure

  • 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.

Hosted Applications

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.

Getting Started

Prerequisites

Installing

Follow the steps below

  1. Download the project or clone it;
  2. Run npm install or yarn install on terminal on each server root directory;
  3. Run npm run dev or yarn run dev on terminal on each server root directory.

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published