Git Product home page Git Product logo

radio-management-server-thesis's Introduction

Radio-Management-Server-thesis

Summary

This application has been developed for the purpose of a thesis of an undergraduate student studying at the department of Electrical and Computer Engineering of the University of Patras (UoP).
Its purpose is to serve a front-end application that communicates, through a protected Reverse-proxy server, with a Web Service that manages gNodeB (5G antennas) using the TMF639 API model.
For that a reason the present Angular application (/frontend) along with the present Nodejs (/backend) for authorization and reverse-proxy have been developed.
The below infographic represents the whole system and the green bordered boxes address the applications developed for the purpose of the thesis.

system architecture Diagram drawio

The present repository consists of 2 submodules (repositories)

Live URLs

Documentation

Initialization

  • Download/clone the repository on your local system using the flag --recursive (to download the content of both submodules)
    git clone --recursive https://github.com/spiros3p/Radio-Management-Server-thesis.git

Prerequisites

Manual Setup

Angular app - Frontend

  1. Navigate to ./frontend directory
  2. RUN npm install
  3. Edit file ./frontend/src/app/router/app-routing.module.ts
    by commenting out the desired block of code that defines the const appRoutes
    canActivate: [AuthGuard] protects the routes using ./backend server of this project.
  4. (Optional) RUN npm run server on ./frontend directory
    Starts a local JSON-SERVER (fake RestAPI) at port 5000 that serves your TMF639 specification based Resources.
    • Edit ./frontend/package.json - line 10 to change port or uninstall the module.
    • ./frontend/json-server/db.json file contains the dummy Resources that are being served.
  5. Edit files
    • For Development build ./frontend/src/environments/environment.ts
    • For Production build ./frontend/src/environments/environment.prod.ts
      • Define the following variables according to your own servers and ports that RUN the server for the Resources (here JSON-SERVER port 5000) and the server for the user Authorization/reverse-proxy (here the nodejs server in the ./backend directory at port 3000).
      • You can still use direct connection between the Front end and the Web Service serving the Resources by filling the apiURL variable or leaving it empty for the Reverse-Proxy to do the job.
  6. Start the Angular application on the ./frontend directory
    • For Development RUN ng serve
    • For Production RUN ng build (compiles the angular app) and drop your build into your own production server
  7. Angular app is ready and running at http://localhost:4200/
    • if you chose to use the canActivate: [AuthGuard] routes, at step 3., you landed at a login page and you have to move to step 8. to continue setup.
      image
    • if you chose to NOT use the canActivate: [AuthGuard] routes you are DONE
      image

Nodejs app (authorization/user restAPI) - Backend

  1. Navigate to ./backend directory
  2. RUN npm install (you may need to RUN npm install bcrypt separately in some occasions)
  3. RENAME ./backend/.env-example file to ./backend/.env
  4. EDIT the same ./backend/.env file
    • Define your existing MySQL database connection settings (if you dont have one see the docker setup of the project further below to setup one).
    • Define SESSION_SECRET to protect the sessions created by PassportJS in the present Express NodeJS app.
    • Define FRONT_END_IP as the IP and Port where the Angular app - frontend is running (this is needed to allow the certain IP to exchange cookies between the nodeJS app and the Angular app)
      image
  5. Navigate to your MySQL db (own or see docker setup to use one) and copy the table ./backend/db/tbl_users.sql inside the MySQL Database defined at DB_DATABASE previously.
  6. Start the NodeJS application on the ./backend directory (Runs at Port 3000)
    • For Development RUN npm run watch (to run the app with Nodemon. This will restart the app at every save.)
    • For Production RUN node app.js
  7. Voila! You can navigate to http://localhost:4200/ and login with the existing users (admin and test - found in the table file you copied at step 12.) or create a new one

Setup using Docker (docker-compose)

Using docker to run the app will start 5 different containers

  • Angular app running at port 4200
  • JSON-SERVER (mock Resources server API) running at port 5000
  • NodeJS app (auth/user/reverse-proxy API) running at port 3000
  • MySQL database running at defualt port 3306
  • phpMyAdmin app running at port 5001

You can edit files and comment out any application you dont want the docker to run:

  • For Development build ./docker-compose.yml
  • For Production build ./docker-compose.prod.yml
  1. RENAME ./.env-example file to ./.env
  2. EDIT the same ./.env file (like previously at step 11.)
    • Default DB is using root user - MySQL Docker image is not creating another one.
    • Define everything like before (these variables will be used in the mysql docker image to setup the database and also in the nodejs app to connect to the db)
    • FRONT_END_IP depends on whether you are running it on your local machine or remote server. In the case of a remote server you need to use the external IP of the machine.
    • PROXY_IP is used in the NodeJS application to target the Web Service that serves the resources. Even at development you may need to use the network's IP of your machine to target the application correctly.
  3. Same like step 3. before at manual setup
  4. Same like step 5. before at manual setup
  5. RUN the docker-compose file in the root directory:
    • For Development RUN docker-compose -f docker-compose.yml up --build -d
    • For Production RUN docker-compose -f docker-compose.prod.yml up --build -d
  6. Make sure you navigate to http://localhost:5001/ and copy the table ./backend/db/tbl_users.sql inside the running MySQL application defined DB_DATABASE
  7. Voila! The full application is app and running at http://localhost:4200/

radio-management-server-thesis's People

Contributors

spiros3p avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.