←

COCOS Health Club & Spa

A multi-country wellness brand site with its own CMS, five country variants, three languages with right-to-left Arabic, an AI skin analysis and an AI chat, all on one self-hosted box.

Relax. Refresh. Renew.

A multi-country wellness brand site with its own CMS, five country variants, three languages with right-to-left Arabic, an AI skin analysis and an AI chat, all on one self-hosted box.

live · Wellness · CMS · AI skin analysis · React · Fastify

  • 5Country variants
  • 3Languages, with RTL
  • 6Admin panels
  • Mar → Aug 2026Built in
The COCOS home page, with the skin analysis in the nav. Click to open.The COCOS home page, with the skin analysis in the nav. Click to open.

Full-stack developer

I built the site, the CMS behind it, the AI features and the deploy pipeline. One brand, five countries: every text and image key resolves through a country-aware fallback chain, so a country only overrides what is different.

  • React 19 front end with country routes: Lebanon, Burkina Faso, Congo, Ghana and Libya
  • Custom CMS with a super-admin panel and five per-country panels
  • AI skin analysis and an AI chat, server-side so the key never reaches the browser
  • Fastify, Prisma and Postgres backend with image processing
  • Push-to-deploy with database backups and automatic code rollback

AI skin analysis

A visitor uploads a face photo and gets a structured reading and the spa treatments that fit it. Built for a spa, and the same flow fits a pharmacy recommending its own products.

  1. 1Upload a face photo
  2. 2Vision model reads the skin
  3. 3Conditions and severity
  4. 4Skin type and a score
  5. 5Three care tips
  6. 6Matching treatments
  7. 7Logged for the admin

What it does

  1. 01

    AI skin analysis

    A vision model returns JSON: conditions such as acne, dark spots, dryness or fine lines with a severity, the skin type, an overall score, a friendly summary, three tips and the COCOS treatments that help.

  2. 02

    AI chat

    A chat assistant on the site, answered from the server.

  3. 03

    Five country homes

    A global home that redirects by visitor IP to the Lebanon, Burkina Faso, Congo, Ghana or Libya variant.

  4. 04

    Locations

    A global locations page with a map, a page per country and a page per property.

  5. 05

    Three languages

    English, Arabic and French, with right-to-left layout for Arabic.

  6. 06

    Country-aware CMS

    A super admin edits everything and locks fields. Country admins edit only overrides, with locked fields read-only.

  7. 07

    AI usage analytics

    Every skin and chat call is logged with status and tokens, and the admin panel shows usage.

How it was built

  1. Content fallback chain

    Custom hooks resolve every text and image key through country, then global, so five sites share one content store without copying it.

  2. AI on the server

    The skin and chat routes call OpenAI from the API, rate limited to ten skin calls a minute, so the key never reaches the browser.

  3. One box

    nginx serves the static build and proxies the API on the same origin, Postgres has its own database and role with CONNECT revoked from everyone else, and uploads live on disk with Cloudflare R2 one setting away.

  4. Deploys by push

    A push to main rsyncs the repo, installs, dumps the database, applies the schema, seeds without overwriting, builds with rollback snapshots, swaps the client, restarts and health-checks, and rolls the code back if the check fails.

Stack

Frontend
React 19, Vite, react-router 7, react-i18next with RTL.
Backend
Node 20, Fastify, Prisma 5, Postgres 14.
Auth
Argon2id and JWT.
AI
OpenAI vision for the skin analysis, plus a chat route.
Media
sharp, local disk or Cloudflare R2 behind one storage adapter.
Hosting
nginx, systemd and Let's Encrypt on one box, deployed by GitHub Actions.