Modèle de Données : Ajout de la table AnalyticsEvent dans prisma/schema.prisma pour suivre les vues de pages, les clics et le temps de rétention (DWELL_TIME). API Backend : Création de la route app/api/analytics/route.ts pour enregistrer les événements en base de données. Tracking Client : Création du composant AnalyticsTracker.tsx (intégré dans le layout principal) qui capture automatiquement : Le changement de page (Page Views). Les clics sur les boutons et liens importants. Le temps passé sur chaque page. 2. Intégration Base de Données (PostgreSQL/Prisma) Fiches Entreprises : Mise à jour de app/directory/[id]/page.tsx pour récupérer les données réelles depuis PostgreSQL via Prisma au lieu d'utiliser les données de test (mockData). Navigation Dashboard : Correction du bouton "Voir ma fiche" dans le tableau de bord pour qu'il redirige correctement vers le profil public de l'entrepreneur. 3. Administration & Metrics Nouvelle Application Admin : Initialisation d'un dossier admin/ (application Next.js séparée) destinée à la gestion de la plateforme et à la visualisation des statistiques (Metrics & Analytics). 4. Authentification & Inscription Nouvelle Page : Création de app/register/page.tsx pour permettre l'inscription des nouveaux utilisateurs. Gestion de Session : Amélioration de UserProvider.tsx pour une meilleure gestion de l'état utilisateur à travers l'application. 5. Maintenance & Types Mise à jour des types globaux dans types.ts et rafraîchissement du package-lock.json suite à l'ajout de dépendances.
105 lines
2.0 KiB
TypeScript
105 lines
2.0 KiB
TypeScript
|
|
export enum UserRole {
|
|
VISITOR = 'VISITOR',
|
|
ENTREPRENEUR = 'ENTREPRENEUR',
|
|
ADMIN = 'ADMIN'
|
|
}
|
|
|
|
export interface User {
|
|
id: string;
|
|
name: string;
|
|
email: string;
|
|
role: UserRole;
|
|
avatar?: string;
|
|
}
|
|
|
|
export interface SocialLinks {
|
|
facebook?: string;
|
|
linkedin?: string;
|
|
instagram?: string;
|
|
website?: string;
|
|
}
|
|
|
|
export interface Business {
|
|
id: string;
|
|
ownerId: string;
|
|
name: string;
|
|
category: string;
|
|
location: string; // City, Country
|
|
description: string;
|
|
logoUrl: string;
|
|
videoUrl?: string; // YouTube/Vimeo link
|
|
socialLinks?: SocialLinks;
|
|
contactEmail: string;
|
|
contactPhone?: string;
|
|
verified: boolean;
|
|
viewCount: number;
|
|
rating: number;
|
|
tags: string[];
|
|
|
|
// New fields for "Entrepreneur of the Month"
|
|
isFeatured?: boolean;
|
|
founderName?: string;
|
|
founderImageUrl?: string;
|
|
keyMetric?: string; // "3000 clients delivered"
|
|
offers?: Offer[]; // Joined from database or from mocks
|
|
}
|
|
|
|
export enum OfferType {
|
|
PRODUCT = 'PRODUCT',
|
|
SERVICE = 'SERVICE'
|
|
}
|
|
|
|
export interface Offer {
|
|
id: string;
|
|
businessId: string;
|
|
title: string;
|
|
type: OfferType;
|
|
price: number;
|
|
currency: 'EUR' | 'XOF';
|
|
description?: string;
|
|
imageUrl: string;
|
|
active: boolean;
|
|
}
|
|
|
|
export interface BlogPost {
|
|
id: string;
|
|
title: string;
|
|
excerpt: string;
|
|
content: string;
|
|
author: string;
|
|
date: string;
|
|
imageUrl: string;
|
|
}
|
|
|
|
export enum InterviewType {
|
|
VIDEO = 'VIDEO',
|
|
ARTICLE = 'ARTICLE'
|
|
}
|
|
|
|
export interface Interview {
|
|
id: string;
|
|
title: string;
|
|
guestName: string;
|
|
companyName: string;
|
|
role: string;
|
|
type: InterviewType;
|
|
thumbnailUrl: string;
|
|
videoUrl?: string;
|
|
content?: string;
|
|
excerpt: string;
|
|
date: string;
|
|
duration?: string; // e.g. "15 min" or "5 min de lecture"
|
|
}
|
|
|
|
export const CATEGORIES = [
|
|
"Technologie & IT",
|
|
"Agriculture & Agrobusiness",
|
|
"Mode & Textile",
|
|
"Cosmétique & Beauté",
|
|
"Services aux entreprises",
|
|
"Restauration & Alimentation",
|
|
"Construction & BTP",
|
|
"Éducation & Formation"
|
|
];
|