From 711e6d210a043932ae89d3a225d351ac8026eaf4 Mon Sep 17 00:00:00 2001 From: xfarrow Date: Wed, 11 Oct 2023 12:37:20 +0200 Subject: [PATCH] update --- backend/api.js | 143 ------------------ backend/apis/nodejs/api.js | 26 ++++ backend/apis/nodejs/api_controller.js | 121 +++++++++++++++ demoimages/blink_banner.jpg | Bin 13523 -> 0 bytes frontend/{http => html}/css/login.css | 7 + frontend/{http => html}/html/login.html | 9 +- .../tutorials => tutorials}/0_callbacks.js | 6 +- .../tutorials => tutorials}/1_promises.js | 0 .../2_promise_chaining.js | 0 .../tutorials => tutorials}/3_async-await.js | 0 {backend/tutorials => tutorials}/delay.js | 0 .../sincrono_vs_asincrono.txt | 0 12 files changed, 165 insertions(+), 147 deletions(-) delete mode 100644 backend/api.js create mode 100644 backend/apis/nodejs/api.js create mode 100644 backend/apis/nodejs/api_controller.js delete mode 100644 demoimages/blink_banner.jpg rename frontend/{http => html}/css/login.css (90%) rename frontend/{http => html}/html/login.html (67%) rename {backend/tutorials => tutorials}/0_callbacks.js (92%) rename {backend/tutorials => tutorials}/1_promises.js (100%) rename {backend/tutorials => tutorials}/2_promise_chaining.js (100%) rename {backend/tutorials => tutorials}/3_async-await.js (100%) rename {backend/tutorials => tutorials}/delay.js (100%) rename {backend/tutorials => tutorials}/sincrono_vs_asincrono.txt (100%) diff --git a/backend/api.js b/backend/api.js deleted file mode 100644 index 5ea914e..0000000 --- a/backend/api.js +++ /dev/null @@ -1,143 +0,0 @@ -/* -** This code is part of Blink -** licensed under GPLv3 -*/ - -// require() always returns a function -const express = require('express'); -const bcrypt = require('bcrypt'); -const { Pool } = require('pg'); -const crypto = require('crypto'); - -// We can do express() because the express -// module exports a function. Exporting a function -// means making a JavaScript function defined in one -// module available for use in another module. -const app = express(); -const port = 3000; - -// Middleware which parses JSON for POST requests -app.use(express.json()); - -const pool = new Pool({ - user: 'postgres', - host: 'localhost', - database: 'Blink', - password: 'postgres', - port: 5432, - max: 10, - idleTimeoutMillis: 30000, -}); - -// Define a route to get all items -app.get('/api/items', (req, res) => { - res.json(items); -}); - -// POST - Register an account - -// (req, res) => { ... } is a callback which usually indicates that the -// execution of the code contained between brackets will continue -// asynchronously. -app.post('/api/register', (req, res) => { - const userData = req.body; - - // Ensure that the required fields are present before proceeding - if (!userData.display_name || !userData.email || !userData.password) { - return res.status(400).json("Invalid request"); - } - - // The callback denoted by the arrow function is executed - // when hash() has finished its execution. - bcrypt.hash(userData.password, 10, (err, hashedPassword) => { - - if (err) { - console.error('Error hashing password:', err); - } - - else { - - // Generate activation link token - const activationLink = crypto.randomBytes(16).toString('hex'); - - // Acquire a connection from the pool - pool.connect() - .then((client) => { - // SQL query with placeholders for parameters - const insertQuery = ` - INSERT INTO "User" (display_name, date_of_birth, place_of_living, is_looking_for_job, email, password) - VALUES ($1, $2, $3, $4, $5, $6) - RETURNING *`; // Return the inserted row - - return client.query(insertQuery, [ - userData.display_name, - userData.date_of_birth, - userData.place_of_living, - userData.is_looking_for_job, - userData.email, - hashedPassword - ]) - .then((result) => { - // Respond with the inserted user data - res.status(200).json(result.rows[0]); - }) - .catch((error) => { - console.error('Error inserting data:', error); - res.status(500).json("Internal server error"); - }) - .finally(() => { - // Release the connection back to the pool - client.release(); - }); - }) - .catch((error) => { - console.error('Error acquiring a connection from the pool:', error); - res.status(500).json("Internal server error"); - }); - } - - }); -}); - -app.post('/api/registerv2', async (req, res) => { - const userData = req.body; - - // Ensure that the required fields are present before proceeding - if (!userData.display_name || !userData.email || !userData.password) { - return res.status(400).json("Invalid request"); - } - - const hashPasswordPromise = bcrypt.hash(userData.password, 10); - var client; - try{ - client = await pool.connect(); - const insertQuery = ` - INSERT INTO "User" (display_name, date_of_birth, place_of_living, is_looking_for_job, email, password) - VALUES ($1, $2, $3, $4, $5, $6) - RETURNING *`; - const result = await client.query(insertQuery, [ - userData.display_name, - userData.date_of_birth, - userData.place_of_living, - userData.is_looking_for_job, - userData.email, - await hashPasswordPromise - ]); - res.status(200).json(result.rows[0]); - } - catch (error){ - console.error('Error inserting data:', error); - res.status(500).json("Internal server error"); - } - finally { - if (client) { - client.release(); - } - } -}); - - -// Start the server -app.listen(port, () => { - console.log(`Blink API server is running on port ${port}`); -}); \ No newline at end of file diff --git a/backend/apis/nodejs/api.js b/backend/apis/nodejs/api.js new file mode 100644 index 0000000..9f4abff --- /dev/null +++ b/backend/apis/nodejs/api.js @@ -0,0 +1,26 @@ +/* +** This code is part of Blink +** licensed under GPLv3 +*/ + +// require() always returns a function +const express = require('express'); +const api_controller = require('./api_controller.js'); + +// We can do express() because the express +// module exports a function. Exporting a function +// means making a JavaScript function defined in one +// module available for use in another module. +const app = express(); +const port = 3000; + +// Middleware which parses JSON for POST requests +app.use(express.json()); + +app.post('/blinkapi/register', api_controller.register_async); +app.post('blinkapi/login', api_controller.login); + +// Start the server +app.listen(port, () => { + console.log(`Blink API server is running on port ${port}`); +}); \ No newline at end of file diff --git a/backend/apis/nodejs/api_controller.js b/backend/apis/nodejs/api_controller.js new file mode 100644 index 0000000..a96005a --- /dev/null +++ b/backend/apis/nodejs/api_controller.js @@ -0,0 +1,121 @@ +const bcrypt = require('bcrypt'); +const { Pool } = require('pg'); +const crypto = require('crypto'); + +const pool = new Pool({ + user: 'postgres', + host: 'localhost', + database: 'Blink', + password: 'postgres', + port: 5432, + max: 10, + idleTimeoutMillis: 30000, +}); + +function register(req, res){ + const userData = req.body; + + // Ensure that the required fields are present before proceeding + if (!userData.display_name || !userData.email || !userData.password) { + return res.status(400).json("Invalid request"); + } + + // The callback denoted by the arrow function is executed + // when hash() has finished its execution. + bcrypt.hash(userData.password, 10, (err, hashedPassword) => { + + if (err) { + console.error('Error hashing password:', err); + } + + else { + + // Generate activation link token + const activationLink = crypto.randomBytes(16).toString('hex'); + + // Acquire a connection from the pool + pool.connect() + .then((client) => { + // SQL query with placeholders for parameters + const insertQuery = ` + INSERT INTO "User" (display_name, date_of_birth, place_of_living, is_looking_for_job, email, password) + VALUES ($1, $2, $3, $4, $5, $6) + RETURNING *`; // Return the inserted row + + return client.query(insertQuery, [ + userData.display_name, + userData.date_of_birth, + userData.place_of_living, + userData.is_looking_for_job, + userData.email, + hashedPassword + ]) + .then((result) => { + // Respond with the inserted user data + res.status(200).json(result.rows[0]); + }) + .catch((error) => { + console.error('Error inserting data:', error); + res.status(500).json("Internal server error"); + }) + .finally(() => { + // Release the connection back to the pool + client.release(); + }); + }) + .catch((error) => { + console.error('Error acquiring a connection from the pool:', error); + res.status(500).json("Internal server error"); + }); + } + }); +} + +async function register_async(req, res){ + const userData = req.body; + + // Ensure that the required fields are present before proceeding + if (!userData.display_name || !userData.email || !userData.password) { + return res.status(400).json("Invalid request"); + } + + // Generate activation link token + const activationLink = crypto.randomBytes(16).toString('hex'); + + const hashPasswordPromise = bcrypt.hash(userData.password, 10); + var client; + try{ + client = await pool.connect(); + const insertQuery = ` + INSERT INTO "User" (display_name, date_of_birth, place_of_living, is_looking_for_job, email, password) + VALUES ($1, $2, $3, $4, $5, $6) + RETURNING *`; + const result = await client.query(insertQuery, [ + userData.display_name, + userData.date_of_birth, + userData.place_of_living, + userData.is_looking_for_job, + userData.email, + await hashPasswordPromise + ]); + res.status(200).json(result.rows[0]); + } + catch (error){ + console.error('Error inserting data:', error); + res.status(500).json("Internal server error"); + } + finally { + if (client) { + client.release(); + } + } +} + +function login(req, res){ + +} + +module.exports = { + register_async, + login +}; \ No newline at end of file diff --git a/demoimages/blink_banner.jpg b/demoimages/blink_banner.jpg deleted file mode 100644 index 355d963e0503287323bed23a542b6454c96fa66f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 13523 zcmeHtXH-+&yJrxQCcT4#(yK^ES`-BYUPM%SiAX0D={-?;N4kK3QU!$2LWhWS5RoEC z4Nas45+NZ#5+>fcbMIR7X=c{CcfS1hIZxJE>+GHL{PuqO-WNYFRsqZgy85~R3JMCq zbMghaSOW;^1iLu{07gatNdN#qLw?5!pd>$0kgtDh7mI-VfJ+n9lvI>|+m*|g zDXFN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?- zRqGb&swLDS1!3_nvSb`iS#0W(VoqXwFQstj>Rxk7W1URz7Kgnd6OWz2S$PTk01L?n znZdvx#^{xJ^oiNzP5;-bi?cgB^ZW{BcyE)rDd&diLvOPmLH|5|UB`Us14_6K?4)uKnj8!8qtTvcxZ`C?e{E#!JiiUkK7e(8pn8(5ONP5D0tiS zaobq|hZc&OI8~I4kF=T!`}Iv)avc$2mnjDh)J4A*^-EcTcmR{rllU0c#9aLw$iA zGYfX5jA>y~_r1e$-&&@J5h1MF%1u|Vz4Dc_{BcIVArPs>F$Y{Nz->I9_R6$FBV%O= z0Sx6a=+rNx5r$TV4~12Svm%P-U!6wABtMr+4OY}Mb**MW z(-AZ^dKq#V^W>t28(|ux{`Vx{(rxkqnOFbilrb6r?~2vGnYt$Qa-2OT(tu*bY~lX% zW7QjHEVHF0uhfBQ$ZG+h1%>tO3qTUQ##VXa$&65>ghRc)P^)RIaEx+IXL@vsF2xYX zpoxw{+=oXos*`24++`X2Im1=@Bg--DCf2MR`{ZLCtxUV*Y;se1#h4 diff --git a/frontend/http/css/login.css b/frontend/html/css/login.css similarity index 90% rename from frontend/http/css/login.css rename to frontend/html/css/login.css index 335c38e..7cce9d5 100644 --- a/frontend/http/css/login.css +++ b/frontend/html/css/login.css @@ -59,6 +59,7 @@ input { } input[type="text"], +input[type="password"], input[type="email"] { width: 100%; padding: 0 0 0 10px; @@ -75,26 +76,31 @@ input[type="email"] { background: none; } input[type="text"]:focus, +input[type="password"]:focus, input[type="email"]:focus { border-color: #3ca9e2; } input[type="text"]:focus:invalid, +input[type="password"]:focus:invalid, input[type="email"]:focus:invalid { color: #cc1e2b; border-color: #cc1e2b; } input[type="text"]:valid ~ .validation, +input[type="password"]:valid ~ .validation, input[type="email"]:valid ~ .validation { display: block; border-color: #0C0; } input[type="text"]:valid ~ .validation span, +input[type="password"]:valid ~ .validation span, input[type="email"]:valid ~ .validation span { background: #0C0; position: absolute; border-radius: 6px; } input[type="text"]:valid ~ .validation span:first-child, +input[type="password"]:valid ~ .validation span:first-child, input[type="email"]:valid ~ .validation span:first-child { top: 30px; left: 14px; @@ -104,6 +110,7 @@ input[type="email"]:valid ~ .validation span:first-child { transform: rotate(-45deg); } input[type="text"]:valid ~ .validation span:last-child, +input[type="password"]:valid ~ .validation span:last-child, input[type="email"]:valid ~ .validation span:last-child { top: 35px; left: 8px; diff --git a/frontend/http/html/login.html b/frontend/html/html/login.html similarity index 67% rename from frontend/http/html/login.html rename to frontend/html/html/login.html index 97acb41..2af5964 100644 --- a/frontend/http/html/login.html +++ b/frontend/html/html/login.html @@ -11,13 +11,16 @@

Login

-
+ +

- +

+

- +

+

diff --git a/backend/tutorials/0_callbacks.js b/tutorials/0_callbacks.js similarity index 92% rename from backend/tutorials/0_callbacks.js rename to tutorials/0_callbacks.js index bab79b5..f57d5ed 100644 --- a/backend/tutorials/0_callbacks.js +++ b/tutorials/0_callbacks.js @@ -41,4 +41,8 @@ function entryPoint(){ /* ===== End Simple Callback ===== */ } -entryPoint(); \ No newline at end of file +entryPoint(); + +// callbacks usually indicate that the +// execution of their code will continue +// asynchronously. \ No newline at end of file diff --git a/backend/tutorials/1_promises.js b/tutorials/1_promises.js similarity index 100% rename from backend/tutorials/1_promises.js rename to tutorials/1_promises.js diff --git a/backend/tutorials/2_promise_chaining.js b/tutorials/2_promise_chaining.js similarity index 100% rename from backend/tutorials/2_promise_chaining.js rename to tutorials/2_promise_chaining.js diff --git a/backend/tutorials/3_async-await.js b/tutorials/3_async-await.js similarity index 100% rename from backend/tutorials/3_async-await.js rename to tutorials/3_async-await.js diff --git a/backend/tutorials/delay.js b/tutorials/delay.js similarity index 100% rename from backend/tutorials/delay.js rename to tutorials/delay.js diff --git a/backend/tutorials/sincrono_vs_asincrono.txt b/tutorials/sincrono_vs_asincrono.txt similarity index 100% rename from backend/tutorials/sincrono_vs_asincrono.txt rename to tutorials/sincrono_vs_asincrono.txt