Giter VIP home page Giter VIP logo

pixelcode's Introduction

pixelcode

Kiosk application to print QR codes to authenticated users.

The user first has to input their employee identifier (email or internal ID) so as to verify their identity. If the identifier is known, a verification code is sent to their email address. Upon verification of the email address a unique QRCode is printed to them.

On server startup a default administrator user is created with a default password and the OAuth scope "admin". Users with the admin role can create new users and grant them finely grained roles which have already been defined.

Installing

If you only plan on running the Docker containers you can directly jump to Running using Docker after having set up your environment variables.

User interface

The user interface can be installed using npm. Inside the front directory run:

npm install

Application server

Dependencies are defined in pyproject.toml and requirements.txt. The application server can be installed in a virtual environment. For example using Poetry and in the project root:

poetry install

Running

Environment

In .env.example :

  • SMPT_* variables define settings for the emails service. Failing to update these values will not allow you to send emails.
  • ALGORITHM and SECRET_KEY keys are used to sign JWT tokens.
  • Change the value of SECRET_KEY to a randomly generated key using for example:
openssl rand -hex 32
  • ORIGINS and VITE_API_URL keys define respectively the URLs where the user interface and the API are accessible.

Using Docker

Attention, update .env.example with your environment variables. Do not change the file name. Both frontend and backend are dockerized. To start them, run in the project directory:

docker compose up -d [--build]

or

docker compose run -d [--build] <frontend | backend>

The application is served to localhost:5173 by default. The API documentation is available at localhost:8000/docs by default.

From source

Attention, copy .env.example to .env with your environment variables.

User interface

Start the vite development server using:

npm run dev

The application is served to localhost:5173 by default.

Application server

Activate the virtual environment where the server is installed. For example using Poetry and in the project root:

poetry shell

Then run:

uvicorn app.main:api --reload

The API documentation is available at localhost:8000/docs by default.

Details

Typescript, Vite, VueJS frontend, served through NGINX. NGIX server running as frontend Docker service. Python, FastAPI backend, served through uvicorn. Uvicorn server running as backend Docker service.

To do

  • Update README pictures
  • Backend: Printing using cups
  • Backend: Cleanup qr codes once they are printed, enhance the security of csv route
  • Backend: Enhance OpenAPI documentation
  • Frontend: Implement employee management in admin dashboard
  • Frontend: Enhance error/loading handling when accessing backend
  • More efficient use of environment variables on the backend

pixelcode's People

Contributors

yannmazita avatar

Stargazers

 avatar David avatar  avatar  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.