diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index a5ed392..2969c45 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 e061640..62f08a5 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 5a69659..9ca7613 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 2a36fd6..e0dfd3a 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..3732d49 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,14 @@ from django.contrib import admin +from .models import Category, Product -# Register your models here. +@admin.register(Category) +class CategoryAdmin(admin.ModelAdmin): + list_display = ('name', 'slug') + prepopulated_fields = {'slug': ('name',)} + +@admin.register(Product) +class ProductAdmin(admin.ModelAdmin): + list_display = ('name', 'category', 'price', 'is_featured') + list_filter = ('category', 'is_featured') + search_fields = ('name', 'description') + prepopulated_fields = {'slug': ('name',)} \ 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..35b0585 --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,41 @@ +# Generated by Django 5.2.7 on 2026-02-07 11:04 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=100)), + ('slug', models.SlugField(unique=True)), + ('icon', models.CharField(default='bi-tag', help_text='Bootstrap icon class', max_length=50)), + ], + options={ + 'verbose_name_plural': 'Categories', + }, + ), + migrations.CreateModel( + name='Product', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=200)), + ('slug', models.SlugField(unique=True)), + ('description', models.TextField()), + ('price', models.DecimalField(decimal_places=2, max_digits=10)), + ('image_url', models.URLField(blank=True, max_length=500)), + ('is_featured', models.BooleanField(default=False)), + ('created_at', models.DateTimeField(auto_now_add=True)), + ('category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='products', to='core.category')), + ], + ), + ] 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..9ed3563 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..51249d7 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,29 @@ from django.db import models +from django.urls import reverse -# Create your models here. +class Category(models.Model): + name = models.CharField(max_length=100) + slug = models.SlugField(unique=True) + icon = models.CharField(max_length=50, help_text="Bootstrap icon class", default="bi-tag") + + class Meta: + verbose_name_plural = "Categories" + + def __str__(self): + return self.name + +class Product(models.Model): + name = models.CharField(max_length=200) + slug = models.SlugField(unique=True) + category = models.ForeignKey(Category, related_name='products', on_delete=models.CASCADE) + description = models.TextField() + price = models.DecimalField(max_digits=10, decimal_places=2) + image_url = models.URLField(max_length=500, blank=True) + is_featured = models.BooleanField(default=False) + created_at = models.DateTimeField(auto_now_add=True) + + def __str__(self): + return self.name + + def get_absolute_url(self): + return reverse('product_detail', args=[self.slug]) diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..07d6c87 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,131 @@ - - - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} - {% load static %} - - {% block head %}{% endblock %} + + + {% block title %}ShinaStore | Futuristic Gaming Gear{% endblock %} + + + + + + + + + + + {% load static %} + + + + {% block head %}{% endblock %} - - {% block content %}{% endblock %} - + - +
+ {% block content %}{% endblock %} +
+ + + + + + \ No newline at end of file diff --git a/core/templates/core/includes/product_card.html b/core/templates/core/includes/product_card.html new file mode 100644 index 0000000..a95d99e --- /dev/null +++ b/core/templates/core/includes/product_card.html @@ -0,0 +1,35 @@ +
+
+ {% if product.is_featured %} + FEATURED + {% endif %} + {% if product.image_url %} + {{ product.name }} + {% else %} +
+ +
+ {% endif %} +
+
+
+
{{ product.name }}
+ ${{ product.price }} +
+

{{ product.description|truncatewords:15 }}

+
+ +
+
+
+ + diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..74c7699 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,127 @@ {% extends "base.html" %} - -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% load static %} {% block content %} -
-
-

Analyzing your requirements and generating your app…

-
- Loading… + +
+
+
+
+

GEAR UP FOR THE FUTURE

+

Experience high-performance marketplace for futuristic tech and gaming gear. Neural peripherals, VR, and RGB-infused hardware.

+ +
+
+
+
+ Future Tech +
+
+
-

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

NEURAL CATALOG

+
+ ALL + {% for cat in categories %} + + {{ cat.name|upper }} + + {% endfor %} +
+
+
+
+
+ + +
+ {% if current_category %} + + {% endif %} +
+
+
+ + + {% if not current_category and not search_query and featured_products %} +
+

FEATURED TECH

+
+ {% for product in featured_products %} +
+ {% include "core/includes/product_card.html" with product=product %} +
+ {% endfor %} +
+
+ {% endif %} + + +
+ {% for product in products %} +
+ {% include "core/includes/product_card.html" with product=product %} +
+ {% empty %} +
+

NO GEAR FOUND IN THIS SECTOR

