From 5abec70c613d12783b4ab02735c5a48d196dd47e Mon Sep 17 00:00:00 2001 From: knighthawk4227 Date: Tue, 6 May 2025 00:33:36 -0700 Subject: [PATCH 1/4] login and signup touch ups index page template added --- app.js | 14 +-- src/views/index.ejs | 285 +++++++++++++++++++++++++++++++++++++++++-- src/views/login.ejs | 4 +- src/views/signup.ejs | 12 +- 4 files changed, 295 insertions(+), 20 deletions(-) diff --git a/app.js b/app.js index 5324680..e96e45a 100644 --- a/app.js +++ b/app.js @@ -10,7 +10,7 @@ const port = process.env.PORT || 3000; const mongoURI = process.env.mongoURI || "mongodb://localhost:27017/"; const database = process.env.database || "knoldus"; // Database name -const secret = process.env.secret || "123-secret-xyz"; +const secret = process.env.secret || "123-secret-xyz"; /*** Sessions ***/ app.use(session({ @@ -22,7 +22,7 @@ app.use(session({ })); app.set('view engine', 'ejs'); -app.set('views',path.join(__dirname, 'src/views')); +app.set('views', path.join(__dirname, 'src/views')); app.use(express.urlencoded({ extended: true })); app.use("/static", express.static("./src/public")); app.use("/images", express.static("./src/public/images")); @@ -33,7 +33,7 @@ const { connectMongo, getCollection } = require("./src/database/connection"); let users; async function initDatabase() { const db = await connectMongo(mongoURI, database); - + // For any collection, init here users = await getCollection(db, "users"); } @@ -42,7 +42,7 @@ async function initDatabase() { app.get('/', (req, res) => { if (!req.session.errMessage) req.session.errMessage = ""; - res.render('landing'); + res.render('index'); return res.status(status.Ok); }); @@ -54,7 +54,7 @@ app.get('/signup', (req, res) => { app.get('/login', (req, res) => { if (req.session.authenticated) { res.redirect("/home"); - return res.status(status.Ok); + return res.status(status.Ok); } res.render('login', { errMessage: req.session.errMessage }); return res.status(status.Ok); @@ -81,10 +81,10 @@ initDatabase().then(() => { app.get('/*splat', (req, res) => { res.send('404 Not Found'); return res.status(status.NotFound); - }); + }); // Start app app.listen(port, () => { console.log(`Server listening on port ${port}`); - }); + }); }); diff --git a/src/views/index.ejs b/src/views/index.ejs index 975b566..fe570e0 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -9,15 +9,284 @@ - The Index Page - +
+
+ + + + + <%# include("./partials/navBar") %> + <%# include("./partials/footer") %> diff --git a/src/views/login.ejs b/src/views/login.ejs index 981b77c..cf46b63 100644 --- a/src/views/login.ejs +++ b/src/views/login.ejs @@ -21,13 +21,13 @@
<%= errMessage %>
diff --git a/src/views/signup.ejs b/src/views/signup.ejs index e19fc96..2345bbf 100644 --- a/src/views/signup.ejs +++ b/src/views/signup.ejs @@ -18,20 +18,26 @@

Signup


