idpass / idpass-card-generator

Automate creating of multiple IDs, badges and cards for different people. Just upload your template and start generating your cards with different information.
Apache License 2.0
1 stars 1 forks source link

Card Generator Backend

Automate creating of multiple IDs, badges and cards for different people. Just upload your template and start generating your cards with different information.

Black code style

Getting Started

Clone this repo

git clone https://github.com/idpass/idpass-card-generator.git

Requirements

Build
docker compose -f local.yml build
Run Services
docker compose -f local.yml up

Creating a user

docker compose -f local.yml run --rm django python manage.py createsuperuser

Documentation

Endpoints are documented using OPENAPI specification. Visit this page to try and discover how this endpoints work.

For more in-depth explanation of card endpoints, please visit the documentation on its usage

Configuration

For config settings, environment variables are stored in .envs/. Local values are already provided for quick setup of local environment.

Django configuration settings are divided into different environments following 12 factor app principle. You will see that under config/settings we have local, production, test and the base config.

Development

Docker can help developers quickly set up the project environment with only a few commands. This project can be setup with or without Docker.

Type checks

Running type checks with mypy:

mypy card_generator

Test coverage

To run the tests, check your test coverage, and generate an HTML coverage report:

coverage run -m pytest
coverage html
open htmlcov/index.html

Running tests with pytest

pytest

Deployment

This project expects you will have a production environment files located in .envs/.production with the same .django and .postgres files inside.

Deployment with Docker and Compose is easy and can be setup on any remote server. Follow this instructions to deploy this project to a production server.

License

Apache 2.0