This web application allows for consumers to trace the origin of a product to ensure authenticity. All records related to a product are protected cryptographically.
- Python / Django
- PostgreSQL
verifier/manage.py— Django entrypointverifier/verifier/settings.py— Django settings (includes DB config)verifier/chain/— main Django appverifier/chain/migrations/— database migrations
- Python 3.11+ (3.12 also works for most Django setups)
- PostgreSQL 14+ (or any reasonably recent version)
- (Recommended)
venvfor virtual environments
git clone https://github.com/TaffCodes/verifier.git
cd verifierpython3 -m venv .venv
source .venv/bin/activatepy -m venv .venv
.venv\Scripts\Activate.ps1This repository may not include a requirements.txt / pyproject.toml at the root. If it does, use one of the following:
- If
requirements.txtexists:pip install -r requirements.txt
- If
pyproject.tomlexists:pip install .
If neither exists, you’ll need to install dependencies manually (at minimum):
pip install django psycopg2-binaryThe repository currently hardcodes PostgreSQL settings in verifier/verifier/settings.py:
- DB name:
supplychain - DB user:
postgres - DB password:
aaabbb. - DB host:
localhost - DB port:
5432
You can either:
- (A) create a local database/user matching those settings, or
- (B) change
settings.pyto match your local credentials.
Log into Postgres and create the database:
psql -U postgresThen in the psql prompt:
CREATE DATABASE supplychain;
-- If you want to set the password to match settings.py:
ALTER USER postgres WITH PASSWORD 'aaabbb.';Exit:
\qEdit verifier/verifier/settings.py and update:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql',
'NAME': 'supplychain',
'USER': 'postgres',
'PASSWORD': 'aaabbb.',
'HOST': 'localhost',
'PORT': '5432',
}
}Tip: For a real project, move these to environment variables (DATABASE_URL or individual DB_* vars) instead of committing secrets.
From the repo root, run:
python verifier/manage.py migrateThis will apply migrations including the initial migration for the chain app (e.g. verifier/chain/migrations/0001_initial.py).
python verifier/manage.py createsuperuserpython verifier/manage.py runserverThen open:
Admin (if enabled):
Run migrations:
python verifier/manage.py makemigrations
python verifier/manage.py migrateRun Django shell:
python verifier/manage.py shellCollect static files (production-ish):
python verifier/manage.py collectstaticIf you get errors installing psycopg2, try:
pip install psycopg2-binaryVerify:
- Postgres is running
- Host/port are correct (
localhost:5432) - Credentials in
settings.pymatch your DB user/password - Database
supplychainexists
Make sure you created the database first (CREATE DATABASE supplychain;) before running migrate.
SECRET_KEYand database credentials appear to be hard-coded inverifier/verifier/settings.py.- Do not use these values in production.
- Prefer environment-based configuration and
DEBUG = Falsefor production deployments.