diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..282e691 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..a2a14ad 100644 Binary files a/core/__pycache__/models.cpython-311.pyc and b/core/__pycache__/models.cpython-311.pyc differ diff --git a/core/__pycache__/urls.cpython-311.pyc b/core/__pycache__/urls.cpython-311.pyc index 1f807fa..f8b00c5 100644 Binary files a/core/__pycache__/urls.cpython-311.pyc and b/core/__pycache__/urls.cpython-311.pyc differ diff --git a/core/__pycache__/views.cpython-311.pyc b/core/__pycache__/views.cpython-311.pyc index 6867ddf..a6d350c 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/admin.py b/core/admin.py index 8c38f3f..165c7fa 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,4 @@ from django.contrib import admin +from .models import ChatMessage -# Register your models here. +admin.site.register(ChatMessage) \ No newline at end of file diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..824654e --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,23 @@ +# Generated by Django 5.2.7 on 2025-12-06 05:19 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='ChatMessage', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('sender', models.CharField(choices=[('user', 'User'), ('bot', 'Bot')], max_length=10)), + ('message', models.TextField()), + ('timestamp', models.DateTimeField(auto_now_add=True)), + ], + ), + ] diff --git a/core/migrations/__pycache__/0001_initial.cpython-311.pyc b/core/migrations/__pycache__/0001_initial.cpython-311.pyc new file mode 100644 index 0000000..f51ae03 Binary files /dev/null and b/core/migrations/__pycache__/0001_initial.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..11d75cf 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,13 @@ from django.db import models -# Create your models here. +class ChatMessage(models.Model): + SENDER_CHOICES = [ + ('user', 'User'), + ('bot', 'Bot'), + ] + sender = models.CharField(max_length=10, choices=SENDER_CHOICES) + message = models.TextField() + timestamp = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return f'{self.get_sender_display()}: {self.message}' \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..5962a87 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -14,7 +14,10 @@ {% endif %} {% load static %} - + + + + {% block head %}{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..da82f46 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,41 @@ -{% extends "base.html" %} +{% extends 'base.html' %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - +{% block title %} +AI Chatbot {% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… +
+
+

AI Powered Customer Support

+

Our AI chatbot is here to help you 24/7 with your questions and complaints.

+ Start a Conversation
-

AppWizzy AI is collecting your requirements and applying the first changes.

-

This page will refresh automatically as the plan is implemented.

-

- Runtime: Django {{ django_version }} · Python {{ python_version }} - — UTC {{ current_time|date:"Y-m-d H:i:s" }} -

-
-
- -{% endblock %} \ No newline at end of file + + +
+
+ {% for msg in messages %} +
+
+ {{ msg.message }} +
+
+ {% endfor %} +
+
+
+ {% csrf_token %} +
+ + +
+
+
+
+{% endblock %} + +{% block extra_css %} + +{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..8e0d0ae 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,7 @@ from django.urls import path -from .views import home +from .views import index urlpatterns = [ - path("", home, name="home"), + path("", index, name="index"), ] diff --git a/core/views.py b/core/views.py index c9aed12..e037eba 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,14 @@ -import os -import platform +from django.shortcuts import render, redirect +from .models import ChatMessage -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone +def index(request): + if request.method == 'POST': + message = request.POST.get('message') + if message: + ChatMessage.objects.create(sender='user', message=message) + # Canned response from the bot + ChatMessage.objects.create(sender='bot', message='Thank you for your message. An agent will be with you shortly.') + return redirect('index') - -def home(request): - """Render the landing screen with loader and environment details.""" - host_name = request.get_host().lower() - agent_brand = "AppWizzy" if host_name == "appwizzy.com" else "Flatlogic" - now = timezone.now() - - context = { - "project_name": "New Style", - "agent_brand": agent_brand, - "django_version": django_version(), - "python_version": platform.python_version(), - "current_time": now, - "host_name": host_name, - "project_description": os.getenv("PROJECT_DESCRIPTION", ""), - "project_image_url": os.getenv("PROJECT_IMAGE_URL", ""), - } - return render(request, "core/index.html", context) + messages = ChatMessage.objects.all().order_by('timestamp') + return render(request, 'core/index.html', {'messages': messages}) \ No newline at end of file diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..1bd6a51 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,73 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --primary-color: #4F46E5; + --secondary-color: #10B981; + --accent-color: #F59E0B; + --neutral-background: #F3F4F6; + --text-color: #111827; } + +body { + font-family: 'Inter', sans-serif; + background-color: var(--neutral-background); + color: var(--text-color); +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Poppins', sans-serif; +} + +.hero { + background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); + color: white; + padding: 100px 0; + text-align: center; +} + +.chat-widget { + max-width: 800px; + margin: 50px auto; + border: 1px solid #ddd; + border-radius: 10px; + overflow: hidden; + background-color: white; +} + +.chat-history { + height: 400px; + overflow-y: auto; + padding: 20px; +} + +.chat-message { + margin-bottom: 20px; +} + +.user-message { + text-align: right; +} + +.bot-message { + text-align: left; +} + +.message-bubble { + display: inline-block; + padding: 10px 15px; + border-radius: 20px; + max-width: 70%; +} + +.user-message .message-bubble { + background-color: var(--primary-color); + color: white; +} + +.bot-message .message-bubble { + background-color: #E5E7EB; + color: var(--text-color); +} + +.chat-input { + border-top: 1px solid #ddd; + padding: 20px; +} \ No newline at end of file diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..1bd6a51 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,73 @@ - :root { - --bg-color-start: #6a11cb; - --bg-color-end: #2575fc; - --text-color: #ffffff; - --card-bg-color: rgba(255, 255, 255, 0.01); - --card-border-color: rgba(255, 255, 255, 0.1); + --primary-color: #4F46E5; + --secondary-color: #10B981; + --accent-color: #F59E0B; + --neutral-background: #F3F4F6; + --text-color: #111827; } + body { - margin: 0; font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); + background-color: var(--neutral-background); color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; } + +h1, h2, h3, h4, h5, h6 { + font-family: 'Poppins', sans-serif; +} + +.hero { + background: linear-gradient(135deg, var(--primary-color), var(--secondary-color)); + color: white; + padding: 100px 0; + text-align: center; +} + +.chat-widget { + max-width: 800px; + margin: 50px auto; + border: 1px solid #ddd; + border-radius: 10px; + overflow: hidden; + background-color: white; +} + +.chat-history { + height: 400px; + overflow-y: auto; + padding: 20px; +} + +.chat-message { + margin-bottom: 20px; +} + +.user-message { + text-align: right; +} + +.bot-message { + text-align: left; +} + +.message-bubble { + display: inline-block; + padding: 10px 15px; + border-radius: 20px; + max-width: 70%; +} + +.user-message .message-bubble { + background-color: var(--primary-color); + color: white; +} + +.bot-message .message-bubble { + background-color: #E5E7EB; + color: var(--text-color); +} + +.chat-input { + border-top: 1px solid #ddd; + padding: 20px; +} \ No newline at end of file