HOCO B2B
Ways of working

Repositories and access

The two repositories, what goes where, who can do what, branch protection, secrets, the accounts production depends on, and onboarding and offboarding checklists.

The two repositories

RepositoryOwner accountVisibilityHoldsMain developer
AnisBetehi/hocoAnisPrivateServer, back-office, reseller web, docs site, shared packages, the API contract, the plan and the specsAnis
hoco-mobileImad's GitHub accountPrivateReseller app, delegate app and their hoco_* packagesImad

The only hard coupling between them is the OpenAPI document exported from packages/contracts (ADR-001). The full trees are on the architecture page; what matters day to day:

content/plan/tasks.json — the plan
content/spec/*.json — requirements, screens, endpoints, enums
public/openapi/hoco-v1.json — exported OpenAPI document
docker-compose.yml — local Postgres, Redis, MinIO, Mailpit
.env.example — the single environment file

What goes where

You are changing…It goes inRule
An operation, a request or response shape, an error codehoco → packages/contractsA contract PR, reviewed by Imad (API-contract workflow)
The OpenAPI documenthoco → apps/docs/public/openapi/hoco-v1.jsonGenerated by pnpm openapi:export, never edited by hand
The Dart API clienthoco-mobile → packages/hoco_apiRegenerated from the pinned document, never edited by hand
The databasehoco → packages/db/prismaOne migration per PR (migrations)
Design tokensClaude Design first (exported as hoco.tokens.json), then packages/ui and hoco_uiSame token names in all three places
Web UI copy and translationshoco → the Next app's message filesfr complete, ar and en keys present
Mobile UI copy and translationshoco-mobile → hoco_l10nSame rule
The plan, requirements, screens, endpoint catalogue, decisions, these pages, the mobile pageshoco → apps/docsImad writes the mobile pages through PRs to hoco
A bugGitHub issue in the repository whose code must changeWhere bugs live
Designs, prototypes, design commentsClaude DesignThe docs link to frames; they never copy them

Who can do what

Personhocohoco-mobileClaude DesignWhy
AnisAdmin (owner)AdminShared link (view, comment, handoff bundle)Owner of hoco; reviews mobile API usage and security; runs DevOps
ImadWriteOwnerShared link (view, comment, handoff bundle)Write is needed for his approval to count on contract PRs and to push docs branches
AkramReadReadOwner of the projects, editorReads code, opens and comments issues and PRs (design QA, UI review)
HOCO——View and comment on the review pagesReads this site (restricted access) and tests on pre-production
  • Two-factor authentication is mandatory on every account listed on this page.
  • Imad uses Write on hoco for contract reviews, the mobile and API docs pages and issues. He does not merge into apps/server, apps/dashboard or apps/web.
  • Akram has Read only: he cannot push branches or apply labels. His edits to the design pages are filed as issues labelled docs with the exact text; Anis commits them within two working days. Labels on his design-QA issues are set at triage.
  • Before go-live, hoco-mobile moves from Imad's personal account to an organisation account, together with the upload keystore and the Play Console ownership — who controls that organisation (HOCO or the team) is settled in the decision register (ADR-001).

Branch protection

Protection needs a paid plan on private repositories

GitHub enforces branch protection and rulesets on private repositories only on GitHub Pro, Team or Enterprise. Both owner accounts (Anis for hoco, Imad for hoco-mobile) are upgraded to Pro before the first PR is merged. Until then the rules below hold by discipline and CI only.

Repository settings (both repositories). Default branch dev (so PRs target it and Closes #n closes issues on merge). Squash merging and merge commits allowed, rebase merging disabled, squash as the default button. "Automatically delete head branches" on. Tags v* and contracts-v* can be created by the repository owner only.

Rulemasterdevrelease/*
Direct pushBlocked, admins includedBlocked, admins includedBlocked — fixes arrive by PR
Required checksAll CI checks of the repository (checks)SameSame
Required approvals0 — only the repository owner merges, and only release/* or hotfix/*1, from a code owner; the repository owner may bypass it on their own PRs outside sensitive paths1, same bypass
Conversation resolutionRequiredRequiredRequired
Force push, deletionBlockedBlockedBlocked (deleted by the repository owner after the release)
Merge methodMerge commitSquash (merge commit only for back-merges from master or release/*)Squash

The bypass is the self-review path of a team where each repository has one main developer. It is never used on a PR labelled contract or mobile-impact in hoco, or touching a sensitive path in hoco-mobile — those wait for the other developer's approval (who reviews what).

Code owners. hoco already has .github/CODEOWNERS with * → @AnisBetehi and a prepared contracts line. On day one, Anis uncomments it with Imad's handle and adds the mobile docs pages:

# hoco — .github/CODEOWNERS
*                                   @AnisBetehi
/packages/contracts/                @AnisBetehi @imad-handle
/apps/docs/content/docs/mobile/     @AnisBetehi @imad-handle

hoco-mobile mirrors it (set up in MOB-01):

# hoco-mobile — .github/CODEOWNERS
*                          @imad-handle
/packages/hoco_api/        @imad-handle @AnisBetehi
/packages/hoco_core/       @imad-handle @AnisBetehi
/packages/hoco_offline/    @imad-handle @AnisBetehi
/apps/*/android/           @imad-handle @AnisBetehi
/apps/*/ios/               @imad-handle @AnisBetehi
/.github/                  @imad-handle @AnisBetehi

Replace imad-handle with Imad's GitHub username. An unknown handle is silently ignored by GitHub, so check that review requests actually arrive on the first contract PR.

Secrets

SecretLives inOwnerWho can read it
Local development valuesRoot .env, copied from .env.example, never committedEach developerSelf
hoco CI secrets: Dokploy deploy hooksGitHub Actions secrets of hocoAnisAnis
hoco-mobile CI secrets: upload keystore and passwords, Firebase App Distribution and Play Console service accounts, Sentry auth tokenGitHub Actions secrets of hoco-mobileImadImad, Anis
Runtime secrets per environment: DATABASE_URL, BETTER_AUTH_SECRET, S3 keys, SMTP, SMS API key, Firebase service account, maps keyDokploy, per application and environmentAnisAnis; HOCO's IT contact for production at handover
Master copy of everything above, account passwords, recovery codesShared password-manager vault "HOCO", one collection per audience: Dev (team), Mobile (Imad, Anis), Production (Anis, HOCO IT)AnisPer collection
Android signingPlay App Signing holds the app signing key; the upload key is in the vault and the CI secretImadImad, Anis

Rules:

  • Never in git, chat, email, screenshots or issue text. gitleaks runs on commit (when installed) and on every PR.
  • A leaked secret is rotated first (within the hour), then the leak is cleaned up and the incident noted.
  • One value per environment: no secret is shared between staging, pre-production and production. Production secrets are generated by Anis directly in Dokploy and never stored on a laptop.
  • Each environment has its own BETTER_AUTH_SECRET and cookie prefix, so a staging session never reaches production (ADR-005).
  • SIMULATE_SMS="true" on local and staging (codes are logged). Pre-production and production send real SMS; HOCO's testers use their own phones.
  • Firebase client configuration files (google-services.json, firebase_options*.dart) are identifiers, not secrets: they are committed. Service-account JSON files never are.

Accounts production depends on

Decision proposed: HOCO owns every production account

Cahier §11 (Dépendances externes): « Les frais, comptes, abonnements, limites d’API et délais de validation imposés par les fournisseurs externes doivent être identifiés séparément et validés par le client » (INT-07). The team proposes that every account production depends on is opened in HOCO's name, on a dedicated HOCO-controlled mailbox, and billed to HOCO, with the team invited at the role it needs. To confirm at the cadrage workshop (PRJ-03) and record in the decision register.

AccountOwnerTeam accessNeeded beforeNotes
Domain (hoco.dz is a placeholder) and DNSHOCOAnis: DNS editorOPS-02Registering or delegating a .dz name takes time: start at PRJ-03
Two VPS — production alone; staging and pre-production together (ADR-013)HOCO (billing)Anis: rootOPS-02Provider and country are a decision: Law 18-07 makes transfers of personal data abroad subject to the national authority's authorisation (SEC-08)
Dokploy (self-hosted on those VPS)HOCO, on its serversAnis: adminOPS-02HOCO's IT contact gets an admin user at handover
S3-compatible storage (files, off-site backups)HOCOAnisSRV-07Backups in another location than the database server
Google Play Console — organisation accountHOCOImad: admin (releases); Anis: adminMOB-14Needs a D-U-N-S number and identity verification (can take weeks — start at PRJ-03). A personal account must run a closed test with at least 12 testers for 14 days before it may publish to production
Apple Developer ProgramHOCOImadMOB-16Only if iOS is confirmed (decision D-10)
Firebase projects dev, staging, prod (FCM, App Distribution)HOCO's Google accountImad: editor; Anis: editorMOB-08Create them under HOCO's account from the start — moving projects later is painful
Maps provider (Google Maps proposed, ADR-015)HOCO (billing)Imad, Anis: key managementMOB-10Keys restricted per application id and per server IP
SMS gatewayHOCO (contract with the provider)AnisSRV-05 (OTP)Provider to choose; sender-name approval can take weeks
Transactional email and sender domainHOCOAnisSRV-08SPF, DKIM and DMARC on HOCO's domain
SentryHOCO if a paid plan is neededAnis, ImadMOB-02, OPS-02One project per app and for the server
Uptime monitorTeamAnis, Imad (alerts)OPS-02External check of /health on each environment
Claude DesignTeam (Akram)See accessDES-01Projects handed over or exported (design bundle) at the end, per the contract
GitHub repositoriesTeamSee accessDoneCode handover to HOCO (transfer or escrow) follows the contract — decision register

Onboarding a new member

Day one:

  • Read the overview, this section, the timeline and their own task list in team tasks. Docs writers also read apps/docs/AUTHORING.md.
  • GitHub account with two-factor authentication; invited to the repositories at the role in the access table; CODEOWNERS updated if they own paths.
  • Added to the team WhatsApp group, the calendar invitations of the weekly rhythm, the password-manager collection they need, the Claude Design projects.
  • Mobile developers: Firebase projects, Play Console (internal testing), App Distribution team group.
  • Machine set up from tools: clone, pnpm install, .env, pnpm db:start, pnpm dev all work; a commit with the message wip is rejected by the hook (proof that hooks are installed).

First week:

  • First PR merged within two days — a small docs fix or a fix/ from the backlog — to practise the full flow (branch, commit, PR, review, staging).
  • Walk the decision register and the open issues of their area with Anis (30 min).
  • Shadow one Thursday demo and post stand-up messages from day two.
  • Anis adds them to people in tasks.json with their fte and assigns tasks; the plan recomputes.

Offboarding

  • Open branches and PRs merged, handed over or closed; their tasks reassigned in tasks.json (team), and the plan recomputed.
  • Anything owned in their name is transferred, never forked or copied: repositories (transfer hoco-mobile if Imad leaves), Firebase and Play roles, Claude Design project ownership, Dokploy users.
  • Removed from both repositories, the Claude Design projects, Firebase, Play Console, App Distribution groups, Dokploy, Sentry, the docs-site login, the vault collections, the WhatsApp groups (the client group too) and the calendar invitations.
  • Every secret they could read is rotated: Dokploy runtime secrets of the environments they accessed, CI secrets of their repository, the Android upload key if they held it (reset through Play support), API keys of the providers.
  • CODEOWNERS updated; HOCO informed of the change of contact if they talked to HOCO.

On this page