Git Product home page Git Product logo

punchcontrol's Introduction

Punchcontrol

This project is an orienteering timing software licensed under GPL v3.

The goal is to run a web server (Node/Express) embedded in an Electron desktop app, serving an Angular web app, hence accessible remotely for concurrent management of the race. Data are stored in an SQLite database file.

Status

This project is currently a work in progress! Don't even think of using it right now! :)

Developers doc

All instructions below are beeing tested on Ubuntu Linux but the app should eventually run on Linux/OSX/Windows.

Folders

  • server is the standalone Express server
  • client is the Angular web app
  • shared is the code shared between the server and the client
  • electron is the packaged desktop app (holding both the client and the server + some specific code)
  • design is a non-code folder for various design docs

To build the app

Install yarn - see https://yarnpkg.com

Then cd the project and run:

$ yarn
$ yarn run prepare
$ for FOLD in shared client server; do cd $FOLD && yarn && yarn build && cd ..; done

Run unpackaged during dev

For a live-reload, just run the ./run-dev.sh if you are using Gnome (or at least have gnome-terminal) then head towards http://localhost:4200

Build the folders except the electron one as explained above, then setup a database and finally:

cd ../server
yarn run start

At last go to http://localhost:3000/races with your browser...

Database support

In theory the app should work with SQLite and PostgreSQL, although SQLite is the main target and PostgreSQL (or MySQL?) is only a long term goal.

For now, there is no way to switch the DB at startup... you have to change the code (see .../dbconnection.ts).

SQLite

This one is the easiest setup of course :) Nothing to do, the DB is stored under /tmp/myevent.punch. TypeOrm is able to generate DDL commands to create the model at startup.

PostgreSQL

If you want to test with a PostgreSQL database...

sudo docker run -p 5432:5432 --rm --name postgres --env POSTGRES_PASSWORD='!Passw0rd' postgres:9.6
sudo docker exec -it postgres bash
psql --user postgres
create database punchcontrol;

Then modify .../dbconnection.ts as required to use PostgreSQL.

Database model & content

In punchcontrol/server/src/dbconnection.ts you will notice that both synchronize and dropSchema flags are set to true which means that the model and content of the DB is recreated at each startup.

Packaging with Electron

Once the other folders are built, finish with:

cd ./electron
yarn
yarn run dist

After a (quite long) Electron build, run:

./dist/punchcontrol-0.0.1-x86_64.AppImage

NOTE: if you chose yes it will install the app while no will just run it once.

Observe that nagigating with your browser to http://localhost:3000 shows the same UI!

Cleanup

The cleanup is done by running this from the root project folder (be careful!)

rm -rf $(ls -d  */dist */node_modules)

punchcontrol's People

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.