Skip to content

Getting Started

Introduction

Wajha is the template engine behind every Tjjar storefront. A theme you build with it is installed by a merchant, rendered on our servers, and served to shoppers as ordinary HTML.

A theme is three things:

  • Templates — Jinja-style .jinja files, one per storefront route: home.jinja, product.jinja, cart.jinja and the rest.
  • A settings schema — JSON declaring what a merchant may change. The Theme Editor builds its form from this file; you never build the form yourself.
  • Assets and locales — CSS, JavaScript and the Arabic/English strings your theme displays.

Templates render on the server, before anything reaches the browser. A shopper on a slow connection sees your layout in the first response, and a crawler sees the whole page without running JavaScript.

Why build for Tjjar

Tjjar Plus is an Omani platform: its merchants sell across Oman and the wider Gulf. Building a theme here means:

  • One theme, many stores. Publish once; every merchant who installs it gets the same code with their own settings.
  • Arabic is the default, not an afterthought. The platform ships right-to-left rendering, Arabic typography and Hijri-aware formatting. Your theme inherits all of it.
  • Merchant settings survive your updates. A merchant's choices are stored as data against their store, never inside your files, so you can ship version 2.1 without overwriting anyone's work.

How a page renders

  1. A shopper requests a URL on the merchant's domain.
  2. We resolve which store that domain belongs to, and which theme version it has published.
  3. We build the template context — the store, the products on this page, the cart, the merchant's settings — as plain data.
  4. Your template renders against that context.
  5. The HTML is returned, and cached.

Step 3 is the one worth internalising early: the context is fully assembled before your template runs. A template cannot query the database, call an API or trigger a fetch. What you can see is what the route decided to put in front of you, and How Context Is Built explains what that is for each page.

What a theme may not do

Themes run on our infrastructure, next to other merchants' stores. A short list of hard limits, covered properly in the security model:

  • No filesystem access, and no network access.
  • No disabling of output escaping — every value you print is escaped for you.
  • Templates are compiled and reviewed before they can be published.

Where to go next