AI & data
React AI Chatbot
A single-page React and Vite chatbot powered by OpenAI’s API, with chat bubbles, keyboard shortcuts and light and dark themes.
- Individual project
01Starting point
Context & mission
The problem
A good chat interface is judged on the details: scrolling, shortcuts, reset, themes.
The mission
Build a pleasant conversation interface around an LLM, focusing on user experience.
My role
Designed and built on my own.
02Execution
What I did
Conversation
Distinct user and assistant bubbles, auto-scroll to the latest message, conversation reset.
Typing comfort
Enter to send, Shift + Enter for a new line.
Themes and behaviour
Light and dark themes; customisable system instructions per use case.
React state
Messages, theme and loading handled with React hooks; code checked with ESLint.
03Design
Architecture
A front-end-only app: the React interface manages the conversation and calls the OpenAI API. For a public deployment, calls would go through a backend such as Chatbot API, which keeps the key server-side.
- React interface
- StateHooks
- OpenAI client
- ReplyAssistant bubble
04Impact
Results
- A polished chat interface, from keyboard shortcut to theme.
05Wrap-up
Takeaways
What this project provesThat I care about the user experience around an LLM, and know the security limit of calling it straight from the browser.
06Technology
Full stack
- React
- JavaScript
- Vite
- CSS
- React Hooks
- ESLint
- OpenAI API