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.

Host layout and Tolue Noor appearance

By default the plugin renders its own standalone page and keeps the existing Ivory, Sage and Blue themes. To embed its pages in a host Django project with metatags and content blocks (including Tolue Noor), set in the host project's settings:

MONICKA_HOST_BASE_TEMPLATE = "base.html"

The plugin adapter extends that template, loads the plugin stylesheet in metatags, and places the booking content and scripts in content. The host template, its URL names, static files and context processors must be available in the same Django project. The host's complete header and footer are inherited and will reflect changes to the host template. A host with different block names can supply its own adapter with MONICKA_LAYOUT_TEMPLATE = "your_adapter.html"; the adapter must expose monicka_body and monicka_scripts blocks and load monicka_booking/booking.css. It can use monicka_host_base if it extends the configured host base.

Select Tolue Noor in Booking page settings for the matching green theme and the patterned therapist profile on direct therapist links. It uses the host site's pattern.webp static asset: ensure this asset is present and collected in the host project before selecting the theme, including when using manifest static storage. The site layout and visual theme are independent; configuring the host template does not change existing theme choices. Run migrations and collect static files after upgrading.

Plugin CSS is scoped to .monicka-booking and uses a separate font family name to avoid changing host elements. Host styles with unusually strong selectors or !important rules can still affect embedded content; check the integrated page on desktop and mobile after changes to the host stylesheet.

Metadata

Release files for monicka-booking 0.2.0

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.2.0
File Size Uploaded Provenance Actions
monicka_booking-0.2.0.tar.gz 304.5 kB Without provenance Details for monicka_booking-0.2.0.tar.gz

Built distribution (wheel)

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

Total release size: 606.6 kB

Release files / monicka_booking-0.2.0.tar.gz

Download URL monicka_booking-0.2.0.tar.gz
Size 304.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dcce58896824f128285f6158603a0782310b7227f4d0e99c1b39e26f4fe37ca2
BLAKE2b-256 checksum
How to use checksums
291c7bd06def5e9cf9558193432a83e8bb88c0e8cced175b11032351d67ecd2a
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.2.0-py3-none-any.whl

Download URL monicka_booking-0.2.0-py3-none-any.whl
Size 302.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0aae0dcf5e94cebb026b0f750435b480afeedeb6169b0a480e44b54b2f5db77b
BLAKE2b-256 checksum
How to use checksums
1abcf06f2d6ff4a939c50213fd7c246d22ea00c390ff9bc5c2f279b60cff4567
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.2.0

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