Application complète SLUC Business Club (React + Express + PostgreSQL, Docker)
Implémente l'intégralité de la maquette « SLUC Business Club.dc.html » : - Site public : accueil (héro administrable, carrousel membres, agenda avec inscription en ligne, rencontres passées, demande d'adhésion), annuaire avec recherche/filtres/fiche détaillée, page association - Espace membre : connexion, édition de fiche avec aperçu direct, upload logo/photo, statut d'adhésion par saison, changement de mot de passe - Espace admin : tableau de bord, membres (validation par saison), rencontres (CRUD + inscrits + impression + export Excel), inscriptions, catégories, contenu du site Architecture : 3 conteneurs Docker Compose — PostgreSQL 16 (réseau interne, rôle applicatif restreint), API Express (non-root, read-only fs), nginx non privilégié (frontend React + reverse-proxy + CSP stricte). Sécurité : requêtes 100 % paramétrées, bcrypt + JWT httpOnly SameSite=Strict, vérification d'Origin (CSRF), validation zod, rate limiting, uploads vérifiés par octets magiques avec noms aléatoires, aucun secret committé. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Fkg15RCxNgUys4ru73He2o
This commit is contained in:
50 files changed
+6887
No files matched your search
@@ -0,0 +1,74 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
const trimmed = (max, min = 0) => z.string().trim().min(min).max(max);
|
||||
|
||||
export const idParam = z.object({ id: z.coerce.number().int().positive() });
|
||||
|
||||
export const loginSchema = z.object({
|
||||
email: trimmed(254, 3).toLowerCase(),
|
||||
password: z.string().min(1).max(200),
|
||||
});
|
||||
|
||||
export const changePasswordSchema = z.object({
|
||||
currentPassword: z.string().min(1).max(200),
|
||||
newPassword: z
|
||||
.string()
|
||||
.min(10, 'au moins 10 caractères')
|
||||
.max(200)
|
||||
.regex(/[a-zA-Z]/, 'doit contenir une lettre')
|
||||
.regex(/[0-9]/, 'doit contenir un chiffre'),
|
||||
});
|
||||
|
||||
export const demandeSchema = z.object({
|
||||
nom: trimmed(120, 1),
|
||||
fonction: trimmed(120).optional().default(''),
|
||||
entreprise: trimmed(120, 1),
|
||||
email: trimmed(254, 3).email(),
|
||||
});
|
||||
|
||||
export const inscriptionPublicSchema = z.object({
|
||||
nom: trimmed(120, 1),
|
||||
entreprise: trimmed(120, 1),
|
||||
email: trimmed(254, 3).email(),
|
||||
tel: trimmed(30).optional().default(''),
|
||||
});
|
||||
|
||||
export const memberProfileSchema = z.object({
|
||||
nom: trimmed(120, 1),
|
||||
secteur: trimmed(120, 1),
|
||||
categorie_id: z.coerce.number().int().positive().nullable().optional(),
|
||||
dirigeant: trimmed(120, 1),
|
||||
email: trimmed(254).email().or(z.literal('')).optional().default(''),
|
||||
tel: trimmed(30).optional().default(''),
|
||||
site: trimmed(200).optional().default(''),
|
||||
presentation: trimmed(2000).optional().default(''),
|
||||
});
|
||||
|
||||
export const adminMemberSchema = memberProfileSchema.extend({
|
||||
valide: z.boolean().optional(),
|
||||
});
|
||||
|
||||
export const rencontreSchema = z.object({
|
||||
titre: trimmed(200, 1),
|
||||
date_renc: z.string().regex(/^\d{4}-\d{2}-\d{2}$/, 'format AAAA-MM-JJ'),
|
||||
heure: trimmed(20).optional().default(''),
|
||||
lieu: trimmed(200).optional().default(''),
|
||||
description: trimmed(2000).optional().default(''),
|
||||
places: z.coerce.number().int().min(0).max(100000),
|
||||
});
|
||||
|
||||
export const inscriptionAdminSchema = z.object({
|
||||
nom: trimmed(120, 1),
|
||||
entreprise: trimmed(120, 1),
|
||||
email: trimmed(254).email().or(z.literal('')).optional().default(''),
|
||||
tel: trimmed(30).optional().default(''),
|
||||
rencontre_id: z.coerce.number().int().positive(),
|
||||
statut: z.enum(['confirmee', 'en_attente']),
|
||||
});
|
||||
|
||||
export const categorySchema = z.object({ name: trimmed(80, 1) });
|
||||
|
||||
export const contentSchema = z.object({
|
||||
hero_quote_text: trimmed(300).optional(),
|
||||
hero_quote_author: trimmed(120).optional(),
|
||||
});
|
||||
Reference in new issue
Block a user