Giter Site home page Giter Site logo

simook / p2k16 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bitraf/p2k16

0.0 1.0 0.0 630 KB

Bitraf's self-server system for doors, memberships and tools.

Home Page: https://bitraf.no

License: MIT License

Python 55.21% CSS 1.17% JavaScript 19.69% HTML 21.01% Shell 2.24% Dockerfile 0.67%

p2k16's Introduction

Getting started

Install:

  • virtualenv
  • docker

We have a collection of tools available under bin/. Some are utilities, other are wrappers around other tools to make sure that you have the correct versions.

Before running any commands, you have to source our setup script:

# . .settings.sh

Creating the database:

# cd docker/p2k16
# docker-compose up -d
# cd -
# psql -U postgres -f database-setup.sql

The root user in the database is postgres, it's password is also postgres.

Running the application:

# p2k16-run-web

This will fail unless you have the required applications installed.

You can log into p2k16 with the user 'super', password 'super'.

Development

Dependencies

  • The P2K16 gui is built with Flask
  • We assume PostgreSQL as database
  • SQLAlchemy is used as ORM.

Auto generated files

The .js files in /src/p2k16/web/static are all autogenerated by python code with matching names. door-data-service.js is generated by door_blueprint.py.

Creating SQL migrations

We use Flyway (https://flywaydb.org) to manage the schema. Flyway is a upgrade-only, sql-only tool (at least in our setup) to manage SQL databases. We're smart and are using PostgreSQL which support transactional changes to the schema.

After checking out the code and creating the database, run flyway migrate to migrate the database.

If you want to change the schema, create a new file under migrations/ called V001.NNN__clever_comment.sql. If more than one person is creating a schema at the same time you will get a conflict when the code is merged.

TODOs (fix at any time)

  • Add word completion to Add Badge text field.
  • Empty text field after clicking Add badge on user profile.
  • Show success message after adding badge on user profile.
  • Fix duplicate-check for badge names.
  • Add word cloud or similar for badges on Bitraf front page, to increase front page utility and engagement.
  • Add delete badge-button for self-made badges.
  • Limit line length for badges on user profile.
  • Drop BIGSERIAL on _version tables. Should be BIGINT instead.
  • Prevent updates to certain fields like Account.username. SQLAlchemy's event systems seems like a useful method: http://docs.sqlalchemy.org/en/latest/orm/events.html
  • Tools: maintain state in case of reboot (using retained messages on mqtt-server)

Badge system

Motivation

  • Enforce users have necessary course for dangerous machines
  • Make holding courses more attractive
  • Easier to find who knows what. Show a list/word cloud of the competence of the people who has recently checked in at Bitraf. On the front page, perhaps show a list of all active people's competence.
  • Encourage people to be active members at Bitraf

Examples

Badges is a way to tell something about a user. They have no monetary value, but can have a lot of social value.

Certain badges are restricted so that they can only be given to a person by someone else (aka karma badges), and other badges are restricted so that only certain users can award them (for example course instructors).

Most badges can be awarded multiple times too.

Badge categories:

  • Competence levels (badges required to operate certain tools that require course)

    • laser cutter
    • CNC-operator
    • lathe
  • Skill areas: (for expressing hobbies and competence levels)

    • laser cutting
    • woodworking
    • metalworking
    • soldering
    • KiCAD, Eagle
    • SMT
    • PCB-etching
    • oscilloscope
  • Karma badges

    • Cleaner
    • Dugnader
    • Bitraf project fixer
  • Various badge ideas

    • Badge "Initiator""dugnadsånd"? Badge for fixing something at Bitraf, i.e repairing laser, workshop mentoring, implementing web solutions (like this badge thingie), etc.
    • Profession badge category, i.e Professional Programmer, Professional Electrician, Professional Carpenter.

p2k16's People

Contributors

dependabot[bot] avatar drerik avatar eliasbakken avatar haavares avatar jenschr avatar jonnor avatar kogni avatar mastensg avatar mattiz avatar omega avatar sluresylta avatar tingox avatar trygvis avatar

Watchers

 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.