GithubHelp home page GithubHelp logo

owba / ausweis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 158 KB

Django app for digital membership cards

Makefile 3.02% Dockerfile 1.59% Python 65.36% HTML 5.91% Shell 0.98% JavaScript 16.79% CSS 6.35%
django member-card membership-management static

ausweis's Introduction

Ausweis

A Django app for digital membership cards.

example member card

try out the frontend

Features

  • Encrypted personal data
  • Cards with limited validity and auto-expire
  • Daily validity and animation to prohibit screenshots
  • Access your cards as bookmark or Homescreen app
  • Fully customizable card design (html,css,js knowledge required)
  • Extensible custom fields
  • Static frontend with separate backend for card management (can be used offline)

Install (Docker)

1. Clone this repo or download the code to your server.

Alternatively you can rsync the content to your server:

make push SSH=user@domain:/path/to/ausweis

(this will rsync: backend/*, Makefile, docker-compose.yml)

2. Create your environment file

You must generate a secure key first. Alternatively, you can run make gen-key to generate a new key but this will only work if the container is already running (next step). To apply the new key, you must reboot the container (make stop start).

File: /path/to/ausweis/.env

DJANGO_SECRET_KEY='your-fancy-secret'
ALLOWED_HOSTS=mydomain
#URL_SUBPATH=backend
DEBUG=0

Then set the permissions of the file to be readable only by the docker user:

chown root:root "/path/to/ausweis/.env"
chmod 600 "/path/to/ausweis/.env"

3. Start the container

make start
make init  # only needed the first time (creates admin user)

4. Configure webserver

You can run this server either on same url or split the backend and frontend part into two. Refer to the nginx.conf files in frontend.

Make sure to configure the file properly. See frontend/README.md for further instructions.

You may need to create an SSL certificat first (e.g., Certbot).

5. Test your server

Open the administration page to create new cards. Depending on your configuration this URL will be hosted at https://your-domain.com/<subpath>/edit/.

Install (vanilla)

Not tested but should be similar to the Docker setup. You will need to install pip install gunicorn uvicorn and run the Django application directly (see scripts/on_deploy.sh). Further, you will need to update STATIC_ROOT and EXPORT_PATH in your settings.py. (And probably check how to pass the env-file to gunicorn). Finally, you should persist the service to respawn after a system reboot.

Next steps

So your server is running and you have created your first card. What's next?

  • Modify the frontend html example to match the design of your business / workshop (see Frontend below).

  • If you need more fields, use the "Additional data" json (e.g., {"extra":"Value"}). And in your html: <i id="extra">placeholder</i>.

  • You probably want to modify the webmanifest so that you can "install" your member card as an "app" (incl. apple-touch-icon etc.). Have a look at the real favicon generator or create your own.

Develop

Frontend

  1. Start a webserver from ./frontend/example-html/. A simple static server is sufficient (e.g., python -m SimpleHTTPServer 80 or php -S 0:80)

  2. Open http://127.0.0.1/#org/d9498400-2640-442e-a092-6b4537a9b74d/rpsLvt6armrp

Backend

  1. Prepare virtual environment and start dev server:
cd backend
python3 -m venv .venv
. ./.venv/bin/activate
pip install -r requirements.txt
./manage.py runserver
  1. Open http://127.0.0.1:8000/edit/
  2. Create a member and an organization (with URL http://127.0.0.1)
  3. Create a symlink for the data folder to use your backend json files directly:
cd frontend/example-html
ln -s ../../backend/data/export data
# alternative: edit `EXPORT_PATH` in `backend/config/settings.py`

ausweis's People

Contributors

relikd 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.