Back to projects
SNCF SECAFI IA Reseau

SNCF SECAFI IA Reseau

Intelligent Assistance Platform for Railway Network

Role: Full Stack Developer
Period: October - December 2024
Production
Client: SNCF (Société Nationale des Chemins de fer Français)

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

React
TypeScript
Tailwind CSS
shadcn/ui
Radix UI
React Router DOM
TanStack React Query
TanStack Table
React Hook Form
Zod
Recharts
Sonner
Lucide React

Backend

NestJS
TypeScript
TypeORM
MySQL
JWT/Passport
Chatbase AI
class-validator
class-transformer
bcrypt
Swagger
Docker

Projects

1

SNCF IA Reseau API

NestJS Backend with Editable Interface via API

~8,500
Lines of Code
67
Files
7
Modules
3
Entities
15+
DTOs

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

01
JWT Authentication

Complete system with register/login, refresh tokens, protection guards and Passport strategy

02
Chatbase AI Integration

Proxy for Chatbase API with conversation management, history and rate limiting

03
Conversation Monitoring

Complete conversation history with filters, pagination and statistics

04
Statistics API

Dashboard with usage metrics, conversations by period and active user analysis

05
Swagger/OpenAPI

Automatic and interactive API documentation with examples

06
Docker Setup

Complete containerization with MySQL, persistent volumes and isolated network

Design Patterns

Modular Architecture
Repository Pattern
DTO Pattern
Guard Pattern
Exception Filters
Dependency Injection

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

2

SNCF IA Reseau Front

Modern Web Interface with Intelligent Chat

~12,000
Lines of Code
95
Files
48
Components
12
Hooks
8
Pages

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

01
Chat Interface

Real-time conversational interface with history, typing indicators and markdown rendering

02
Authentication

Login/register with validation, session persistence, automatic token refresh

03
Administrative Panel

Dashboard with statistics, user management, conversation viewing and analytics

04
User Management

Complete CRUD, advanced filters, roles and permissions, data export

05
Conversation History

Detailed view of all conversations with filters by date, user and content

06
Notification System

Toasts with Sonner for action feedback and errors

07
Interactive Tables

TanStack Table with sorting, filtering, pagination and column visibility

08
Validated Forms

React Hook Form + Zod for robust and type-safe validation

09
Custom Animations

Smooth transitions, micro-interactions and loading states developed by me

10
Responsive Design

Adaptive layout for desktop, tablet and mobile based on House of Coding's Figma

Design Patterns

Custom Hooks Pattern
React Query Pattern
Form Management
Route Protection
Component Composition
State Management

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

Gallery

1
Image 1
2
Image 2
3
Image 3
4
Image 4
5
Image 5
6
Image 6
Gregory Praxedes | Full Stack Developer & UI/UX Specialist