A Matrix-themed AI chatbot with a retro terminal aesthetic. Built with React + TypeScript and powered by n8n workflow automation.
Live Demo: https://nit-chatbot.vercel.app
- Matrix-inspired UI - Green-on-black terminal interface with CRT screen effects
- Matrix Rain Animation - Falling characters background effect
- Typewriter Text - Animated text output for bot responses
- AI-Powered Responses - Connected to n8n workflow with OpenAI integration
- Responsive Design - Works on desktop and mobile devices
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ React Frontend │────▶│ Vercel Python │────▶│ n8n Webhook │
│ (Vite + TS) │ │ Serverless │ │ (Cloud/Local) │
└─────────────────┘ └──────────────────┘ └────────┬────────┘
│
▼
┌─────────────────┐
│ OpenAI API │
│ (GPT Model) │
└─────────────────┘
| Component | Description |
|---|---|
| Frontend | React 19 + TypeScript + Vite |
| Backend | Vercel Python Serverless Function |
| Workflow | n8n with Webhook trigger + LLM Chain |
| AI Model | OpenAI GPT via n8n |
nit-chatbot/
├── api/
│ └── chat.py # Vercel serverless function
├── src/
│ ├── components/
│ │ ├── ChatWindow/ # Message display area
│ │ ├── InputField/ # User input with terminal prompt
│ │ ├── Terminal/ # Terminal window wrapper
│ │ ├── MatrixRain/ # Falling characters animation
│ │ ├── CRTOverlay/ # CRT screen effect
│ │ ├── TypewriterText/ # Animated text output
│ │ └── LoadingIndicator/# Loading animation
│ ├── hooks/
│ │ ├── useChat.ts # Chat state management
│ │ ├── useAutoScroll.ts # Auto-scroll on new messages
│ │ └── useTypewriter.ts # Typewriter animation logic
│ ├── services/
│ │ ├── api.ts # API communication
│ │ └── mockApi.ts # Mock responses for testing
│ ├── App.tsx # Main application component
│ └── main.tsx # React entry point
├── server.py # Local Flask dev server
├── vercel.json # Vercel configuration
└── package.json # Node dependencies
- User sends a message via the terminal input
- Frontend calls
/api/chatendpoint with the message - Vercel serverless function receives the request
- Function calls n8n webhook with the message as a parameter
- n8n workflow processes the message:
- Webhook receives the request
- Basic LLM Chain sends message to OpenAI
- Response is returned via Respond to Webhook node
- Response flows back through the chain to the frontend
- Typewriter effect displays the bot's response
- Node.js 18+
- Python 3.12+
- n8n account (cloud or self-hosted)
- OpenAI API key (configured in n8n)
-
Clone the repository
git clone https://github.com/massimotodaro/matrix-chatbot.git cd matrix-chatbot -
Install dependencies
npm install pip install flask flask-cors requests
-
Configure local environment
Create
.env.local:VITE_API_URL=http://localhost:8000 -
Update
server.pywith your n8n webhook URL:N8N_WEBHOOK = "http://localhost:5678/webhook/your-webhook-id"
-
Start the servers
# Terminal 1: Flask backend python server.py # Terminal 2: React frontend npm run dev
-
Push to GitHub
-
Deploy to Vercel
vercel --prod
-
Set environment variable in Vercel dashboard:
N8N_WEBHOOK_URL=https://your-n8n.app.n8n.cloud/webhook/your-webhook-id
- Create a new workflow in n8n
- Add nodes:
- Webhook (GET method) - Trigger
- Basic LLM Chain - Process message
- OpenAI Chat Model - AI model (connected to LLM Chain)
- Respond to Webhook - Return response
- Configure OpenAI credentials
- Publish the workflow (important!)
- Copy the Production URL from the Webhook node
| Variable | Environment | Description |
|---|---|---|
N8N_WEBHOOK_URL |
Vercel (Production) | n8n webhook URL |
VITE_API_URL |
Local Development | Backend URL (default: empty for relative) |
- Frontend: React 19, TypeScript, Vite 7
- Backend: Python, Vercel Serverless Functions
- Styling: CSS with custom Matrix theme
- Automation: n8n workflow
- AI: OpenAI GPT via n8n
- Hosting: Vercel
Send a message to the chatbot.
Request:
{
"message": "Hello, how are you?"
}Response:
{
"reply": "Hello! I'm doing well. How can I assist you today?"
}| Aspect | Local | Production |
|---|---|---|
| Frontend | npm run dev (Vite) |
Vercel CDN |
| Backend | server.py (Flask) |
api/chat.py (Serverless) |
| n8n | localhost:5678 (Docker) | n8n Cloud |
| URL | localhost:5173 | nit-chatbot.vercel.app |
MIT
Built with React + TypeScript + n8n