Giter VIP home page Giter VIP logo

wificom-webapp's Introduction

WiFiCom WebApp (Built using Laravel)

Description

This repo contains the webapp code used on the serverside for the WiFiCom project. This code is open source and free for use by anyone.

Requirements

Documentation

These docs are incomplete at this time, but enough information is given to get you started if you're familiar with Laravel.

Installation

  1. Clone the repo
  2. Deploy using a php stack such as wamp/lmap/xampp, you can also use Laravel Forge or Ploi.io to automatically build out the required infrastructure and security.
  3. Run the following command to copy the .env.example file to .env:
cp .env.example .env
  1. Run the following command to install composer dependencies:
composer install --no-dev
  1. Run the following command to install npm dependencies:
npm install && npm run build
  1. Generate a new App Key
php artisan key:generate
  1. Ensure you have a database ready to go with a user and password
    1. Edit the .env file and add your database credentials
  2. Run the following command to migrate the database:
php artisan migrate --force
  1. Run the following command to seed the database:
php artisan db:seed
- Pay attention to the output here, your initial admin user and login is provided, you'll need these later
  1. Populate the remaining ENV variables

    1. You'll need the following
      • APP_NAME=WiFiCom
      • ASSET_URL=https://yoursiteurl.com
      • APP_URL=https://yoursiteurl.com
      • an email server
      • a digitalocean spaces bucket
      • MQTT server setup
        • MQTT_AUTH_USERNAME=admin
        • MQTT_AUTH_PASSWORD=PASSWORD_FROM_EARLIER_IN_CLI_OUTPUT
      • Sentry DSN (Optional, used to track errors)
  2. You'll need to setup a cron job for the scheduler to run every minute

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1
  1. You'll need to setup a daemon for the mqtt:listener to run eternally
    1. Use Supervisor to start the daemon cd /path-to-your-project && php artisan mqtt:listener
  2. Ensure you can access the site
  3. Create an account (will require email verification)
  4. Test out the features, report back with any issues on this Repo

wificom-webapp's People

Contributors

mechawrench avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

wificom-webapp's Issues

What to do about Subscribed Applications?

  • It's an extra setup step that's really easy to forget.
  • It doesn't really add any security because the app ID isn't a secret.
  • Now people can create multiple API tokens, give one to each app, and revoke them if needed.

Make recent API requests visible on the site

Logging events is tricky, I can do so but the question remains should this log persist forever? Should it be stored in the database, in the cache?

Probably doesn't need to be particularly persistent, so cache would be fine then? Main use case is "something isn't working / is behaving unexpectedly, so want to check what's going on".

For apps with hidden requests it could just show the app name and the timestamp. For apps with open requests it could show more info about what the request was too.

Stop status messages moving other elements around

In RTB there's a big space on the left of the buttons that they could go in. In Wifi Coms there isn't so much space, but it's a matter of reserving enough so that the message appearing doesn't expand it.

Create GitHub Actions deployment

I suggested that all branches could deploy to QA and we just get the most recently updated one, so that you can easily squash-merge changes when finished.

Show the commit ID on the website so we can easily find the exact corresponding source for the version we're using.

Streamline "Accept Realtime Battle" input

I proposed on Discord:

  • move device selection above invite code
  • changing device selection clears invite code

(There still needs to be an error message if user enters the same invite code again.)

Improve "Recent Output"

  • Clear when page is reloaded
  • Clear when "Send Digirom" is clicked - wait it does already? but not always for some reason?
  • Don't clear based on time
  • Add an indicator for how long ago it was?

Make ack more responsive

When a digirom or RTB command is submitted, immediately put some text and/or a spinner to show that we're waiting for a response from the WiFiCom. Switch to the success message when ack is received. Stop waiting and show an error message if ack is not received within a reasonable time.

Editing the digirom or RTB command should probably remove the success/failure message, or stop waiting for ack if we were still waiting.

Make status messages expire

As we discussed, make them disappear after a short time? Or leave them but change the appearance (e.g. grey+strikethrough).

Acknowledgement of commands

It would be good if the WiFiCom acknowledged commands and the website status messages could say something different depending on whether this happened or not. As a first step, the webapp could add a unique ID to commands? Then at some point wificom-lib can respond? Then after that the webapp could be updated to do something with the response?

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.