diff --git a/PROJECT/src/src/REQUIREMENTS.txt b/PROJECT/src/src/REQUIREMENTS.txt new file mode 100644 index 0000000..51e5b3a Binary files /dev/null and b/PROJECT/src/src/REQUIREMENTS.txt differ diff --git a/PROJECT/src/src/apps/dashboard/__init__.py b/PROJECT/src/src/apps/dashboard/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/src/src/apps/dashboard/__pycache__/__init__.cpython-311.pyc b/PROJECT/src/src/apps/dashboard/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..df70ccb Binary files /dev/null and b/PROJECT/src/src/apps/dashboard/__pycache__/__init__.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/dashboard/__pycache__/admin.cpython-311.pyc b/PROJECT/src/src/apps/dashboard/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..b106e66 Binary files /dev/null and b/PROJECT/src/src/apps/dashboard/__pycache__/admin.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/dashboard/__pycache__/apps.cpython-311.pyc b/PROJECT/src/src/apps/dashboard/__pycache__/apps.cpython-311.pyc new file mode 100644 index 0000000..49da086 Binary files /dev/null and b/PROJECT/src/src/apps/dashboard/__pycache__/apps.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/dashboard/__pycache__/models.cpython-311.pyc b/PROJECT/src/src/apps/dashboard/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..9204e4e Binary files /dev/null and b/PROJECT/src/src/apps/dashboard/__pycache__/models.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/dashboard/__pycache__/views.cpython-311.pyc b/PROJECT/src/src/apps/dashboard/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..d9bdaf3 Binary files /dev/null and b/PROJECT/src/src/apps/dashboard/__pycache__/views.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/dashboard/admin.py b/PROJECT/src/src/apps/dashboard/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/PROJECT/src/src/apps/dashboard/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/PROJECT/src/src/apps/dashboard/apps.py b/PROJECT/src/src/apps/dashboard/apps.py new file mode 100644 index 0000000..7bf130c --- /dev/null +++ b/PROJECT/src/src/apps/dashboard/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class DashboardConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'apps.dashboard' diff --git a/PROJECT/src/src/apps/dashboard/migrations/__init__.py b/PROJECT/src/src/apps/dashboard/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/src/src/apps/dashboard/migrations/__pycache__/__init__.cpython-311.pyc b/PROJECT/src/src/apps/dashboard/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..c427bac Binary files /dev/null and b/PROJECT/src/src/apps/dashboard/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/dashboard/models.py b/PROJECT/src/src/apps/dashboard/models.py new file mode 100644 index 0000000..78aba67 --- /dev/null +++ b/PROJECT/src/src/apps/dashboard/models.py @@ -0,0 +1,22 @@ +from django.db import models +from django.contrib.auth.hashers import make_password + + +# Create your models here. +class ProductTable(models.Model): + username = models.CharField(max_length=255) + product_name = models.CharField(max_length=255) + price = models.DecimalField(max_digits=10, decimal_places=2) + amount = models.IntegerField() + +class UserTable(models.Model): + id = models.IntegerField(primary_key=True) + name = models.CharField(max_length=255) + email = models.EmailField() + password = models.CharField(max_length=255) + +# Function to protect the password + def save(self, *args, **kwargs): + if not self.pk: # Apenas ao criar um novo usuário + self.password = make_password(self.password) + super().save(*args, **kwargs) \ No newline at end of file diff --git a/PROJECT/src/src/apps/dashboard/tests.py b/PROJECT/src/src/apps/dashboard/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/PROJECT/src/src/apps/dashboard/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/PROJECT/src/src/apps/dashboard/views.py b/PROJECT/src/src/apps/dashboard/views.py new file mode 100644 index 0000000..9f89532 --- /dev/null +++ b/PROJECT/src/src/apps/dashboard/views.py @@ -0,0 +1,6 @@ +from django.shortcuts import render + +# Create your views here. + +def dashboard_view(request): + return render(request, "dashboard/dashboard.html", {}) \ No newline at end of file diff --git a/PROJECT/src/src/apps/homepage/__init__.py b/PROJECT/src/src/apps/homepage/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/src/src/apps/homepage/__pycache__/__init__.cpython-311.pyc b/PROJECT/src/src/apps/homepage/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..28ab099 Binary files /dev/null and b/PROJECT/src/src/apps/homepage/__pycache__/__init__.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/homepage/__pycache__/admin.cpython-311.pyc b/PROJECT/src/src/apps/homepage/__pycache__/admin.cpython-311.pyc new file mode 100644 index 0000000..57a0f5e Binary files /dev/null and b/PROJECT/src/src/apps/homepage/__pycache__/admin.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/homepage/__pycache__/apps.cpython-311.pyc b/PROJECT/src/src/apps/homepage/__pycache__/apps.cpython-311.pyc new file mode 100644 index 0000000..dcc9122 Binary files /dev/null and b/PROJECT/src/src/apps/homepage/__pycache__/apps.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/homepage/__pycache__/models.cpython-311.pyc b/PROJECT/src/src/apps/homepage/__pycache__/models.cpython-311.pyc new file mode 100644 index 0000000..4607f7e Binary files /dev/null and b/PROJECT/src/src/apps/homepage/__pycache__/models.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/homepage/__pycache__/views.cpython-311.pyc b/PROJECT/src/src/apps/homepage/__pycache__/views.cpython-311.pyc new file mode 100644 index 0000000..33c1d88 Binary files /dev/null and b/PROJECT/src/src/apps/homepage/__pycache__/views.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/homepage/admin.py b/PROJECT/src/src/apps/homepage/admin.py new file mode 100644 index 0000000..ea5d68b --- /dev/null +++ b/PROJECT/src/src/apps/homepage/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/PROJECT/src/src/apps/homepage/apps.py b/PROJECT/src/src/apps/homepage/apps.py new file mode 100644 index 0000000..def2a06 --- /dev/null +++ b/PROJECT/src/src/apps/homepage/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class HomePageConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'apps.homepage' diff --git a/PROJECT/src/src/apps/homepage/migrations/__init__.py b/PROJECT/src/src/apps/homepage/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/src/src/apps/homepage/migrations/__pycache__/__init__.cpython-311.pyc b/PROJECT/src/src/apps/homepage/migrations/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..cedfe9d Binary files /dev/null and b/PROJECT/src/src/apps/homepage/migrations/__pycache__/__init__.cpython-311.pyc differ diff --git a/PROJECT/src/src/apps/homepage/models.py b/PROJECT/src/src/apps/homepage/models.py new file mode 100644 index 0000000..fd18c6e --- /dev/null +++ b/PROJECT/src/src/apps/homepage/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/PROJECT/src/src/apps/homepage/tests.py b/PROJECT/src/src/apps/homepage/tests.py new file mode 100644 index 0000000..de8bdc0 --- /dev/null +++ b/PROJECT/src/src/apps/homepage/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/PROJECT/src/src/apps/homepage/views.py b/PROJECT/src/src/apps/homepage/views.py new file mode 100644 index 0000000..04588aa --- /dev/null +++ b/PROJECT/src/src/apps/homepage/views.py @@ -0,0 +1,6 @@ +from django.shortcuts import render + +# Create your views here. + +def home_page_view(request): + return render(request, "homepage/homepage.html", {}) \ No newline at end of file diff --git a/PROJECT/src/src/db.sqlite3 b/PROJECT/src/src/db.sqlite3 new file mode 100644 index 0000000..7dfe945 Binary files /dev/null and b/PROJECT/src/src/db.sqlite3 differ diff --git a/PROJECT/src/src/manage.py b/PROJECT/src/src/manage.py new file mode 100644 index 0000000..e398d8f --- /dev/null +++ b/PROJECT/src/src/manage.py @@ -0,0 +1,22 @@ +#!/usr/bin/env python +"""Django's command-line utility for administrative tasks.""" +import os +import sys + + +def main(): + """Run administrative tasks.""" + os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + try: + from django.core.management import execute_from_command_line + except ImportError as exc: + raise ImportError( + "Couldn't import Django. Are you sure it's installed and " + "available on your PYTHONPATH environment variable? Did you " + "forget to activate a virtual environment?" + ) from exc + execute_from_command_line(sys.argv) + + +if __name__ == '__main__': + main() diff --git a/PROJECT/src/src/mysite/__init__.py b/PROJECT/src/src/mysite/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/PROJECT/src/src/mysite/__pycache__/__init__.cpython-311.pyc b/PROJECT/src/src/mysite/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..c8b2e5a Binary files /dev/null and b/PROJECT/src/src/mysite/__pycache__/__init__.cpython-311.pyc differ diff --git a/PROJECT/src/src/mysite/__pycache__/settings.cpython-311.pyc b/PROJECT/src/src/mysite/__pycache__/settings.cpython-311.pyc new file mode 100644 index 0000000..29f9eca Binary files /dev/null and b/PROJECT/src/src/mysite/__pycache__/settings.cpython-311.pyc differ diff --git a/PROJECT/src/src/mysite/__pycache__/urls.cpython-311.pyc b/PROJECT/src/src/mysite/__pycache__/urls.cpython-311.pyc new file mode 100644 index 0000000..dfac555 Binary files /dev/null and b/PROJECT/src/src/mysite/__pycache__/urls.cpython-311.pyc differ diff --git a/PROJECT/src/src/mysite/__pycache__/wsgi.cpython-311.pyc b/PROJECT/src/src/mysite/__pycache__/wsgi.cpython-311.pyc new file mode 100644 index 0000000..36e2362 Binary files /dev/null and b/PROJECT/src/src/mysite/__pycache__/wsgi.cpython-311.pyc differ diff --git a/PROJECT/src/src/mysite/asgi.py b/PROJECT/src/src/mysite/asgi.py new file mode 100644 index 0000000..cd43f95 --- /dev/null +++ b/PROJECT/src/src/mysite/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for mysite project. + +It exposes the ASGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_asgi_application() diff --git a/PROJECT/src/src/mysite/settings.py b/PROJECT/src/src/mysite/settings.py new file mode 100644 index 0000000..ac31de0 --- /dev/null +++ b/PROJECT/src/src/mysite/settings.py @@ -0,0 +1,135 @@ +""" +Django settings for mysite project. + +Generated by 'django-admin startproject' using Django 5.1.3. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/5.1/ref/settings/ +""" + +from pathlib import Path + + +# Build paths inside the project like this: BASE_DIR / 'subdir'. +BASE_DIR = Path(__file__).resolve().parent.parent + + +# Quick-start development settings - unsuitable for production +# See https://docs.djangoproject.com/en/5.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'django-insecure-5s=d(xk9gnlkf74a#n7%ii&9&ya123ffh^8!d@n-czplgqq=cm' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + #My apps + 'apps.dashboard', + 'apps.homepage', + + #Django base apps + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', +] + +MIDDLEWARE = [ + 'django.middleware.security.SecurityMiddleware', + 'django.contrib.sessions.middleware.SessionMiddleware', + 'django.middleware.common.CommonMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', + 'django.contrib.auth.middleware.AuthenticationMiddleware', + 'django.contrib.messages.middleware.MessageMiddleware', + 'django.middleware.clickjacking.XFrameOptionsMiddleware', +] + +ROOT_URLCONF = 'mysite.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [BASE_DIR / 'templates'], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, +] + +WSGI_APPLICATION = 'mysite.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/5.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/5.1/ref/settings/#auth-password-validators + +AUTH_PASSWORD_VALIDATORS = [ + { + 'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', + }, + { + 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', + }, +] + + +# Internationalization +# https://docs.djangoproject.com/en/5.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/5.1/howto/static-files/ + +STATIC_URL = '/static/' + +# Se você estiver usando um diretório para arquivos estáticos no seu projeto +STATICFILES_DIRS = [ + BASE_DIR / "static", # Altere conforme necessário +] + + +# Default primary key field type +# https://docs.djangoproject.com/en/5.1/ref/settings/#default-auto-field + +DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' diff --git a/PROJECT/src/src/mysite/urls.py b/PROJECT/src/src/mysite/urls.py new file mode 100644 index 0000000..b87d187 --- /dev/null +++ b/PROJECT/src/src/mysite/urls.py @@ -0,0 +1,31 @@ +""" +URL configuration for mysite project. + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/5.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import path +from apps.homepage.views import ( + home_page_view, +) +from apps.dashboard.views import ( + dashboard_view, +) + +urlpatterns = [ + path('admin/', admin.site.urls), + path('', home_page_view, name='homepage'), + path('homepage/', home_page_view, name= "homepage"), + path('dashboard/', dashboard_view, name= "dashboard"), +] diff --git a/PROJECT/src/src/mysite/wsgi.py b/PROJECT/src/src/mysite/wsgi.py new file mode 100644 index 0000000..18dc2c7 --- /dev/null +++ b/PROJECT/src/src/mysite/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for mysite project. + +It exposes the WSGI callable as a module-level variable named ``application``. + +For more information on this file, see +https://docs.djangoproject.com/en/5.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings') + +application = get_wsgi_application() diff --git a/PROJECT/src/src/static/base.css b/PROJECT/src/src/static/base.css new file mode 100644 index 0000000..8671d8b --- /dev/null +++ b/PROJECT/src/src/static/base.css @@ -0,0 +1,56 @@ +*{ + padding: 0; + margin: 0; + box-sizing: border-box; + font-family: Arial, Helvetica, sans-serif; +} + +p { + color: #161617; +} + +body { + background-color: #fafafc; /* Substitua pelo tom de cinza desejado */ + margin: 0; /* Remove margens padrão do navegador */ + padding: 0; /* Remove paddings padrão do navegador */ +} + +header, footer{ + width: 100vw; /* Garante que o header e footer ocupem toda a largura da página */ +} + +footer{ + background-color: #c9c9c9; + color: #161617; + position: absolute; /* Altera a posição para 'relative' ou remova a posição absoluta */ + bottom: 0; + text-align: center; + font-size: 22px; + padding: 30px 0; +} + +header h2{ + font-size: 30px; +} + +header{ + background-color: #ffffff; + color: #161617; + display: flex; + align-items: center; + justify-content: space-around; +} + +nav ul li{ + background-color: #ffffff; + color: #161617; + list-style: none; + display: inline-block; +} + +nav ul li a{ + text-decoration: none; + color: #161617; + font-size: 18px; + padding: 0 15px; +} diff --git a/PROJECT/src/src/static/dashboard/dashboard.css b/PROJECT/src/src/static/dashboard/dashboard.css new file mode 100644 index 0000000..1d5e20a --- /dev/null +++ b/PROJECT/src/src/static/dashboard/dashboard.css @@ -0,0 +1,72 @@ +.pad { + padding: 20px; +} + +table { + width: 100%; + border-collapse: collapse; + margin-top: 20px; +} + +table, th, td { + border: 1px solid black; +} + +th, td { + padding: 8px; + text-align: left; +} + +.modal { + display: none; + position: fixed; + z-index: 1; + left: 0; + top: 0; + width: 100%; + height: 100%; + overflow: auto; + background-color: rgba(0, 0, 0, 0.4); + justify-content: center; + align-items: center; +} + +.modal-content { + background-color: white; + padding: 20px; + border-radius: 5px; + width: 400px; +} + +.modal-header { + font-size: 18px; + font-weight: bold; + margin-bottom: 10px; +} + +.modal-footer { + text-align: right; +} + +.btn { + padding: 8px 16px; + background-color: #06c; + color: white; + padding: 10px 20px; + border: none; + border-radius: 20px; + font-size: 16px; + cursor: pointer; +} + +.btn:hover { + background-color: #0071e3; +} + +.btn-close { + background-color: #c9302c; +} + +.btn-close:hover { + background-color: #d9534f; +} \ No newline at end of file diff --git a/PROJECT/src/src/static/homepage/homepage.css b/PROJECT/src/src/static/homepage/homepage.css new file mode 100644 index 0000000..1acca2f --- /dev/null +++ b/PROJECT/src/src/static/homepage/homepage.css @@ -0,0 +1,44 @@ +nav { + margin: 0; + padding: 10px 20px; + background-color: #ffffff; + color: #15a12d; + text-align: center; +} + +nav a { + color: white; + margin: 0 15px; + text-decoration: none; +} + +nav a:hover { + text-decoration: underline; +} + +main { + padding: 20px; +} + +section { + margin-bottom: 30px; +} + +ul { + padding-left: 20px; +} + +#hero button { + background-color: #06c; + color: white; + padding: 10px 20px; + border: none; + border-radius: 20px; + font-size: 16px; + cursor: pointer; +} + +#hero button:hover { + background-color: #0071e3; + color: white; +} diff --git a/PROJECT/src/src/templates/base.html b/PROJECT/src/src/templates/base.html new file mode 100644 index 0000000..2f48bff --- /dev/null +++ b/PROJECT/src/src/templates/base.html @@ -0,0 +1,37 @@ + + + + + + Inventário de Estoque + {% load static %} + + + + + +
+ + +
+{% block content %} + +{% endblock content %} + + + \ No newline at end of file diff --git a/PROJECT/src/src/templates/dashboard/dashboard.html b/PROJECT/src/src/templates/dashboard/dashboard.html new file mode 100644 index 0000000..14e0eba --- /dev/null +++ b/PROJECT/src/src/templates/dashboard/dashboard.html @@ -0,0 +1,90 @@ +{% extends 'base.html' %} +{% block content %} +
+

