
SNCF SECAFI IA Reseau
Intelligent Assistance Platform for Railway Network
Overview
Context
SNCF SECAFI needed an intelligent internal tool to assist in strategic decision-making, providing estimates and forecasts about future railway network scenarios through artificial intelligence. The system allows employees to make complex queries and obtain predictive analyses based on historical data and identified patterns.
Solution
Complete system with robust REST API in NestJS and modern editable web interface in React. Integration with Chatbase AI for processing complex queries and generating estimates, JWT authentication system, and administrative panel for monitoring conversations and predictions. Fully configurable interface through the API.
My Role
I worked as a Full Stack Developer responsible for all project development. I developed the entire backend API architecture with NestJS, TypeORM, and MySQL, and fully implemented the frontend in React, including all animations and interactions. Only the UI/UX design was provided by the House of Coding team via Figma.
Tech Stack
Frontend
Backend
Projects
SNCF IA Reseau API
NestJS Backend with Editable Interface via API
Robust REST API developed in NestJS with modular architecture. Complete JWT authentication system, integration with Chatbase AI for query processing and estimate generation, and fully editable and configurable interface through API endpoints.
Features
JWT Authentication
Complete system with register/login, refresh tokens, protection guards and Passport strategy
Chatbase AI Integration
Proxy for Chatbase API with conversation management, history and rate limiting
Conversation Monitoring
Complete conversation history with filters, pagination and statistics
Statistics API
Dashboard with usage metrics, conversations by period and active user analysis
Swagger/OpenAPI
Automatic and interactive API documentation with examples
Docker Setup
Complete containerization with MySQL, persistent volumes and isolated network
Design Patterns
Technical Decisions
NestJS vs Express/Fastify
Enterprise-ready structure out-of-the-box, TypeScript first-class, scalable modular architecture, decorators for metaprogramming, native Swagger integration
TypeORM vs Prisma
Decorators for entities, robust migrations, multiple database support, familiar active record pattern, better for complex NestJS projects
JWT vs Session
Stateless, horizontally scalable, no server-side storage required, ideal for REST APIs, refresh tokens for security
Chatbase vs OpenAI Direct
Managed conversation system, specific model training, included rate limiting, built-in metrics, optimized cost
Challenges & Solutions
Chatbase Rate Limiting
Request queue implementation with exponential retry, frequent response cache, fallback messages for timeouts
JWT Token Management
Refresh tokens with rotation, blacklist for revoked tokens, configurable expiration per environment
Conversation Persistence
Optimized schema with indexes, 1:N User-Conversation relationship, soft delete for auditing
Data Validation
DTOs with class-validator, global transform pipes, custom validators for business rules
Docker Development
Docker Compose with hot-reload, volumes for MySQL persistence, isolated network, secure environment variables
SNCF IA Reseau Front
Modern Web Interface with Intelligent Chat
React single-page application with design provided by the House of Coding team via Figma. Modern interface with real-time chat, complete administrative panel, and integrated authentication system. Animations and interactions developed by me.
Features
Chat Interface
Real-time conversational interface with history, typing indicators and markdown rendering
Authentication
Login/register with validation, session persistence, automatic token refresh
Administrative Panel
Dashboard with statistics, user management, conversation viewing and analytics
User Management
Complete CRUD, advanced filters, roles and permissions, data export
Conversation History
Detailed view of all conversations with filters by date, user and content
Notification System
Toasts with Sonner for action feedback and errors
Interactive Tables
TanStack Table with sorting, filtering, pagination and column visibility
Validated Forms
React Hook Form + Zod for robust and type-safe validation
Custom Animations
Smooth transitions, micro-interactions and loading states developed by me
Responsive Design
Adaptive layout for desktop, tablet and mobile based on House of Coding's Figma
Design Patterns
Technical Decisions
React vs Next.js
Pure SPA without SSR need, client-side authentication, simpler deployment, sufficient client-side routing
TanStack Query vs Redux
Specialized in server state, intelligent cache, less boilerplate, automatic invalidation, excellent devtools
shadcn/ui vs Material UI
Copy-paste without heavy dependencies, full customization via Tailwind, Radix accessibility, modern components
React Hook Form + Zod
Superior performance (fewer re-renders), type-safe validation, perfect integration, smaller bundle than Formik
Recharts vs Chart.js
Composable, declarative with React, customization via props, native TypeScript, responsive out-of-the-box
Challenges & Solutions
Figma Design Implementation
Pixel-perfect fidelity to House of Coding's design using Tailwind, consistent color and spacing system, reusable components
Custom Animations
Custom CSS transitions, framer-motion for complex animations, loading skeletons, micro-interactions on buttons and cards
Real-time Chat Experience
Optimized polling with React Query, intelligent auto-scroll, typing indicators, markdown formatting
Token Management
Axios interceptor for automatic refresh, failed request retry, logout on expired token
Performant Tables
Virtualization with TanStack Table, server-side pagination, lazy loading, cell memoization