From 0db5748eefe59b068406e399d62ee938877e9bbd Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Thu, 1 Oct 2020 15:26:39 +0200
Subject: Insert
---
tables.sql | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/tables.sql b/tables.sql
index 39021f1..a8201ab 100644
--- a/tables.sql
+++ b/tables.sql
@@ -15,19 +15,19 @@ DROP TABLE IF EXISTS class;
CREATE TABLE IF NOT EXISTS types(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
- name VARCHAR(255) NOT NULL
+ name VARCHAR(255) NOT NULL UNIQUE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS class(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
- name VARCHAR(255) NOT NULL
+ name VARCHAR(255) NOT NULL UNIQUE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE IF NOT EXISTS users(
id INTEGER PRIMARY KEY AUTO_INCREMENT,
username VARCHAR(255) NOT NULL,
name VARCHAR(255) NOT NULL,
- middlename VARCHAR(255) NOT NULL,
+ middlename VARCHAR(255) DEFAULT NULL,
surname VARCHAR(255) NOT NULL,
password VARCHAR(255) NOT NULL,
class_id INTEGER NOT NULL,
@@ -37,3 +37,11 @@ CREATE TABLE IF NOT EXISTS users(
CONSTRAINT `fk_class_user` FOREIGN KEY (class_id) REFERENCES class (id),
CONSTRAINT `fk_type_user` FOREIGN KEY (type_id) REFERENCES types (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+INSERT INTO types VALUES (1, "teacher"), (2, "pupil");
+INSERT INTO class VALUES
+ (1, "TGM13.1"),
+ (2, "TGM13.2"),
+ (3, "TGTM13.1"),
+ (4, "TGI13.1"),
+ (5, "TGI13.2");
--
cgit v1.2.3
From f2b0241434ff2ba4e461235a4c5d905487e537d1 Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Thu, 1 Oct 2020 16:01:52 +0200
Subject: Added login frontend
---
auth/public/index.html | 27 +++++++++++++++++++++++++--
auth/public/style.css | 31 +++++++++++++++++++++++++++++++
2 files changed, 56 insertions(+), 2 deletions(-)
create mode 100644 auth/public/style.css
diff --git a/auth/public/index.html b/auth/public/index.html
index c290ab0..b016ac6 100644
--- a/auth/public/index.html
+++ b/auth/public/index.html
@@ -2,8 +2,31 @@
-
+
+
+
+
Auth
-
+
+
+
diff --git a/auth/public/style.css b/auth/public/style.css
new file mode 100644
index 0000000..f7e5f23
--- /dev/null
+++ b/auth/public/style.css
@@ -0,0 +1,31 @@
+html,
+body {
+ padding: 0;
+ margin: 0;
+ height: 100%;
+ width: 100%;
+ background: url(https://images.unsplash.com/photo-1544829728-e5cb9eedc20e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1500&q=80);
+ background-size: cover;
+}
+
+form {
+ position: absolute;
+ width: 30%;
+ left: 50%;
+ top: 50%;
+ -webkit-transform: translate(-50%, -50%);
+ transform: translate(-50%, -50%);
+ padding: 20px;
+ border-radius: 10px;
+ background: white;
+}
+
+input:not([type="checkbox"]) {
+ width: 100%;
+}
+
+@media only screen and (max-width: 600px) {
+ form {
+ width: calc(100% - 50px);
+ }
+}
--
cgit v1.2.3
From ce6a00fa25bd12774fa86ee384e840565ecf965b Mon Sep 17 00:00:00 2001
From: Marvin Borner
Date: Thu, 1 Oct 2020 16:45:33 +0200
Subject: Added quotes frontend
---
app.js | 2 ++
auth/public/index.html | 2 +-
auth/public/style.css | 3 ++-
quotes/public/index.html | 30 ++++++++++++++++++++++++++++++
quotes/public/script.js | 28 ++++++++++++++++++++++++++++
quotes/public/style.css | 33 +++++++++++++++++++++++++++++++++
tables.sql | 12 ++++++++++++
7 files changed, 108 insertions(+), 2 deletions(-)
create mode 100644 quotes/public/index.html
create mode 100644 quotes/public/script.js
create mode 100644 quotes/public/style.css
diff --git a/app.js b/app.js
index a527074..b4f4282 100644
--- a/app.js
+++ b/app.js
@@ -3,6 +3,7 @@ const express = require("express");
const motto = require("./motto");
const auth = require("./auth");
+const quotes = require("./quotes");
const app = express();
@@ -12,5 +13,6 @@ app.use(express.json());
app.get("/", (req, res) => res.redirect("/motto"));
app.use("/motto", motto);
app.use("/auth", auth);
+app.use("/quotes", quotes);
app.listen(5005, () => console.log("Server started on http://localhost:5005"));
diff --git a/auth/public/index.html b/auth/public/index.html
index b016ac6..8bf9ecd 100644
--- a/auth/public/index.html
+++ b/auth/public/index.html
@@ -18,7 +18,7 @@