Refonte : AdonisJS 7, nouveau design, forum, discussions, profils et déploiement by BrightkyEfoo · Pull Request #5 · javascriptcm/javascript.cm · GitHub
Skip to content

Refonte : AdonisJS 7, nouveau design, forum, discussions, profils et déploiement - #5

Merged
BrightkyEfoo merged 17 commits into
mainfrom
staging
Oct 8, 2026
Merged

BrightkyEfoo merged 17 commits into
mainfrom
staging

Conversation

@BrightkyEfoo

@BrightkyEfoo BrightkyEfoo commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Résumé

Refonte complète du site : mise à jour de la stack, nouveau design, fonctionnalités terminées, tests et déploiement automatisé. Déployé en staging sur le serveur (staging.javascript.cm, dès que le DNS pointe vers lui).

Stack

  • AdonisJS 6 → 7, Inertia 2 → 3, React 19, Vite 8, TypeScript 6, Node ≥ 24
  • Tailwind CSS 4 compilé (il était chargé depuis un CDN) et design system maison, thèmes clair / sombre
  • MySQL → PostgreSQL 18 (aucune donnée de production à migrer) ; ordre des migrations corrigé
  • Rendu serveur (SSR) activé ; Markdown rendu côté serveur, nettoyé et coloré (Shiki)

Fonctionnalités

  • Articles : brouillons, tags, couverture, likes, commentaires, mise à la une, partage (dont WhatsApp)
  • Forum : canaux, questions / réponses, solution acceptée, épinglage, verrouillage, filtres
  • Discussions : tags, tris, participants
  • Recherche plein texte (articles, forum, discussions), insensible aux accents, au pluriel et à la conjugaison, avec surlignage
  • Notifications dans le site : réponses à vos questions et discussions, commentaires de vos articles, réponse acceptée comme solution
  • Signalements de contenu et file de modération (/admin/signalements), historique conservé même après suppression
  • Membres : annuaire, profils publics /@pseudo, tableau de bord, paramètres (profil, mot de passe, suppression du compte)
  • Administration : rôles, bannissements, gestion des tags et des canaux
  • Connexion GitHub (OAuth) sans dépendance, connexion par e-mail ou pseudo, « rester connecté »
  • Pages À propos et Code de conduite, sitemap, flux RSS, robots.txt (pas d’indexation hors javascript.cm)

Sécurité

  • CSP stricte en production (nonce), CSRF, cookies Secure, redirections post-connexion limitées au site
  • Rate limiting (connexion, publication, actions, aperçu Markdown, recherche)
  • Rendu Markdown dans un worker avec budget de temps : aucune entrée ne peut bloquer le serveur ; contenu nettoyé (pas de HTML brut, pas de javascript:)
  • Droits vérifiés (auteur / modérateur / admin) sur chaque action, rangs respectés, brouillons invisibles des autres membres
  • Changement de mot de passe : déconnexion des autres appareils ; liaison GitHub uniquement sur e-mail vérifié
  • Les e-mails ne sont jamais exposés publiquement

Qualité

  • 72 tests (Japa) : authentification, CSRF, XSS, articles, forum, recherche, notifications, signalements, régressions de sécurité
  • CI GitHub Actions : typecheck, tests (PostgreSQL), build ; déploiement automatique de la branche staging
  • Lighthouse mobile : performance 96–97, accessibilité 100, bonnes pratiques 100

Déploiement

Docker Compose (app + PostgreSQL) derrière Caddy, voir deploy/ et le README. Migrations et seeders idempotents au démarrage du conteneur ; contenu de démonstration fictif uniquement si SEED_DEMO=true (staging). Sauvegarde PostgreSQL chaque nuit, rotation 14 jours.

Après la fusion

  • Pointer staging.javascript.cm vers le serveur (enregistrement A → 169.58.106.105)
  • Créer l’OAuth App GitHub et renseigner GITHUB_CLIENT_ID / GITHUB_CLIENT_SECRET
  • Mettre en place la production (domaine javascript.cm, sans SEED_DEMO)

- Rebuild on the AdonisJS 7 Inertia/React starter (Inertia 3, Vite 8, React 19.3)
- Switch to PostgreSQL; full schema for articles, tags, forum channels/threads,
  discussions, replies, likes and rate limits; fix migration ordering
- Self-hosted GitHub OAuth (Ally has no AdonisJS 7 release), login by e-mail or
  username, remember-me, rate-limited auth, safe post-login redirects
- Markdown pipeline (GFM, sanitize, Shiki dual theme) rendered server-side
- Tailwind 4 design system: paper/ink tokens, JS-yellow accent, Bricolage
  Grotesque + JetBrains Mono, light/dark themes, SSR enabled
