Skip to content

Start from the starter

An Astro site that takes its content from Rivil, Site module, and an npm package that does the hard part. You (or your AI assistant) only change how it looks.

  • The starter (rivil-site-template): home page, pages and posts following the URL pattern set in Site, menus, contact form, 404 page, sitemap, robots, a second language on /en, rules for Claude Code and Cursor.
  • The package (@rivil-solutions/site-kit): the API client with its cache, the webhook that clears it, Gallery images, languages, SEO, cart and customer account. It updates with npm update, so a fix reaches every site.
  1. Start a new site: Use this template on GitHub or npx degit iorpaul3/rivil-site-template my-site.
  2. In the ERP, under Site: create the site, then on its page a site key and, so it updates by itself, a webhook to <site address>/api/hooks/rivil with the content.* events.
  3. Copy .env.example to .env and fill in ERP_URL and ERP_SITE_KEY.
  4. npm install, then npm run dev: the site shows the company’s real data on http://localhost:4321.
  5. Work locally until it looks right, then deploy once (Dockerfile included).
Terminal window
npx rivil list
npx rivil add booking
npx rivil theme cabana
Module What it adds
booking online booking: services, specialist, time, confirmation
stay stays: free rooms by night, reservation
careers open jobs, job page, application with CV
reviews published reviews and the review form
events events, paid tickets, the order
newsletter newsletter signup, with email confirmation

The command copies the pages and components into the project: from then on they are yours to change. The logic (free slots, holding the slot, validation, submitting) stays in the package and updates with it. The command also prints the scopes the site key needs and the English URLs to add to the config.

The starting themes (aer, cabana, curte, lumen, miez, solvar) come from the demo sites and only change colors and fonts.

The shop is not a module to copy: start from Casa Lumen, which uses the same package.

  • the site key: server only, never in the browser or in PUBLIC_*;
  • the webhook route and the /api/rivil route, through which the browser talks to the ERP;
  • data that exists in the ERP (texts, prices, opening hours, phone numbers): it does not go into code.
For AI assistants

For a new site on Rivil, start from the starter and use @rivil-solutions/site-kit instead of writing another fetch client for the ERP. For booking, stays, careers, reviews, events or newsletter, run npx rivil add <module> and only change the copied components. Read the project’s AGENTS.md before any change.