diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..e1c62a0 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..0abc2fb 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..b79f5a7 100644 Binary files a/core/__pycache__/views.cpython-311.pyc and b/core/__pycache__/views.cpython-311.pyc differ diff --git a/core/models.py b/core/models.py index 71a8362..07b17ee 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,29 @@ from django.db import models -# Create your models here. +class Vendor(models.Model): + name = models.CharField(max_length=255) + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return self.name + +class Invoice(models.Model): + STATUS_CHOICES = [ + ('processed', 'Processed'), + ('pending', 'Pending'), + ('paid', 'Paid'), + ('overdue', 'Overdue'), + ] + + vendor = models.ForeignKey(Vendor, on_delete=models.CASCADE, related_name='invoices') + invoice_number = models.CharField(max_length=255, unique=True) + amount = models.DecimalField(max_digits=10, decimal_places=2) + status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending') + file_path = models.CharField(max_length=1024) + due_date = models.DateField() + created_at = models.DateTimeField(auto_now_add=True) + updated_at = models.DateTimeField(auto_now=True) + + def __str__(self): + return f"Invoice {self.invoice_number} from {self.vendor.name}" \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 788576e..17f90e1 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -2,7 +2,10 @@ - {% block title %}Knowledge Base{% endblock %} + {% block title %}Analytics Dashboard{% endblock %} + + + {% block head %}{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index 0a3f404..c50b79e 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,154 +1,63 @@ {% extends "base.html" %} +{% load static %} -{% block title %}{{ project_name }}{% endblock %} +{% block title %}Analytics Dashboard{% endblock %} {% block head %} -{% if project_description %} - - - -{% endif %} -{% if project_image_url %} - - -{% endif %} - - - - + + + {% endblock %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… -
-

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 +
+
+

Analytics Overview

+
+ +
+
+ +
+
+
+
Total Spend (YTD)
+

${{ total_spend_ytd|floatformat:2 }}

+
+
+
+ + +
+
+
+
Total Invoices Processed
+

{{ total_invoices }}

+
+
+
+ + +
+
+
+
Documents Uploaded
+

{{ documents_uploaded }}

+
+
+
+ + +
+
+
+
Average Invoice Value
+

${{ avg_invoice_value|floatformat:2 }}

+
+
+
+
+ +
+
+{% 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..ca07637 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,18 @@ -import os -import platform - -from django import get_version as django_version from django.shortcuts import render from django.utils import timezone +import decimal - -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() +def index(request): + """Render the main analytics dashboard.""" + # Dummy data for the dashboard cards + total_spend_ytd = decimal.Decimal('125432.50') + total_invoices = 1342 + avg_invoice_value = total_spend_ytd / total_invoices if total_invoices > 0 else 0 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", ""), + 'total_spend_ytd': total_spend_ytd, + 'total_invoices': total_invoices, + 'documents_uploaded': 1500, + 'avg_invoice_value': avg_invoice_value, } - return render(request, "core/index.html", context) + return render(request, 'core/index.html', context) diff --git a/static/css/custom.css b/static/css/custom.css new file mode 100644 index 0000000..1d5d4ec --- /dev/null +++ b/static/css/custom.css @@ -0,0 +1,48 @@ +/* Your custom CSS goes here */ + +body { + background-color: #F6F9FC; + font-family: 'Source Sans Pro', sans-serif; + color: #32325D; +} + +.dashboard-container { + padding: 2rem; +} + +.dashboard-title { + font-family: 'Poppins', sans-serif; + font-weight: 600; + color: #0A2540; +} + +.metric-card { + border: none; + border-radius: 12px; + box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); + background: #FFFFFF; + transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out; +} + +.metric-card:hover { + transform: translateY(-5px); + box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08); +} + +.metric-card .card-body { + padding: 1.5rem; +} + +.metric-card .card-title { + font-family: 'Poppins', sans-serif; + font-size: 1rem; + font-weight: 600; + color: #525f7f; + margin-bottom: 0.5rem; +} + +.metric-card .card-text { + font-size: 2rem; + font-weight: 600; + color: #0A2540; +}