Skip to content

Latest commit

Β 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– React Chatbot

A simple and clean chat interface built with React 19. Type a message and get an instant response from an AI-powered chatbot, with smooth auto-scroll and a minimal UI.

Live demo: vscrm.github.io/React-Chatbot


✨ Features

  • Real-time chat with an AI chatbot powered by the supersimpledev package
  • Distinct UI layout for user and bot messages with avatars
  • Auto-scroll to the latest message on every update
  • Send messages via the Send button or by pressing Enter
  • Clean, minimal interface with responsive layout

πŸš€ Tech Stack

Technology Version Purpose
React 19 UI library and component state management
Vite 8 Build tool and dev server with HMR
supersimpledev 8.x AI chatbot engine (Chatbot.getResponse())
gh-pages 6.x Automated deployment to GitHub Pages from the dist folder
ESLint 10 Code linting with React Hooks and React Refresh plugins

πŸ—οΈ Project Structure

React-Chatbot/
β”œβ”€β”€ public/
β”‚   └── Logo.svg
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ assets/
β”‚   β”‚   β”œβ”€β”€ robot.png              # Bot avatar
β”‚   β”‚   └── user.png               # User avatar
β”‚   β”œβ”€β”€ components/
β”‚   β”‚   └── chats/
β”‚   β”‚       β”œβ”€β”€ ChatInput.jsx      # Text input + Send button, calls Chatbot.getResponse()
β”‚   β”‚       β”œβ”€β”€ ChatInput.css
β”‚   β”‚       β”œβ”€β”€ ChatMessage.jsx    # Single message bubble with avatar
β”‚   β”‚       β”œβ”€β”€ ChatMessage.css
β”‚   β”‚       β”œβ”€β”€ ChatMessages.jsx   # Scrollable message list with auto-scroll
β”‚   β”‚       └── ChatMessages.css
β”‚   β”œβ”€β”€ App.jsx                    # Root component, holds chatMessages state
β”‚   β”œβ”€β”€ App.css
β”‚   β”œβ”€β”€ index.css                  # Global styles
β”‚   └── main.jsx                   # Entry point
β”œβ”€β”€ .gitignore
β”œβ”€β”€ eslint.config.js
β”œβ”€β”€ index.html
β”œβ”€β”€ LICENSE
β”œβ”€β”€ package-lock.json
β”œβ”€β”€ package.json
β”œβ”€β”€ README.md
└── vite.config.js                 # Build config with base path for GitHub Pages

βš™οΈ How It Works

  1. The user types a message in ChatInput and presses Send or Enter
  2. The message is added to chatMessages state in App.jsx as { sender: 'user', ... }
  3. Chatbot.getResponse(inputText) from the supersimpledev package is called synchronously
  4. The bot response is appended to chatMessages as { sender: 'robot', ... }
  5. ChatMessages uses a useRef + useEffect to auto-scroll to the bottom on every update
  6. Each message is rendered by ChatMessage, which picks the correct avatar based on sender

πŸ› οΈ Getting Started

# Install dependencies
npm install

# Start dev server
npm run dev

# Build for production
npm run build

# Deploy to GitHub Pages
npm run deploy

🌐 Deployment

The app is deployed to GitHub Pages via the gh-pages package.

npm run deploy
# Builds the project and pushes /dist to the gh-pages branch automatically

vite.config.js is configured with base: '/React-Chatbot/' to match the GitHub Pages URL structure.


πŸ™ Acknowledgements

This project was built while following the SuperSimpleDev React course β€” a practical, beginner-friendly guide to learning modern React from scratch.

Thank you to SuperSimpleDev for the open-source materials and the supersimpledev npm package that powers the chatbot engine in this project. πŸ™


πŸ“„ License

License: MIT

About

πŸ€– React chatbot SPA built with React 19 and Vite. Powered by supersimpledev chatbot engine.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages