Git Product home page Git Product logo

shiftr-clone's Introduction

This is a poor-mans self-hosted version of shiftr.io

Dev

Pre-requisites

  1. Node.js

Make sure you have Node.js installed on your machine. You can download it from nodejs.org.

  1. MQTT broker

For this project to run, make sure there is a MQTT broker running which you can connect to.

  1. Docker

Preferably the Mosquitto broker is used from the docker-compose file. You can install docker-desktop.

docker-compose up -d mosquitto

Run locally

First, install the dependencies:

npm i

Then start the server:

npm run dev

Run in docker

To run the project in docker, run the following command:

docker-compose up -d --build

Docker

Server

This Docker-container will build and run the server.

The server is responsible for reading the Mosquitto log-stream and re-publishing the messages to the client.

Client

This Docker-container will only build the client files and put them at /src/client/dist/.

It could be served by a web-server like nginx or apache.

Or temporarily by running the following commands:

npm install http-server -g
# From within the src/client/dist folder
http-server -p 8080

Mosquitto

This Docker-container will run the Mosquitto broker.

The most important settings in the mosquitto.conf are:

  1. log_type all -- making sure all internal actions are exposed to the server.
  2. log_dest file /mosquitto/log/mosquitto.log -- making sure the log is written to a file which the server has access to.

User management

The default user configured is username:password.

# Encrypt the password file
docker exec mosquitto mosquitto_passwd -U /mosquitto/config/passwd
# Add a user
docker exec mosquitto mosquitto_passwd -b /mosquitto/config/passwd user password

shiftr-clone's People

Contributors

xiduzo avatar

Watchers

Luis Rodil-Fernandez 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.