Code Monkey home page Code Monkey logo

praesentia's Introduction

Praesentia

Praesentia is a simple Python-based web application to allow UGM students to fill their QR presence list without having another device in hand.

You can use an image file containing a QR code (can be obtained using a screenshot). Alternatively, you can just directly use the camera.

Frequently Asked Questions (FAQ)

Demo

The demo is available at https://lcat.dev/praesentia. Don't expect a 99.99% uptime, the server is an old Raspberry Pi 3. As a fallback, you can also use https://praesentia.onrender.com.

Background

  • Many UGM students are required to use SIMASTER mobile app to scan QR codes to fill their presence list. This mostly means that a student needs at least two devices to make the mechanism works.
  • Two devices are not always available.

API Source

I decompiled SIMASTER mobile app to get the source code. I also used interceptors to quickly recognize what was being sent and received.

Working Principle

It works just like scanning QR in the SIMASTER mobile app.

Side-effect

I don't think there is any except that you will get logged out of your SIMASTER app on your phone (just re-login, it will work again). I have never done research about the API's rate-limiting or any possible ban.

Installation and Deployment

Installation of Praesentia is fairly straightforward. You just need at least Python 3.6.

Installing Requirements

This app only requires flask (to serve the web) and requests library (to call the API). You can install both using pip.

pip install flask requests

Or, you can install it using the requirements.txt:

pip install -r requirements.txt

It is recommended but not necessary to separate an app's environment by using a virtual environment (e.g. venv).

Deployment

There are many ways to deploy Praesentia. You can use the following (but not limited to) ways:

  • Gunicorn
gunicorn -b :6749 wsgi:app
  • Flask development server
python wsgi.py
  • Heroku: there is already a Procfile file, feel free to use and/or edit it.

Contribution

Contribution in any form will be highly appreciated.

License

This project is licensed under MIT License.

praesentia's People

Contributors

noth3r avatar raffifu avatar ttycelery avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

raffifu noth3r

praesentia's Issues

Scan by image file is not (always) working

The QR scanning via image file is not working if a screen sharing has not started yet. This happens after the merging of #11.

How to reproduce

  1. Open the main page
  2. Select a file that contains a QR code
  3. It should show an error box.
  4. Select screen sharing as a QR source, then start sharing and stop sharing right after it started.
  5. Change the QR code back to image file, then select the same file as in step 2.
  6. The QR data should be detected (no errors)

Praesentia's Legality

When developing Praesentia, this question often arise: "Is it legal?"

This project is initially meant to help UGM students, but its legality is still a concern. This project will be considered legal if it does not violate the UGM's regulations. If it is not legal, then there is no point of developing the project.

If anyone could confirm the legality of this project or just wants to ask a question about the project, please don't hesitate to discuss it in this issue.

Add a share feature

Currently, Praesentia was only able to process a given QR code. I would like to propose a feature where one could share their QR code. The QR code is shared in the form of a URL, for example:
https://lcat.dev/praesentia#thisIstheQRData
Or, the QR data can just simply be copied to the clipboard (or maybe even an image of the QR code).

This proposed feature will make it easier for someone to share a QR code.

Implement a frontend framework like Vue or React

I am not really a fan of web designing, but I believe that the front-end side of Praesentia is getting a bit more overwhelming as the features increase.

Implementing a front-end framework will make the code cleaner and easier to maintain. If someone could wire up a PR for it, I would really appreciate that!

Unreliable QR scanning on a screenshot

html5-qrcode seems unable to detect or locate QR code on some screenshot (including one from Google Meet) that actually do contain a single QR code. Cropping the image seems to fix the problem, but that isn't a solution.

Problem: Valid QR code age is shrinking

For the last few days, I noticed that I can't scan (using Praesentia) a QR code. It seems that the age of a QR code has been decreased, it lasts for appoximately 30 seconds before then becomes invalid (or shows a "galat" message).

Temporary workaround

The temporary warkaround to this problem is to scan the QR code faster. The use of the screen sharing method combined with auto-submit will improve the overall scanning speed.

Allow scan by screen sharing to run lazily

To compensate for #23, it would be nicer if one could easily scan QR through screen sharing lazily. The lazy feature is required because sometimes Praesentia mistakenly scans for the lecturer's QR code.

To-do: only invoke stopCapture() when a QR is successfully scanned

Deploy the demo on a more reliable server

I am thinking about moving the demo site to a much more reliable place. Platforms like Heroku or something else that's free may be a good idea. This is important because I myself relies on my unreliable Raspberry Pi home server. I think other users are also using the demo. Improving server reliability will definitely improve user experience.

Idea: Browser (Firefox/Chromium) Extension with Google Meet Integration

I have this little idea currently sparking in my head. Just wanted to share it here just in case someone might want to contribute or add their ideas.

What if Praesentia was built as a browser extension that doesn't even need a server?

I also wanted it to have some kind of integration with Google Meet (maybe Zoom too?). Integration that I meant is by automatically looking for a QR code (and scanning it if there is any) throughout the whole meeting session. If possible, I also want the extension to be cross-platform on at least Firefox and Chromium-based browsers.

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.