diff --git a/client/src/components/ai-chat.tsx b/client/src/components/ai-chat.tsx index 48427de..0ba4791 100644 --- a/client/src/components/ai-chat.tsx +++ b/client/src/components/ai-chat.tsx @@ -173,11 +173,21 @@ export default function AiChat() {
- - diff --git a/client/src/components/calendar-view.tsx b/client/src/components/calendar-view.tsx index 24fe602..7af2004 100644 --- a/client/src/components/calendar-view.tsx +++ b/client/src/components/calendar-view.tsx @@ -2,14 +2,23 @@ import { useState } from "react"; import { Button } from "@/components/ui/button"; import { ChevronLeft, ChevronRight } from "lucide-react"; import { useQuery } from "@tanstack/react-query"; +import type { ScheduledPost } from "@shared/schema"; export default function CalendarView() { const [currentDate, setCurrentDate] = useState(new Date()); - const { data: scheduledPosts } = useQuery({ + const { data: scheduledPosts = [] } = useQuery({ queryKey: ["/api/scheduled-posts"], }); + const getPostsForDate = (date: Date) => { + return (scheduledPosts || []).filter(post => { + if (!post.scheduledAt) return false; + const postDate = new Date(post.scheduledAt); + return postDate.toDateString() === date.toDateString(); + }); + }; + const goToPreviousMonth = () => { setCurrentDate(new Date(currentDate.getFullYear(), currentDate.getMonth() - 1, 1)); }; @@ -131,45 +140,54 @@ export default function CalendarView() { )}
- {/* Sample events - in real app, filter scheduledPosts by date */} - {day.isCurrentMonth && day.date.getDate() % 7 === 5 && ( -
-
- - 14h - Promo + {/* Real scheduled posts for this date */} + {(() => { + if (!day.isCurrentMonth) return null; + const postsForDay = getPostsForDate(day.date); + if (postsForDay.length === 0) return null; + + return ( +
+ {postsForDay.slice(0, 2).map((post, idx) => { + const time = post.scheduledAt ? new Date(post.scheduledAt).toLocaleTimeString('fr-FR', { hour: '2-digit', minute: '2-digit' }) : ''; + const isPending = !post.publishedAt; + const isPublished = !!post.publishedAt; + + return ( +
+ {time} - {post.postType || 'Post'} +
+ ); + })} + {postsForDay.length > 2 && ( +
+ +{postsForDay.length - 2} autre(s) +
+ )}
-
- )} - - {day.isCurrentMonth && day.date.getDate() % 7 === 0 && ( -
-
- - 10h - Story -
-
- )} + ); + })()}
))} {/* Legend */}
-
-
- Facebook -
-
-
- Instagram -
- Story + Programmé
- Vidéo + Publié
diff --git a/client/src/components/media-upload.tsx b/client/src/components/media-upload.tsx index 7c2bf09..f65dc9c 100644 --- a/client/src/components/media-upload.tsx +++ b/client/src/components/media-upload.tsx @@ -48,7 +48,7 @@ export default function MediaUpload() { } }, []); - const { getRootProps, getInputProps, isDragActive } = useDropzone({ + const { getRootProps, getInputProps, isDragActive, open } = useDropzone({ onDrop, accept: { "image/*": [".png", ".jpg", ".jpeg", ".gif"], @@ -76,7 +76,10 @@ export default function MediaUpload() { Ajoutez des photos ou vidéos, elles seront automatiquement recadrées pour Facebook et Instagram

- diff --git a/docker-compose.yml b/docker-compose.yml index d2f2597..1483697 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,6 +12,8 @@ services: POSTGRES_PASSWORD: ${PGPASSWORD:-changeme} volumes: - postgres_data:/var/lib/postgresql/data + networks: + - internal # Port non exposé sur l'hôte pour plus de sécurité en production # Décommentez la ligne suivante si vous avez besoin d'accéder à la DB localement # ports: @@ -40,6 +42,9 @@ services: APP_URL: ${APP_URL:-http://localhost:5000} volumes: - ./uploads:/app/uploads + networks: + - internal + - nginx_default depends_on: postgres: condition: service_healthy @@ -48,3 +53,12 @@ services: volumes: postgres_data: driver: local + +networks: + # Réseau interne pour la communication DB <-> App + internal: + driver: bridge + + # Réseau externe pour nginx reverse proxy + nginx_default: + external: true