Skip to content

mbanders/boardfarm_server_vue

 
 

Repository files navigation

Boardfarm Server based on Vue

A simple front-end web application for boardfarm.

Quick Start for developers

  1. Install node for your machine https://nodejs.org/en/download/
    # Ubuntu 18 sudo apt update sudo apt install nodejs npm
  2. Clone this project
    git clone git@github.com:mbanders/boardfarm_server_vue.git
  3. Install needed libraries
    cd boardfarm_server_vue/ npm install
  4. Let this app know where the backend is served from. Edit the file src/store/store.js:
    loadStations ({ commit }) { axios .get('http://boardfarm.bluejam.net/api/stations')
  5. Start server
    npm run serve
  6. Visit http://localhost:8080/ to see your website.

Serving for Production

This frontend web app is only static files, so it could be served by any webserver software you wish. Here we use Apache:

  1. Install needed libraries
    sudo apt update sudo apt install apache2 nodejs npm
  2. Install needed apache mods (this will allow serving both frontend and backend using a proxy)
    sudo a2enmod proxy sudo a2enmod proxy_http sudo a2enmod proxy_balancer sudo a2enmod lbmethod_byrequests
  3. Clone this project & build static files to be served
    git clone git@github.com:mbanders/boardfarm_server_vue.git cd boardfarm_server_vue/ npm install npm run build
    The above creates a dist/ directory containing an index.html and other files.
  4. Modify your apache site configuration file, default is /etc/apache2/sites-enabled/000-default.conf. The full path to the dist/ directory from above step is needed in two spots. And then add the two proxy lines are so that you can serve the boardfarm server backend being served by node:
    <VirtualHost *:80> <Directory /path/to/boardfarm_server_vue/dist> Options FollowSymLinks AllowOverride None Require all granted </Directory> ... DocumentRoot /path/to/boardfarm_server_vue/dist ...   # Reverse proxy to the backend REST api. This is optional, and you   # probably run the REST api on a different port anyway. ProxyPass /api http://localhost:5001/api </VirtualHost>
  5. Restart apache
    sudo service apache2 restart

You should now be able to visit http://localhost/ to see this frontend project, and also http://localhost/api/ to see the backend.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Vue 87.7%
  • JavaScript 11.9%
  • Other 0.4%