diff --git a/config/__pycache__/settings.cpython-311.pyc b/config/__pycache__/settings.cpython-311.pyc index 5be02db..a812f44 100644 Binary files a/config/__pycache__/settings.cpython-311.pyc and b/config/__pycache__/settings.cpython-311.pyc differ diff --git a/config/__pycache__/urls.cpython-311.pyc b/config/__pycache__/urls.cpython-311.pyc index 28817aa..1844e1b 100644 Binary files a/config/__pycache__/urls.cpython-311.pyc and b/config/__pycache__/urls.cpython-311.pyc differ diff --git a/config/settings.py b/config/settings.py index 291d043..6ee01d0 100644 --- a/config/settings.py +++ b/config/settings.py @@ -90,6 +90,8 @@ TEMPLATES = [ }, ] +LOGIN_REDIRECT_URL = 'dashboard' + WSGI_APPLICATION = 'config.wsgi.application' diff --git a/config/urls.py b/config/urls.py index bcfc074..270c09c 100644 --- a/config/urls.py +++ b/config/urls.py @@ -22,6 +22,7 @@ from django.conf.urls.static import static urlpatterns = [ path("admin/", admin.site.urls), path("", include("core.urls")), + path("accounts/", include("django.contrib.auth.urls")), ] if settings.DEBUG: diff --git a/core/__pycache__/admin.cpython-311.pyc b/core/__pycache__/admin.cpython-311.pyc index cd6f855..8e77697 100644 Binary files a/core/__pycache__/admin.cpython-311.pyc and b/core/__pycache__/admin.cpython-311.pyc differ diff --git a/core/__pycache__/forms.cpython-311.pyc b/core/__pycache__/forms.cpython-311.pyc new file mode 100644 index 0000000..34f4698 Binary files /dev/null and b/core/__pycache__/forms.cpython-311.pyc differ diff --git a/core/__pycache__/models.cpython-311.pyc b/core/__pycache__/models.cpython-311.pyc index 9aa598b..64eb53a 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..027782f 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..6e6dca4 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..4af32ec 100644 --- a/core/admin.py +++ b/core/admin.py @@ -1,3 +1,5 @@ from django.contrib import admin +from .models import Stock, Profile -# Register your models here. +admin.site.register(Stock) +admin.site.register(Profile) \ No newline at end of file diff --git a/core/forms.py b/core/forms.py new file mode 100644 index 0000000..af1db52 --- /dev/null +++ b/core/forms.py @@ -0,0 +1,5 @@ +from django import forms +from django.contrib.auth.forms import UserCreationForm + +class SignUpForm(UserCreationForm): + email = forms.EmailField(max_length=254, help_text='Required. Inform a valid email address.') diff --git a/core/migrations/0001_initial.py b/core/migrations/0001_initial.py new file mode 100644 index 0000000..afa218d --- /dev/null +++ b/core/migrations/0001_initial.py @@ -0,0 +1,33 @@ +# Generated by Django 5.2.7 on 2026-01-03 16:37 + +import django.db.models.deletion +from django.conf import settings +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + migrations.swappable_dependency(settings.AUTH_USER_MODEL), + ] + + operations = [ + migrations.CreateModel( + name='Stock', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('ticker', models.CharField(max_length=10, unique=True)), + ('name', models.CharField(max_length=100)), + ], + ), + migrations.CreateModel( + name='Profile', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)), + ('watchlist', models.ManyToManyField(blank=True, to='core.stock')), + ], + ), + ] 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..80d6744 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..511d03c 100644 --- a/core/models.py +++ b/core/models.py @@ -1,3 +1,27 @@ from django.db import models +from django.contrib.auth.models import User +from django.db.models.signals import post_save +from django.dispatch import receiver -# Create your models here. +class Stock(models.Model): + ticker = models.CharField(max_length=10, unique=True) + name = models.CharField(max_length=100) + + def __str__(self): + return f'{self.name} ({self.ticker})' + +class Profile(models.Model): + user = models.OneToOneField(User, on_delete=models.CASCADE) + watchlist = models.ManyToManyField(Stock, blank=True) + + def __str__(self): + return f'{self.user.username}\'s Profile' + +@receiver(post_save, sender=User) +def create_user_profile(sender, instance, created, **kwargs): + if created: + Profile.objects.create(user=instance) + +@receiver(post_save, sender=User) +def save_user_profile(sender, instance, **kwargs): + instance.profile.save() \ No newline at end of file diff --git a/core/templates/base.html b/core/templates/base.html index 1e7e5fb..df33f2e 100644 --- a/core/templates/base.html +++ b/core/templates/base.html @@ -1,25 +1,54 @@ - - - {% block title %}Knowledge Base{% endblock %} - {% if project_description %} - - - - {% endif %} - {% if project_image_url %} - - - {% endif %} - {% load static %} - - {% block head %}{% endblock %} + + + {% block title %}Stock Pulse{% endblock %} + + + + + {% load static %} + + - - {% block content %}{% endblock %} + + +
+ {% block content %} + {% endblock %} +
+ + - diff --git a/core/templates/core/dashboard.html b/core/templates/core/dashboard.html new file mode 100644 index 0000000..c7164bb --- /dev/null +++ b/core/templates/core/dashboard.html @@ -0,0 +1,27 @@ +{% extends 'base.html' %} + +{% block title %}Dashboard{% endblock %} + +{% block content %} +
+

My Dashboard

+
+ +
+
+ My Watchlist +
+
+ {% if watchlist %} +
    + {% for stock in watchlist %} +
  • {{ stock.name }} ({{ stock.ticker }})
  • + {% endfor %} +
+ {% else %} +

Your watchlist is empty. Add stocks to get started.