+
+ + +
<%= errMessage %>
From b558a75f20424be778d0a2f7d3b5a737f0f4d6e2 Mon Sep 17 00:00:00 2001 From: knighthawk4227 Date: Tue, 6 May 2025 09:46:14 -0700 Subject: [PATCH 2/4] uncomment partials --- src/views/index.ejs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/index.ejs b/src/views/index.ejs index fe570e0..512ff5b 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -9,8 +9,8 @@ - <%# include("./partials/fileHeader") %> - <%# include("./partials/header") %> + <%- include("./partials/fileHeader") %> + <%- include("./partials/header") %>
@@ -285,8 +285,8 @@
- <%# include("./partials/navBar") %> - <%# include("./partials/footer") %> + <%- include("./partials/navBar") %> + <%- include("./partials/footer") %> From 4bb9a015243ec0d07d24de2020245a51af550570 Mon Sep 17 00:00:00 2001 From: knighthawk4227 Date: Tue, 6 May 2025 11:05:37 -0700 Subject: [PATCH 3/4] deleting projects table --- src/views/index.ejs | 320 +++++++++++++++++++------------------------- 1 file changed, 134 insertions(+), 186 deletions(-) diff --git a/src/views/index.ejs b/src/views/index.ejs index 3c612b2..3e79630 100644 --- a/src/views/index.ejs +++ b/src/views/index.ejs @@ -1,64 +1,102 @@ - <%- include("./partials/fileHeader") %> - <%- include("./partials/header") %> - +<%- include("./partials/fileHeader") %> + <%- include("./partials/header") %> +
+
+
+ -<%- include("./partials/navBar") %> -<%- include("./partials/footer") %> \ No newline at end of file + <%- include("./partials/navBar") %> + <%- include("./partials/footer") %> From 7b9b18f030dba35b85e19cc2d69800badb759290 Mon Sep 17 00:00:00 2001 From: knighthawk4227 Date: Tue, 6 May 2025 15:08:04 -0700 Subject: [PATCH 4/4] dashboard page with cards to fill in and add asset and new plan button --- app.js | 4 +- src/views/dashboard.ejs | 99 ++++++++++++++++++ src/views/home.ejs | 1 - src/views/index.ejs | 226 ---------------------------------------- 4 files changed, 101 insertions(+), 229 deletions(-) create mode 100644 src/views/dashboard.ejs delete mode 100644 src/views/index.ejs diff --git a/app.js b/app.js index 54804bd..9f7f654 100644 --- a/app.js +++ b/app.js @@ -3,7 +3,7 @@ const MongoStore = require("connect-mongo"); const session = require("express-session"); const express = require('express'); const path = require('path'); -const joi = require('joi'); +const joi = require('joi'); require('dotenv').config(); @@ -44,7 +44,7 @@ async function initDatabase() { app.get('/', (req, res) => { if (!req.session.errMessage) req.session.errMessage = ""; - res.render('index'); + res.render('dashboard'); return res.status(status.Ok); }); diff --git a/src/views/dashboard.ejs b/src/views/dashboard.ejs new file mode 100644 index 0000000..3de6635 --- /dev/null +++ b/src/views/dashboard.ejs @@ -0,0 +1,99 @@ +<%- include("./partials/fileHeader") %> + <%- include("./partials/header") %> + +
+ +
+ + +
+ +
+
+ +
+ + + +
+

+ Retirement goal

+

+ $53k

+
+
+

+ Make this percent bar or graph or something  than last + week +

+
+
+
+
+

+ Retirement goal

+

+ $53k

+
+
+

+ Make this percent bar or graph or something  than last + week +

+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +
+
+
+

+ Retirement goal

+

+ $53k

+
+
+

+ Make this percent bar or graph or something  than last + week +

+
+
+
+
+
+
+
+
+ + <%- include("./partials/navBar") %> + <%- include("./partials/footer") %> diff --git a/src/views/home.ejs b/src/views/home.ejs index 3637163..405e232 100644 --- a/src/views/home.ejs +++ b/src/views/home.ejs @@ -2,7 +2,6 @@ <%- include("./partials/header") %>
- <%- include("./partials/header") %> Welcome: <%= user.email %> The Dashboard Page <% if(user.authenticated) { %> diff --git a/src/views/index.ejs b/src/views/index.ejs deleted file mode 100644 index 3e79630..0000000 --- a/src/views/index.ejs +++ /dev/null @@ -1,226 +0,0 @@ -<%- include("./partials/fileHeader") %> - <%- include("./partials/header") %> - -
-
- -
-
-
-
- -
-
-

Today's - Money

-

- $53k

-
-
-

- +55% than last week -

-
-
-
-
- -
-
-

Today's - Users

-

- 2,300

-
-
-

- +3% than last month -

-
-
-
-
- -
-
-

New Clients -

-

- 3,462

-
-
-

- -2% than yesterday -

-
-
-
-
- -
-
-

Sales

-

- $103,430

-
-
-

- +5% from yesterday -

-
-
-
- - -
-
-
-
-
-
-
- - <%- include("./partials/navBar") %> - <%- include("./partials/footer") %>