- New home page, auth pages, error pages, shared UI components
- robots.txt (noindex outside production), sitemap.xml, RSS feed
- /articles with tag filter, search, popular sort, featured lead and tag index
- Reading page with byline, cover, share links (incl. WhatsApp), author card,
  likes, comments and related articles; schema.org Article data
- Shared create/edit form: tags (max 4), cover (https only), Markdown editor,
  publish or save as draft; drafts visible to their author and moderators only
- Moderators can feature articles; views counted once per session
- Forum: channels, status filters (unanswered/unsolved/solved), search,
  accepted solutions, pinned and locked threads, similar questions
- Discussions: tags, sorts, participants, pinned and locked conversations
- Owner/moderator authorization on every mutation, views once per session
- Members directory and public /@username profiles with stats and tabs
- Dashboard: drafts, questions awaiting a solution, activity on my content
- Settings: profile, password, account deletion
- Admin (moderators/admins): overview, member roles and bans, tags and
  forum channels management
- Dockerfile (multi-stage, Node 24), docker-compose with PostgreSQL 18,
  entrypoint running migrations and idempotent seeders, /up health check
- Caddy config and deploy script for staging.javascript.cm; GitHub Actions
  workflow: typecheck, tests, build, then SSH deploy on the staging branch
- Production CSP with nonce, trusted proxy for real client IPs, relaxed
  rate limits outside production, banned members signed out everywhere
- Shared reply infrastructure (edit, delete, like) and UI components
- About and code of conduct pages; SSR serializes page props like the client
- Unit and functional tests (auth, CSRF, XSS, articles, forum)
- ESLint config tuned to the project conventions; README rewritten
From a security review of the new code:
- Render markdown in a worker thread with a 5 s budget, and reject bodies
  saturated with emphasis markers up front: some inputs make CommonMark
  parsing quadratic and could freeze the server for tens of seconds
- Make excerpt and reading-time helpers linear (truncate first, bounded
  patterns, line-based code fence stripping); they run on every page view
- Only auto-link a GitHub login to an existing account whose e-mail is
  verified; GitHub-created accounts are verified, changing the e-mail
  clears the verification
- Never write multipart bodies to disk (no upload feature), cap request
  bodies at 1 MB in Caddy
- Rate-limit edits, likes, solutions, pin/lock, settings and the preview
- Hide comments of unpublished articles from profiles and the dashboard;
  only the author can publish their draft
- Count replies correctly under concurrent deletes; double-clicking a like
  no longer returns a 500
- CI deploy job is skipped with a warning when secrets are not configured
- Moderators can edit or delete members' content, never other staff
  members' (admins keep full rights); drafts stay visible to the staff
- Changing the password bumps a per-user session version: sessions opened
  before the change are signed out on their next request
The hero copy is the largest contentful paint: animating its opacity
from 0 delayed LCP by several seconds on slow devices.
- French full-text GIN indexes on articles, threads and discussions
- notifications and reports tables with typed enums, models
- Unread notifications count shared with every page; search and
  notifications entries in the navigation (theme toggle moves into the
  mobile menu on small screens)
- /recherche across articles, questions and discussions: stemming,
  accent folding (unaccent), weighted titles, recency boost, phrase /
  exclusion / OR syntax, prefix fallback, tabs with counts, pagination
- Snippets highlighted with ts_headline and rebuilt server-side so only
  <mark> survives (no XSS through member content)
- Drafts and banned members' content are never returned; rate-limited
- Authors and earlier participants are notified of new replies, article
  authors and commenters of new comments, answerers when their reply is
  accepted; unread notifications on the same subject are coalesced
- /notifications grouped by recency, links land on the exact reply and
  mark it read; opening the content also reads its notifications
- Unread badge on the bell and in the member workspace; ace command to
  prune old read notifications
- Members report questions, discussions, articles and replies (spam,
  abuse, off-topic, other); one open report per member and content,
  enforced by a partial unique index
- /admin/signalements groups reports by content with resolve, dismiss and
  delete actions respecting staff ranks; history survives deletion thanks
  to target snapshots
- Staff see the open reports count in every admin page
- Each flash toast gets its own id so a new one is not dismissed with the
  previous one
- Destructive menu items are red as intended
@BrightkyEfoo
BrightkyEfoo marked this pull request as ready for review October 8, 2026 07:38
@BrightkyEfoo
BrightkyEfoo merged commit ae78cf1 into main Oct 8, 2026
4 checks passed

This branch was successfully deployed

1 active deployment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant