Skip to main content

Monicka Booking

An accessible, Persian right-to-left booking app for Django clinic websites. It is a server-rendered Django app distributed as a pip package; it does not expose clinic API keys to the visitor's browser and uses no JavaScript framework or external font service.

Install

pip install monicka-booking

Add the app, set its API key in the website process environment, and mount its URLs:

# settings.py
INSTALLED_APPS += ["monicka_booking"]
MONICKA_API_KEY = "<the clinic API key>"  # Prefer an environment variable/secret manager.
# urls.py
from django.urls import include, path

urlpatterns += [path("booking/", include("monicka_booking.urls"))]

Then run python manage.py migrate. A staff user can configure title, colors, text size, displayed currency label, and optional support phone in Django admin under Booking page settings. Set the API origin and home clinic ID there. The API key is intentionally configured outside admin and is never sent to the browser.

Static files in production

The package contains its CSS, JavaScript, and logo under Django's app static directory. Django's development server discovers these directly when django.contrib.staticfiles and monicka_booking are in INSTALLED_APPS. Production servers do not serve app assets automatically: configure STATIC_ROOT and run collectstatic whenever the package is installed or upgraded, then serve that directory through Nginx or WhiteNoise.

# settings.py
STATIC_URL = "/static/"
STATIC_ROOT = BASE_DIR / "staticfiles"
python manage.py collectstatic --noinput

For Nginx, map /static/ to the STATIC_ROOT directory. If the site uses a manifest-based static storage backend, keep its collected manifest and hashed assets together. A successful collectstatic should include monicka_booking/booking.css, monicka_booking/booking.js, monicka_booking/assessment.js, and monicka_booking/monicka-logo.png.

API setup

Issue a clinic API key in Monicka and set the key's home clinic website_url to this site's HTTPS origin (including the same origin used by the plugin payment return URL). Set each clinic's plugin_booking_days in API admin. The default booking window is 20 future days. All clinics with the same owner are offered as branches in one catalog. Therapist profile fields (short bio and specialties) are maintained in API admin.

The package talks to the API over HTTPS using X-Clinic-API-Key. Website hosting must allow outbound HTTPS requests to the configured API. The payment callback returns to the plugin completion page, where the package verifies the confirmation code server-to-server before showing appointment status.

To link directly to one therapist at one branch, use the regular booking URL with both public IDs:

/booking/?therapist=133&clinic=5

The plugin checks that this therapist is actually offered at that clinic before entering the calendar step. The page then contains only that therapist and branch, skips the therapist/branch directory, and continues through the normal availability, booking, and payment checks. Invalid or mismatched IDs show an error instead of opening the full directory. These IDs are selectors, not credentials; do not put a patient's name, phone number, or other personal details in a URL. The API still validates every selected time and booking.

Booking flow and accessibility

The initial therapist catalog is server-rendered. JavaScript progressively loads the Jalali calendar's available days and slots from same-origin Django views; dates and slots are always validated again by the API at booking time. The responsive UI uses semantic form labels, keyboard-operable buttons, visible focus rings, large controls, live status announcements, high-contrast light themes, adjustable type size, and reduced-motion support.

Theme choices are intentionally CSS-variable based so future themes can be added without introducing a UI framework. The calendar uses the browser's built-in Persian calendar formatter.

Development

pip install -e '.[test]'
python -m django test --settings tests.settings

You can also run the source checkout as a standalone local Django site without installing monicka-booking. Use an existing Python environment with Django and Requests available:

export PYTHONPATH="$PWD/src"
DJANGO_PYTHON="/path/to/python-with-django"
"$DJANGO_PYTHON" -m django migrate --settings tests.dev_settings
"$DJANGO_PYTHON" -m django createsuperuser --settings tests.dev_settings
"$DJANGO_PYTHON" -m django runserver 127.0.0.1:8000 --settings tests.dev_settings

Open http://localhost:8000/booking/ for the booking page or /admin/ to configure its title and theme. This local setup uses a persistent SQLite database at dev.sqlite3; the test settings continue to use an in-memory database. Without MONICKA_API_KEY and a reachable API the page shows its friendly unavailable state. To try real slots and payment handoff, point it at a staging API and test gateway. A production project supplies its own Django settings, database, and admin configuration.

Metadata

Release files for monicka-booking 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monicka-booking 0.1.1
File Size Uploaded Provenance Actions
monicka_booking-0.1.1.tar.gz 300.4 kB Without provenance Details for monicka_booking-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monicka-booking 0.1.1
File Interpreter ABI Platform Actions
monicka_booking-0.1.1-py3-none-any.whl Python 3 none any Details for monicka_booking-0.1.1-py3-none-any.whl

Total release size: 599.4 kB

Release files / monicka_booking-0.1.1.tar.gz

Download URL monicka_booking-0.1.1.tar.gz
Size 300.4 kB
Tags Source
SHA-256 checksum
How to use checksums
ecee82cc9f9486c82e3b0a0183d91231558161f94d8c533ad6fcd905ce86c567
BLAKE2b-256 checksum
How to use checksums
e31cf3867f601696039bae13d08ff5c43b96e9f04bd752f08a8d2cdc424df6b4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Release files / monicka_booking-0.1.1-py3-none-any.whl

Download URL monicka_booking-0.1.1-py3-none-any.whl
Size 299.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f606829c02a98a488e09fd15974e11ac9de1c078bf0f48e582125d5247e0f838
BLAKE2b-256 checksum
How to use checksums
614e531aef1ae1d09d1899f2c5cdc959565d4acfacc7dc0d0a0e3c393b6c2801
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.5

Security for monicka-booking 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page