From 44e9e053c31db064bab15c1d6ce82211eb31db92 Mon Sep 17 00:00:00 2001 From: VicenteAGT <155429830+VicenteAGT@users.noreply.github.com> Date: Wed, 21 Jan 2026 22:37:19 +0000 Subject: [PATCH 01/63] =?UTF-8?q?[Updates=20clase=20mi=C3=A9rcoles=20model?= =?UTF-8?q?s]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/models.py | 51 +++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 47 insertions(+), 4 deletions(-) diff --git a/src/api/models.py b/src/api/models.py index da515f6a1a..7de43333cb 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -1,14 +1,57 @@ from flask_sqlalchemy import SQLAlchemy -from sqlalchemy import String, Boolean -from sqlalchemy.orm import Mapped, mapped_column +from sqlalchemy import String, Boolean, ForeignKey, Enum as SQLEnum, date +from sqlalchemy.orm import Mapped, mapped_column, relationship db = SQLAlchemy() -class User(db.Model): +#ROLES TABLES + +class Usser_Type(Enum): + ADMIN = "admin" + TEACHER = "teacher" + STUDENT = "student" + +class Admnins(db.Model): + __tablename__ = 'admins' id: Mapped[int] = mapped_column(primary_key=True) + name: Mapped[str] = mapped_column(String(20), nullable =False) email: Mapped[str] = mapped_column(String(120), unique=True, nullable=False) password: Mapped[str] = mapped_column(nullable=False) - is_active: Mapped[bool] = mapped_column(Boolean(), nullable=False) + user_type: Mapped[Usser_Type] = mapped_column(SQLEnum(Usser_Type), name="usser_type_enum", + nullable=False, + default=Usser_Type.ADMIN) + + +class Teachers(db.Model): + __tablename__ = 'teachers' + id: Mapped[int] = mapped_column(primary_key=True) + name: Mapped[str] = mapped_column(String(20), nullable =False) + email: Mapped[str] = mapped_column(String(120), unique=True, nullable=False) + password: Mapped[str] = mapped_column(nullable=False) + user_type: Mapped[Usser_Type] = mapped_column(SQLEnum(Usser_Type), name="usser_type_enum", + nullable=False, + default=Usser_Type.TEACHER) + + +class Students(db.Model): + __tablename__ = 'students' + id: Mapped[int] = mapped_column(primary_key=True) + name: Mapped[str] = mapped_column(String(20), nullable =False) + email: Mapped[str] = mapped_column(String(120), unique=True, nullable=False) + password: Mapped[str] = mapped_column(nullable=False) + user_type: Mapped[Usser_Type] = mapped_column(SQLEnum(Usser_Type), name="usser_type_enum", + nullable=False, + default=Usser_Type.STUDENT) + +# TEACHERS TABLES + +class Todos(db.Model): + __tablename__ = 'todos' + id: Mapped[int] = mapped_column(primary_key=True) + description: Mapped[str] = mapped_column(String(300), nullable=False) + mediaLink: Mapped[str] = mapped_column(String(300)) + time: Mapped[str] = mapped_column(date, nullable=False) + def serialize(self): From 1ebc15d2983d2a6f7c40c8e6aa8b7258c2df22d0 Mon Sep 17 00:00:00 2001 From: VicenteAGT <155429830+VicenteAGT@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:01:49 +0000 Subject: [PATCH 02/63] [updates] --- src/api/models.py | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/api/models.py b/src/api/models.py index 7de43333cb..4ee27657c6 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -1,5 +1,5 @@ from flask_sqlalchemy import SQLAlchemy -from sqlalchemy import String, Boolean, ForeignKey, Enum as SQLEnum, date +from sqlalchemy import String, Boolean, ForeignKey, Enum as SQLEnum, date, Integer from sqlalchemy.orm import Mapped, mapped_column, relationship db = SQLAlchemy() @@ -42,6 +42,15 @@ class Students(db.Model): user_type: Mapped[Usser_Type] = mapped_column(SQLEnum(Usser_Type), name="usser_type_enum", nullable=False, default=Usser_Type.STUDENT) + +#GROUPS TABLE +class Groups(db.Model): + __tablename__ = 'groups' + id: Mapped[int] = mapped_column(primary_key=True) + name: Mapped[str] = mapped_column(String(20), nullable =False) + description: Mapped[str] = mapped_column(String(100), nullable=False) + + # TEACHERS TABLES @@ -51,7 +60,17 @@ class Todos(db.Model): description: Mapped[str] = mapped_column(String(300), nullable=False) mediaLink: Mapped[str] = mapped_column(String(300)) time: Mapped[str] = mapped_column(date, nullable=False) - + note: Mapped[int] = mapped_column(Integer, nullable=False) + +class Readings(db.Model): + __tablename__ = 'readings' + id: Mapped[int] = mapped_column(primary_key=True) + mediaLink: Mapped[str] = mapped_column(String(300)) + +class Status(db.Model): + __tablename__ = 'status' + id: Mapped[int] = mapped_column(primary_key=True) + status: Mapped[] def serialize(self): From 78257cea5b5fa793c738267ad916603f56434f4c Mon Sep 17 00:00:00 2001 From: VicenteAGT <155429830+VicenteAGT@users.noreply.github.com> Date: Wed, 21 Jan 2026 23:03:40 +0000 Subject: [PATCH 03/63] [Update tablas sin relaciones] --- src/api/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/models.py b/src/api/models.py index 4ee27657c6..0c7a02d9f9 100644 --- a/src/api/models.py +++ b/src/api/models.py @@ -70,7 +70,7 @@ class Readings(db.Model): class Status(db.Model): __tablename__ = 'status' id: Mapped[int] = mapped_column(primary_key=True) - status: Mapped[] + status: Mapped[bool] = mapped_column(Boolean) def serialize(self): From a1756cb02debf1e3fa9a12f95b15859e002f733b Mon Sep 17 00:00:00 2001 From: Sebaperez12 Date: Wed, 21 Jan 2026 23:04:49 +0000 Subject: [PATCH 04/63] upgrade --- src/front/components/Navbar.jsx | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/src/front/components/Navbar.jsx b/src/front/components/Navbar.jsx index 30d43a2636..21c26ee9ac 100644 --- a/src/front/components/Navbar.jsx +++ b/src/front/components/Navbar.jsx @@ -3,15 +3,22 @@ import { Link } from "react-router-dom"; export const Navbar = () => { return ( - diff --git a/src/front/pages/CreateTodoForm.jsx b/src/front/pages/CreateTodoForm.jsx index 5f1d95e015..c90bd85830 100644 --- a/src/front/pages/CreateTodoForm.jsx +++ b/src/front/pages/CreateTodoForm.jsx @@ -1,22 +1,189 @@ -import { useState } from "react"; +import { useEffect, useState } from "react"; import { useNavigate } from "react-router-dom"; + + + + + export const CreateTodoForm = () => { + + + const [title, setTitle] = useState(""); + const [dueDate, setDueDate] = useState(""); + const [groupId, setGroupId] = useState(""); + const [description, setDescription] = useState(""); + + const [groups, setGroups] = useState([]); + const [error, setError] = useState(null); + + useEffect(() => { + const loadGroups = async () => { + + try { + setError(null); + + + const backend = import.meta.env.VITE_BACKEND_URL; + const resp = await fetch(`${backend}/groups`); + + const data = await resp.json(); + if (!resp.ok) throw new Error(data?.msg || "Error cargando groups"); + + setGroups(data.groups ?? data); + + } + catch (e) { + setError(e.message); + } + }; + loadGroups(); + + }, []); + + const handleSubmit = async (e) => { + + e.preventDefault(); + if (!title || !dueDate || !groupId) { + setError("Título, fecha y grupo son obligatorios"); + return; + } + + try { + + setError(null); + + const backend = import.meta.env.VITE_BACKEND_URL; + + const payload = { + title, + due_date: dueDate, + group_id: Number(groupId), + description + }; + + + const resp = await fetch(`${backend}/todo`, { + method: "POST", + headers: { + "Content-Type": "application/json", + + }, + body: JSON.stringify(payload), + }); + const data = await resp.json().catch(() => ({})); + if (!resp.ok) throw new Error(data?.msg || "Error creando tarea"); + + setTitle(""); + setDueDate(""); + setGroupId(""); + setDescription(""); + + } catch (e) { + + setError(e.message); + } + + } + + return ( -
+
-
- +
+ +
Bienvenido
-
- Generador de tareas -
- Curso: Desarrollo Web + +
+ +
+ +

Generador de tareas

+
Curso: Desarrollo Web
+
+ + + +
+ +
+ +
+ +
Crear tarea
+

En la siguiente sección podrás crear una nueva tarea. Recordá asignarla al + grupo correspondiente y definir la fecha de finalización. Si necesitás adjuntar + un archivo, hacé clic en el botón Archivo y agregalo a la descripción de la consigna.

+
+ +
+
+ +
+ + setTitle(e.target.value)} /> +
+ +
+ + setDueDate(e.target.value)} /> +
+ + +
+ + +
+ +
+ + -
+
+ +
+

Generador de lecturas

+
Curso: Desarrollo Web
+
+ +
+
+ +
+
Crear lecturas
+

+ En la siguiente sección podrás crear una nueva lectura. +

+
+ + + + {success && ( +
+ {success} +
+ )} + + {err && ( +
+ {err} +
+ )} + +
+ + setTeacher(e.target.value)} + /> +
+ +
+ + setGroup(e.target.value)} + /> +
+ +
+ + setTitle(e.target.value)} + /> +
+ +
+ +