Skip to content

over-engineered checkin-system that can be deployed to a raspberry pi.

License

Notifications You must be signed in to change notification settings

d-rk/checkin-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

checkin-system

over-engineered checkin-system that can be deployed to a raspberry pi.

Raspi Board

Hardware

The system uses a rasperry pi with a custom shield to read RFID tokens and provide visual and acoustic feedback.

Building the raspi shield

For the shield the following parts are needed:

parts list

part description link
RC522 RFID Reader module module to read ids from cards or tokens https://www.amazon.de/gp/product/B01M28JAAZ
PCF8523 RTC module module to record correct timestamps https://www.amazon.de/gp/product/B07LGTX8M9
KY-012 active piezo buzzer acoustic feedback after rfid read https://www.amazon.de/gp/product/B07ZYVH6XM
green/red LED visual feedback after rfid read
2 resistors needed for LED circuits

Schematic

The shield can be build based on the following schematic:

Fritzing

Download the Fritzing File.

Install and configure the raspi

Install dependencies:

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install build-essential git python3-dev python3-pip python3-smbus i2c-tools
sudo pip3 install spidev mfrc522

Configure interfaces:

sudo raspi-config

Install docker:

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

sudo usermod -aG docker $USER
newgrp docker

sudo pip3 install docker-compose

Software

The software consists of the following parts:

  • postgres database for persistence
  • backend that is attached to the database and provides rest and websocket api
  • frontend for the application, which talks via rest,websocket with the backend
  • python script to interact with the raspi-shield and send rfid reading to the backend

The software can be installed via Docker Compose.

installation

# clone the repository
git clone https://github.com/d-rk/checkin-system.git

# change to the repo dir
cd checkin-system

# build images yourself
docker-compose build --pull

# or pull them
docker-compose pull

# bring up the containers
docker-compose up -d

The frontend will then be accessible under http://localhost:3000/

development

this chapter discribes steps needed when developing the software.

local dev environment setup

  1. Create a postgres in docker:
docker run --name postgres \
    -e POSTGRES_USER=postgres \
    -e POSTGRES_PASSWORD=postgres \
    -e POSTGRES_DB=checkin-system \
    -p 5432:5432 -d postgres
  1. Create an .env file for the backend
cat > backend/.env <<- EOM
DB_HOST=127.0.0.1
DB_DRIVER=postgres
DB_USER=postgres
DB_PASSWORD=postgres
DB_NAME=checkin-system
DB_PORT=5432
DB_SSL_MODE=disable

CORS_ALLOWED_ORIGINS=*
EOM
  1. Run backend
cd backend
go run .
  1. Create an .env file for the frontend
cat > frontend/.env <<- EOM
REACT_APP_API_BASE_URL=http://localhost:8080
EOM
  1. Run frontend
cd frontend
npm start

build/publish docker images

on an arm64 machine clone the repo an run:

# build
git pull
docker-compose build --pull

# login to quay.io / user-settings / Generate Encrypted Password
export QUAY_IO_PASSWORD=xxx
echo $QUAY_IO_PASSWORD | docker login -u d_rk --password-stdin quay.io

# push
docker-compose push

About

over-engineered checkin-system that can be deployed to a raspberry pi.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published