+ {% endif %} +
+
+
+{% endblock %} diff --git a/core/templates/core/index.html b/core/templates/core/index.html index faec813..b1600eb 100644 --- a/core/templates/core/index.html +++ b/core/templates/core/index.html @@ -1,145 +1,13 @@ -{% extends "base.html" %} +{% extends 'base.html' %} -{% block title %}{{ project_name }}{% endblock %} - -{% block head %} - - - - -{% endblock %} +{% block title %}Welcome to Stock Pulse{% 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" }} -

-
-
- +
+

Welcome to Stock Pulse

+

Your personal stock tracking and alert platform.

+
+

Track your favorite stocks, get real-time price alerts, and never miss a market move.

+ Get Started +
{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/login.html b/core/templates/registration/login.html new file mode 100644 index 0000000..5bf4079 --- /dev/null +++ b/core/templates/registration/login.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% block title %}Login{% endblock %} + +{% block content %} +
+
+
+
+

Login

+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/core/templates/registration/signup.html b/core/templates/registration/signup.html new file mode 100644 index 0000000..15eb8b3 --- /dev/null +++ b/core/templates/registration/signup.html @@ -0,0 +1,20 @@ +{% extends "base.html" %} + +{% block title %}Sign Up{% endblock %} + +{% block content %} +
+
+
+
+

Sign Up

+
+ {% csrf_token %} + {{ form.as_p }} + +
+
+
+
+
+{% endblock %} \ No newline at end of file diff --git a/core/urls.py b/core/urls.py index 6299e3d..94acbd2 100644 --- a/core/urls.py +++ b/core/urls.py @@ -1,7 +1,9 @@ from django.urls import path -from .views import home +from .views import home, dashboard, SignUpView urlpatterns = [ path("", home, name="home"), + path("dashboard/", dashboard, name="dashboard"), + path("signup/", SignUpView.as_view(), name="signup"), ] diff --git a/core/views.py b/core/views.py index c9aed12..0f27a69 100644 --- a/core/views.py +++ b/core/views.py @@ -3,23 +3,24 @@ import platform from django import get_version as django_version from django.shortcuts import render -from django.utils import timezone +from django.urls import reverse_lazy +from django.views.generic.edit import CreateView +from django.contrib.auth.decorators import login_required + +from .forms import SignUpForm 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() + return render(request, "core/index.html") + +@login_required +def dashboard(request): + watchlist = request.user.profile.watchlist.all() + return render(request, 'core/dashboard.html', {'watchlist': watchlist}) + +class SignUpView(CreateView): + form_class = SignUpForm + success_url = reverse_lazy("login") + template_name = "registration/signup.html" + - 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) diff --git a/static/css/custom.css b/static/css/custom.css index 925f6ed..2c5c32a 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1,4 +1,55 @@ -/* Custom styles for the application */ -body { - font-family: system-ui, -apple-system, sans-serif; +:root { + --dark-blue: #0A192F; + --slate: #8892B0; + --light-slate: #CCD6F6; + --accent-green: #64FFDA; + --background-light-navy: #0E1F3A; +} + +body { + font-family: 'Inter', sans-serif; + background-color: var(--dark-blue); + color: var(--light-slate); +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Poppins', sans-serif; + color: var(--light-slate); +} + +.bg-dark-2 { + background-color: var(--background-light-navy) !important; +} + +.bg-dark-3 { + background-color: #0A192F !important; + border-bottom: 1px solid #1d2d4a; +} + +.btn-success { + background-color: var(--accent-green); + border-color: var(--accent-green); + color: var(--dark-blue) !important; + font-weight: bold; +} + +.navbar-brand { + font-family: 'Poppins', sans-serif; +} + +.form-control { + background-color: #1d2d4a; + border-color: var(--slate); + color: var(--light-slate); +} + +.form-control:focus { + background-color: #1d2d4a; + border-color: var(--accent-green); + color: var(--light-slate); + box-shadow: 0 0 0 0.25rem rgba(100, 255, 218, 0.25); +} + +.card { + border-color: #1d2d4a; } diff --git a/staticfiles/css/custom.css b/staticfiles/css/custom.css index 108056f..2c5c32a 100644 --- a/staticfiles/css/custom.css +++ b/staticfiles/css/custom.css @@ -1,21 +1,55 @@ - :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); + --dark-blue: #0A192F; + --slate: #8892B0; + --light-slate: #CCD6F6; + --accent-green: #64FFDA; + --background-light-navy: #0E1F3A; } + body { - margin: 0; font-family: 'Inter', sans-serif; - background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end)); - color: var(--text-color); - display: flex; - justify-content: center; - align-items: center; - min-height: 100vh; - text-align: center; - overflow: hidden; - position: relative; + background-color: var(--dark-blue); + color: var(--light-slate); +} + +h1, h2, h3, h4, h5, h6 { + font-family: 'Poppins', sans-serif; + color: var(--light-slate); +} + +.bg-dark-2 { + background-color: var(--background-light-navy) !important; +} + +.bg-dark-3 { + background-color: #0A192F !important; + border-bottom: 1px solid #1d2d4a; +} + +.btn-success { + background-color: var(--accent-green); + border-color: var(--accent-green); + color: var(--dark-blue) !important; + font-weight: bold; +} + +.navbar-brand { + font-family: 'Poppins', sans-serif; +} + +.form-control { + background-color: #1d2d4a; + border-color: var(--slate); + color: var(--light-slate); +} + +.form-control:focus { + background-color: #1d2d4a; + border-color: var(--accent-green); + color: var(--light-slate); + box-shadow: 0 0 0 0.25rem rgba(100, 255, 218, 0.25); +} + +.card { + border-color: #1d2d4a; }