Giter VIP home page Giter VIP logo

boardfarm_server_vue's Introduction

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 [email protected]: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 [email protected]: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.

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.