Site Icon Matthew Raynor
← Back to Portfolio

AI Motivational Chatbot

An AI-powered real-time chat interface built to uplift, motivate, and support users through guided messages and mindfulness prompts.

AI Motivational Chatbot

📌 Overview

This web app features a real-time motivational chatbot using Django Channels and OpenAI's GPT-4 API. Designed with accessibility and emotional support in mind, it offers inspiring guidance with markdown-to-HTML formatting and secure WebSocket messaging.

🧩 The Problem

Users lacked an uplifting, real-time interface to ask spiritual, emotional, or motivational questions and receive formatted responses that felt supportive.

💡 The Solution

Built a guided AI chatbot interface that handles live input, streams OpenAI GPT-4 responses, and uses markdown formatting for expressive feedback.

🛠️ Tech Stack

Backend:
Django 5.1.6 Python 3.12 PostgreSQL Docker
Frontend:
Bootstrap 5 Crispy Forms JavaScript WebSocket API
Deployment:
Docker Compose Heroku Whitenoise
Tools:
Channels OpenAI SDK (>=1.0.0) django-environ markdown

✨ Special Features

  • 🌟 Live WebSocket chat powered by Django Channels
  • 🌟 OpenAI GPT-4 Turbo integration with markdown-to-HTML formatting
  • 🌟 Responsive layout with accessibility-focused design choices

🎯 Real-World Problems Solved

  • 🔧 Enabled real-time motivational chat for users seeking support
  • 🔧 Removed latency by using async communication and markdown rendering
  • 🔧 Created a safe space for users to engage with uplifting messages

🚧 Improvements for Next Time

  • 🛠 Add user accounts and saved conversation history
  • 🛠 Integrate voice recognition and text-to-speech for accessibility
  • 🛠 Implement streaming response instead of chunked delivery

🏅 What I'm Proud Of

  • 🌈 Successfully implemented real-time async chat with OpenAI GPT-4
  • 🌈 Handled migration to OpenAI SDK 1.0+ and updated markdown rendering
  • 🌈 Built with performance and spiritual value in mind

📚 Build Notes

Chat interface built with Django Channels, using Redis for pub/sub communication. WebSocket connection gracefully handles disconnects and errors, and the OpenAI SDK 1.0+ interface ensures future-proof API usage.

AI Assistant ×

Hello! How can I assist you today?