+ RESET NEURAL SEARCH +
+ {% endfor %} +
+
+ + +{% endblock %} diff --git a/core/urls.py b/core/urls.py index 6299e3d..ac234e7 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,6 @@ from django.urls import path - -from .views import home +from . import views urlpatterns = [ - path("", home, name="home"), -] + path("", views.home, name="home"), +] \ No newline at end of file diff --git a/core/views.py b/core/views.py index c9aed12..c2ad46c 100644 --- a/core/views.py +++ b/core/views.py @@ -1,25 +1,32 @@ import os -import platform - -from django import get_version as django_version -from django.shortcuts import render -from django.utils import timezone - +from django.shortcuts import render, get_object_or_404 +from .models import Category, Product +from django.db.models import Q 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() - + """Render the ShinaStore landing page with products and filters.""" + query = request.GET.get('q') + category_slug = request.GET.get('category') + + categories = Category.objects.all() + products = Product.objects.all() + + if query: + products = products.filter( + Q(name__icontains=query) | Q(description__icontains=query) + ) + + if category_slug: + category = get_object_or_404(Category, slug=category_slug) + products = products.filter(category=category) + + featured_products = Product.objects.filter(is_featured=True)[:4] + 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", ""), + "categories": categories, + "products": products, + "featured_products": featured_products, + "current_category": category_slug, + "search_query": query or "", } - return render(request, "core/index.html", context) + return render(request, "core/index.html", context) \ No newline at end of file diff --git a/seed_data.py b/seed_data.py new file mode 100644 index 0000000..58dc737 --- /dev/null +++ b/seed_data.py @@ -0,0 +1,72 @@ +from core.models import Category, Product + +# Clear existing data +Product.objects.all().delete() +Category.objects.all().delete() + +# Create Categories +categories = [ + {'name': 'VR Headsets', 'slug': 'vr-headsets', 'icon': 'bi-headset-vr'}, + {'name': 'Consoles', 'slug': 'consoles', 'icon': 'bi-controller'}, + {'name': 'Neural Gear', 'slug': 'neural-gear', 'icon': 'bi-cpu'}, + {'name': 'RGB Hardware', 'slug': 'rgb-hardware', 'icon': 'bi-lightning-charge'}, +] + +cat_objs = {} +for cat in categories: + c = Category.objects.create(**cat) + cat_objs[cat['slug']] = c + +# Create Products +products = [ + { + 'name': 'NeuralLink X1', + 'slug': 'neurallink-x1', + 'category': cat_objs['neural-gear'], + 'description': 'Direct brain-to-game interface with zero latency. Experience gaming like never before.', + 'price': 1299.99, + 'image_url': 'https://images.pexels.com/photos/8473479/pexels-photo-8473479.jpeg?auto=compress&cs=tinysrgb&w=800', + 'is_featured': True, + }, + { + 'name': 'HoloVisor Pro', + 'slug': 'holovisor-pro', + 'category': cat_objs['vr-headsets'], + 'description': '8K holographic display with 240Hz refresh rate and wide FOV.', + 'price': 899.99, + 'image_url': 'https://images.pexels.com/photos/3761153/pexels-photo-3761153.jpeg?auto=compress&cs=tinysrgb&w=800', + 'is_featured': True, + }, + { + 'name': 'Quantum Console S', + 'slug': 'quantum-console-s', + 'category': cat_objs['consoles'], + 'description': 'Powered by quantum processing units for instant loading and photorealistic graphics.', + 'price': 499.99, + 'image_url': 'https://images.pexels.com/photos/5947116/pexels-photo-5947116.jpeg?auto=compress&cs=tinysrgb&w=800', + 'is_featured': True, + }, + { + 'name': 'Neon Striker Keyboard', + 'slug': 'neon-striker-keyboard', + 'category': cat_objs['rgb-hardware'], + 'description': 'Mechanical keys with customizable OLED screens and liquid RGB cooling.', + 'price': 249.99, + 'image_url': 'https://images.pexels.com/photos/1779487/pexels-photo-1779487.jpeg?auto=compress&cs=tinysrgb&w=800', + 'is_featured': False, + }, + { + 'name': 'Synapse Controller', + 'slug': 'synapse-controller', + 'category': cat_objs['neural-gear'], + 'description': 'Haptic feedback so precise you can feel the textures of the virtual world.', + 'price': 149.99, + 'image_url': 'https://images.pexels.com/photos/3945657/pexels-photo-3945657.jpeg?auto=compress&cs=tinysrgb&w=800', + 'is_featured': False, + }, +] + +for prod in products: + Product.objects.create(**prod) + +print("Seed data created successfully!")