Inventário de Estoque

+
+ + + + + + + + + + + + + + + + +
Nome do ItemQuantidadeCategoriaDescriçãoPreço
+ + +
+ + + + +{% endblock content %} \ No newline at end of file diff --git a/PROJECT/src/src/templates/homepage/homepage.html b/PROJECT/src/src/templates/homepage/homepage.html new file mode 100644 index 0000000..1087720 --- /dev/null +++ b/PROJECT/src/src/templates/homepage/homepage.html @@ -0,0 +1,44 @@ +{% extends 'base.html' %} +{% block content %} + +
+
+

Gerencie seu Estoque com Facilidade

+
+

Descubra a solução perfeita para monitorar, organizar e otimizar seus inventários de forma eficiente e prática.

+
+ +
+ +
+

Por que Escolher Nosso Sistema?

+
+
+ +
+ Controle de Estoque +

Controle de Estoque

+

Monitore suas entradas, saídas e transferências em tempo real, garantindo total controle do seu inventário.

+
+ + +
+ Relatórios Personalizáveis +

Relatórios Personalizáveis

+

Gere relatórios detalhados e gráficos para tomar decisões baseadas em dados precisos.

+
+ + +
+ Notificações Inteligentes +

Notificações Inteligentes

+

Receba alertas sobre estoque baixo, vencimentos próximos ou movimentações incomuns.

+
+
+
+ +
+ +{% endblock content %} \ No newline at end of file