Compare commits

...
Author SHA1 Message Date
Joaquin 54566f05b7 feature/fully implemented ejs inclusion to main files 2025-05-05 21:56:47 -07:00
Joaquin decdb299b7 Merge branch 'dev' of https://github.com/JoaquinPar/2800-202510-BBY14 into feature/layoutPage 2025-05-05 21:17:50 -07:00
Joaquin c8bf2e49ab feature/completed most of ejs implementation into other pages 2025-05-05 21:12:52 -07:00
nicoagostini f39b8555fa fix/session check fixed 2025-05-05 18:59:59 -07:00
nicoagostini fef7184404 fix/home.ejs include fix 2025-05-05 18:45:59 -07:00
SowinskiBraeden 6a8595d24b fix/impliment middleware 2025-05-05 18:39:43 -07:00
SowinskiBraeden 7c7098636a fix/middleware authentication + bad merge 2025-05-05 18:34:19 -07:00
Nícolas Agostini a446943d4a Merge pull request #2 from JoaquinPar/feature/questionnaire
Just a bug fix
2025-05-05 18:18:55 -07:00
Nícolas Agostini 612bb262d1 Merge branch 'dev' into feature/questionnaire 2025-05-05 18:18:45 -07:00
nicoagostini 6819b82723 Just a bug fix 2025-05-05 18:17:35 -07:00
SowinskiBraeden 5b1b36a553 fix/compare password on sign in 2025-05-05 18:12:19 -07:00
SowinskiBraeden 1114789e57 Merge latest dev into dev 2025-05-05 17:34:24 -07:00
SowinskiBraeden bb6e2eba2c fix/user routing 2025-05-05 17:33:27 -07:00
Joaquin f6640b23cf feature/some progress made on layouts 2025-05-05 17:07:51 -07:00
nicoagostini d0aa7a0fbd Landing moved to be the index page, routes added and landing page image route fixed 2025-05-05 16:46:16 -07:00
Joaquin 4be7ca3a8e Merge branch 'dev' into feature/layoutPage 2025-05-05 16:30:51 -07:00
Joaquin 10541d2428 merge feature/navBar with dev 2025-05-05 16:26:01 -07:00
Joaquin 7fa75457c9 feature/completed navbar/header functionality 2025-05-05 16:24:25 -07:00
Joaquin 8b6ff1354b resolved merge conflict 2025-05-05 14:27:24 -07:00
Joaquin 4bcf8dd812 feature/started work on layout.ejs 2025-05-05 14:21:30 -07:00
SowinskiBraeden fe7152b03b update/create middleware 2025-05-05 14:16:50 -07:00
SowinskiBraeden 87cad63425 update/return status codes 2025-05-05 13:17:30 -07:00
SowinskiBraeden d08fd30888 login/signup function with no sessions 2025-05-02 13:19:14 -07:00
SowinskiBraeden 7ef6282ac0 update login/signup.ejs pages 2025-05-02 13:18:51 -07:00
Joaquin Paredes 02a8374a58 feature/most nav bar functionality done 2025-05-02 13:15:38 -07:00
SowinskiBraeden 0e4d4d7daf fix project structure & static file 2025-05-02 11:41:13 -07:00
knighthawk4227 50dab82945 making login ejs and setting index blank for now 2025-05-02 02:07:55 -07:00
nicoagostini 8832768838 Merge branch 'feature/landingPage' into dev 2025-05-02 02:01:06 -07:00
knighthawk4227 44cee349e9 ejs login and signup with tailwind 2025-05-02 01:53:47 -07:00
26 changed files with 1385 additions and 185 deletions

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
mongoURI='mongodb://localhost:27017/'
database='nameOfDatabase'
PORT=8000
secret='123456789'
+6 -3
View File
@@ -54,9 +54,12 @@ Example:
retirementCalculator/
├── src/
│ ├── views/
| ── css/
| ├── images/
| ── scripts/
│ │ ── partials/
├── css/
── images/
│ ├── scripts/
│ └── utils/
├── app.js
├── .env.example
├── .gitignore
+55 -59
View File
@@ -1,94 +1,90 @@
const status = require("./src/util/statuses");
const MongoStore = require("connect-mongo");
const session = require("express-session");
const express = require('express');
const path = require('path');
const dotenv = require('dotenv');
dotenv.config();
require('dotenv').config();
const app = express();
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";
/*** Sessions ***/
app.use(session({
secret: secret,
store: MongoStore.create({ mongoUrl: `${mongoURI}${database}`, crypto: { secret: secret } }),
resave: true,
saveUninitialized: false,
cookie: { maxAge: 60000 },
}));
app.set('view engine', 'ejs');
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"));
/*** Database ***/
const { connectMongo, getCollection } = require("./src/database/connection");
/*
STATIC ROUTINGS
*/
let users;
async function initDatabase() {
const db = await connectMongo(mongoURI, database);
app.use("/scripts", express.static("./src/scripts"));
app.use("/css", express.static("./src/css"));
app.use("/images", express.static("./src/images"));
app.use("/views", express.static("./src/views"));
// For any collection, init here
users = await getCollection(db, "users");
}
/*
ROUTINGS
*/
/*** ROUTINGS ***/
app.get('/', (req, res) => {
res.render('index');
});
app.get('/landing', (req, res) => {
if (!req.session.errMessage) req.session.errMessage = "";
res.render('landing');
return res.status(status.Ok);
});
app.get('/signup', (req, res) => {
res.render('signup');
res.render('signup', { errMessage: req.session.errMessage });
return res.status(status.Ok);
});
app.get('/login', (req, res) => {
res.render('login');
});
app.get('/home', (req, res) => {
res.render('home');
});
app.get('/assets', (req, res) => {
res.render('assets');
});
app.get('/plans', (req, res) => {
res.render('plans');
});
app.get('/more', (req, res) => {
res.render('more');
});
app.get('/profile', (req, res) => {
res.render('profiles');
});
app.get('/settings', (req, res) => {
res.render('settings');
if (req.session.authenticated) {
res.redirect("/home");
return res.status(status.Ok);
}
res.render('login', { errMessage: req.session.errMessage });
return res.status(status.Ok);
});
app.get('/aboutUs', (req, res) => {
res.render('aboutUs');
return res.status(status.Ok);
});
app.post('/signup', (req, res) => {
res.status(200);
res.send('200 status code');
});
// Initialize database and start app
initDatabase().then(() => {
console.log("Successfully connected to MongoDB");
app.post('/login', (req, res) => {
res.status(200);
res.send('200 status code');
});
// Import authentication handler
app.use(require("./src/auth/authentication")(users));
app.get('/*splat', (req, res) => {
res.status(404);
// Import middleware & apply to user routes
const middleware = require("./src/auth/middleware")(users);
app.use(require('./src/router/user')(middleware));
// 404 handler
app.get('/*splat', (req, res) => {
res.send('404 Not Found');
});
return res.status(status.NotFound);
});
app.listen(port, () => {
// Start app
app.listen(port, () => {
console.log(`Server listening on port ${port}`);
});
});
+841 -2
View File
File diff suppressed because it is too large. Load diff
+9 -4
View File
@@ -2,10 +2,10 @@
"name": "retirementcalculator",
"version": "0.1.0",
"description": "Retirement Calculator",
"main": "./src/app.js",
"main": "app.js",
"scripts": {
"start": "node ./src/app.js",
"dev": "nodemon ./src/app.js"
"start": "node app.js",
"dev": "nodemon app.js"
},
"repository": {
"type": "git",
@@ -18,9 +18,14 @@
},
"homepage": "https://github.com/JoaquinPar/2800-202510-BBY14#readme",
"dependencies": {
"bcrypt": "^5.1.1",
"connect-mongo": "^5.1.0",
"dotenv": "^16.5.0",
"ejs": "^3.1.10",
"express": "^5.1.0"
"express": "^5.1.0",
"express-session": "^1.18.1",
"joi": "^17.13.3",
"mongodb": "^6.16.0"
},
"devDependencies": {
"nodemon": "^3.1.10"
+102
View File
@@ -0,0 +1,102 @@
const status = require("../util/statuses");
const bcrypt = require('bcrypt');
const joi = require("joi");
const salt = 12;
module.exports = (users) => {
const router = require("express").Router();
router.get("/logout", (req, res) => {
req.session.destroy();
// res.status(status.Unauthorized);
return res.redirect('/login');
});
router.post("/login", async (req, res) => {
if (req.session.authenticated) {
res.redirect("/home");
return res.status(status.Ok);
}
const credentialSchema = joi.object({
email: joi.string().email().required(),
password: joi.string().max(20).required(),
});
const valid = credentialSchema.validate(req.body);
if (valid.err) {
req.session.errMessage = "Invalid input";
res.status(status.BadRequest);
return res.redirect("/login");
}
users.findOne({ "email": req.body.email }).then((user) => {
if (!user) {
req.session.errMessage = "User not found";
res.status(status.NotFound);
return res.redirect("/login");
}
if (!bcrypt.compareSync(req.body.password, user.password)) {
req.session.errMessage = "Incorrect password";
res.status(status.Unauthorized);
return res.redirect("/login");
}
req.session.authenticated = true;
req.session.email = req.body.email;
req.session.errMessage = "";
res.redirect("/home");
return res.status(status.Ok);
});
});
router.post("/signup", async (req, res) => {
const userSchema = joi.object({
email: joi.string().email().required(),
// name: joi.string().alphanum().max(20).required(),
password: joi.string().max(20).min(8).required(),
repassword: joi.string().max(20).min(8).required(),
});
const valid = userSchema.validate(req.body);
if (valid.err) {
req.session.errMessage = "Invalid input",
res.status(status.BadRequest);
return res.redirect("/signup");
}
if (req.body.password != req.body.repassword) {
req.session.errMessage = "Passwords must match";
res.status(status.BadRequest);
return res.redirect("/signup");
}
let hashedPassword = await bcrypt.hashSync(req.body.password, salt);
users.insertOne({
email: req.body.email,
// name: req.body.name,
password: hashedPassword,
}).then((results, err) => {
if (err) {
res.status(status.InternalServerError);
console.error(err);
return res.send("Internal server error");
}
req.session.authenticated = true;
req.session.email = req.body.email;
req.session.errMessage = "";
res.status(status.Ok);
return res.redirect("/home");
});
});
return router;
}
+29
View File
@@ -0,0 +1,29 @@
const status = require("../util/statuses");
/**
* createMiddleware returns a middleware function for express.
* @param {MongoClient.collection} users
* @return {async function}
*/
const createMiddleware = (users) => {
return async (req, res, next) => {
if (!req.session.authenticated || !req.session.email) {
req.session.errMessage = "Please login to view that resource";
res.redirect("/login");
return res.status(status.Unauthorized);
}
let user = await users.findOne({ "email": req.session.email }).then((user) => user);
if (!user) {
req.session.errMessage = "User not found";
res.redirect("/login");
return res.status(status.Unauthorized);
}
req.user = user;
next();
};
}
module.exports = createMiddleware;
+27
View File
@@ -0,0 +1,27 @@
const MongoClient = require("mongodb").MongoClient;
/**
* connectMongo returns a database connection to MongoDB
* @param {string} mongoURI
* @param {string} databaseName
* @return {MongoClient}
*/
const connectMongo = async (mongoURI, databaseName) => {
const database = await MongoClient.connect(mongoURI, { connectTimeoutMS: 1000 });
const dbo = database.db(databaseName);
return dbo;
}
/**
* getCollection object to interact with MongoDB
* @param {MongoClient} dbo
* @param {string} collection
*/
const getCollection = async (dbo, collection) => {
return await dbo.collection(collection);
}
module.exports = {
connectMongo: connectMongo,
getCollection: getCollection,
}
File renamed without changes.
+44
View File
@@ -0,0 +1,44 @@
const status = require("../util/statuses");
module.exports = (middleware) => {
const router = require("express").Router();
router.use(middleware);
router.get('/home', async (req, res) => {
res.render('home', { user: req.user });
return res.status(status.Ok);
});
router.get('/assets', (req, res) => {
res.render('assets', { user: req.user });
return res.status(status.Ok);
});
router.get('/plans', (req, res) => {
res.render('plans', { user: req.user });
return res.status(status.Ok);
});
router.get('/more', (req, res) => {
res.render('more', { user: req.user });
return res.status(status.Ok);
});
router.get('/profile', (req, res) => {
res.render('profiles', { user: req.user });
return res.status(status.Ok);
});
router.get('/settings', (req, res) => {
res.render('settings', { user: req.user });
return res.status(status.Ok);
});
router.get('/logout', (req, res) => {
req.session.destroy();
return res.redirect('/login');
});
return router;
};
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
Ok: 200,
BadRequest: 400,
Unauthorized: 401,
NotFound: 404,
InternalServerError: 500,
};
+7 -48
View File
@@ -1,41 +1,7 @@
<html>
<head>
<title>RCalculator</title>
<link rel="icon" href="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@3.3.2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="bg-white dark:bg-gray-900">
<header>
<nav class="bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<a href="#" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" class="h-8" alt="Flowbite Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RCalculator</span>
</a>
<button data-collapse-toggle="navbar-solid-bg" type="button" class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" aria-controls="navbar-solid-bg" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/>
</svg>
</button>
<div class="hidden w-full md:block md:w-auto" id="navbar-solid-bg">
<ul class="flex flex-col font-medium mt-4 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-transparent dark:bg-gray-800 md:dark:bg-transparent dark:border-gray-700">
<li>
<a href="/landing" class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Home</a>
</li>
<li>
<a href="/aboutUs" class="block py-2 px-3 md:p-0 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:dark:text-blue-500 dark:bg-blue-600 md:dark:bg-transparent" aria-current="page">About Us</a>
</li>
<li>
<a href="mailto:rcalculator@gmail.com" class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Contact us</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<main>
<section class="bg-white dark:bg-gray-900 py-12 md:py-20">
<div class="max-w-screen-lg mx-auto px-4 text-center">
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-gray-900 md:text-5xl lg:text-6xl dark:text-white">About RCalculator</h1>
@@ -60,7 +26,7 @@
</div>
</div>
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
<a href="/login" class="inline-flex justify-center items-center mt-4 py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
<a href="/signup" class="inline-flex justify-center items-center mt-4 py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
Get started
<svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
@@ -68,13 +34,6 @@
</a>
</div>
</section>
</main>
<footer class="bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script>
</body>
</html>
</main>
<%- include("./partials/footer") %>
+9
View File
@@ -0,0 +1,9 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
The Assets Page
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+10
View File
@@ -0,0 +1,10 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
Welcome: <%= user.email %>
The Dashboard Page
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+9 -12
View File
@@ -1,12 +1,9 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<h1>Welcome!</h1>
<form method="get" action="/signup">
<button type="submit">signup</button>
</form>
</body>
</html>
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
The Index Page
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+8 -48
View File
@@ -1,46 +1,13 @@
<html>
<head>
<title>RCalculator</title>
<link rel="icon" href="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png">
<link href="https://cdn.jsdelivr.net/npm/tailwindcss@3.3.2/dist/tailwind.min.css" rel="stylesheet">
</head>
<body class="bg-white dark:bg-gray-900">
<header>
<nav class="bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<a href="#" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" class="h-8" alt="Flowbite Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RCalculator</span>
</a>
<button data-collapse-toggle="navbar-solid-bg" type="button" class="inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" aria-controls="navbar-solid-bg" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg class="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"/>
</svg>
</button>
<div class="hidden w-full md:block md:w-auto" id="navbar-solid-bg">
<ul class="flex flex-col font-medium mt-4 rounded-lg bg-gray-50 md:space-x-8 rtl:space-x-reverse md:flex-row md:mt-0 md:border-0 md:bg-transparent dark:bg-gray-800 md:dark:bg-transparent dark:border-gray-700">
<li>
<a href="/landing" class="block py-2 px-3 md:p-0 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:dark:text-blue-500 dark:bg-blue-600 md:dark:bg-transparent" aria-current="page">Home</a>
</li>
<li>
<a href="/aboutUs" class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">About Us</a>
</li>
<li>
<a href="mailto:rcalculator@gmail.com" class="block py-2 px-3 md:p-0 text-gray-900 rounded hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 dark:text-white md:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent">Contact us</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
<main>
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
<main>
<section class="bg-center bg-no-repeat bg-cover bg-[url('/images/bg1.jpg')] bg-gray-400 bg-blend-multiply">
<div class="px-4 mx-auto max-w-screen-xl text-center py-24 lg:py-56">
<h1 class="mb-4 text-4xl font-extrabold tracking-tight leading-none text-white md:text-5xl lg:text-6xl">Plan now, live better.</h1>
<p class="mb-8 text-lg font-normal text-gray-300 lg:text-xl sm:px-16 lg:px-48">Planning your retirement is a crucial step towards financial security and a happy future.</p>
<div class="flex flex-col space-y-4 sm:flex-row sm:justify-center sm:space-y-0">
<a href="/login" class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
<a href="/signup" class="inline-flex justify-center items-center py-3 px-5 text-base font-medium text-center text-white rounded-lg bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-900">
Get started
<svg class="w-3.5 h-3.5 ms-2 rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 10">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 5h12m0 0L9 1m4 4L9 9"/>
@@ -52,13 +19,6 @@
</div>
</div>
</section>
</main>
<footer class="bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</footer>
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script>
</body>
</html>
</main>
<%- include("./partials/footer") %>
+44
View File
@@ -0,0 +1,44 @@
<%- include("./partials/fileHeader") %>
<main>
<div class="flex justify-center items-center h-screen">
<form action="/login" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold"> Login </h1>
<hr class="mt-3">
<div class="mt-3">
<label for="email" class="block text-base mb-2">Email</label>
<input type="text" id="email" name="email"
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Email" />
</div>
<div class="mt-3">
<label for="password" class="block text-base mb-2">Password</label>
<input type="password" id="password" name="password"
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
</div>
<div class="text-red-800 font-bold" id="forgor"> <%= errMessage %></div>
<div class="mt-3 flex justify-between items-center">
<div>
<input type="checkbox">
<label>Remember me</label>
</div>
<div>
<a href="#" class="text-indigo-600 font-semibold">Forgot Password? </a>
</div>
</div>
<div class="mt-5">
<button type="submit"
class="border-2 border-gray-600 bg-blue-600 text-white py-1 w-full rounded-md hover:bg-transparent hover:text-indigo-700 font-semibold">Login</button>
</div>
<div class="mt-5 block justify-between items-center">
<label>Don't have an account?</label>
<a href="/signup" class="text-indigo-600 font-semibold">Register</a>
</div>
</div>
</form>
</div>
</main>
<%- include("./partials/footer") %>
+10
View File
@@ -0,0 +1,10 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
The More Page
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+10
View File
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<script src="https://cdn.jsdelivr.net/npm/@tailwindcss/browser@4"></script>
<title>RCalculator</title>
</head>
<body class="bg-white dark:bg-gray-900">
+10
View File
@@ -0,0 +1,10 @@
<footer>
<div class="fixed bottom-0 left-0 z-50 hidden lg:block w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 p-6 text-center text-gray-500 dark:text-gray-400 text-sm">
<div class="container mx-auto">
<p>&copy; 2025 RCalculator. All rights reserved.</p>
</div>
</div>
</footer>
</body>
</html>
+29
View File
@@ -0,0 +1,29 @@
<header>
<nav class="bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<a href="/home" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" class="h-8" alt="Flowbite Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RCalculator</span>
</a>
<div class="hidden w-full lg:block lg:w-auto" id="navbar-solid-bg">
<ul class="flex flex-col font-medium mt-4 rounded-lg bg-gray-50 lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 lg:bg-transparent dark:bg-gray-800 lg:dark:bg-transparent dark:border-gray-700">
<li>
<a href="/home" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Dashboard</a>
</li>
<li>
<a href="/assets" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Assets</a>
</li>
<li>
<a href="/plans" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Plans</a>
</li>
<li>
<a href="/more" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">More</a>
</li>
<li>
<a href="/logout" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Logout</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
+32
View File
@@ -0,0 +1,32 @@
<header>
<nav class="bg-gray-50 dark:bg-gray-800 border-b border-gray-200 dark:border-gray-700">
<div class="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4">
<a href="/" class="flex items-center space-x-3 rtl:space-x-reverse">
<img src="https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/rekor.png" class="h-8" alt="Flowbite Logo" />
<span class="self-center text-2xl font-semibold whitespace-nowrap dark:text-white">RCalculator</span>
</a>
<button data-collapse-toggle="navbar-solid-bg" type="button"
class="inline-flex items-center justify-center text-sm text-gray-500 rounded-lg lg:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600"
aria-controls="navbar-solid-bg" aria-expanded="false">
<span class="sr-only">Open main menu</span>
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="none" viewBox="0 0 17 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
d="M1 1h15M1 7h15M1 13h15" />
</svg>
</button>
<div class="hidden w-full lg:block lg:w-auto" id="navbar-solid-bg">
<ul class="flex flex-col font-medium mt-4 rounded-lg bg-gray-50 lg:space-x-8 rtl:space-x-reverse lg:flex-row lg:mt-0 lg:border-0 lg:bg-transparent dark:bg-gray-800 lg:dark:bg-transparent dark:border-gray-700">
<li>
<a href="/" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Home</a>
</li>
<li>
<a href="/login" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Login</a>
</li>
<li>
<a href="mailto:rcalculator@gmail.com" class="block py-2 px-3 lg:p-0 text-gray-900 rounded hover:bg-gray-100 lg:hover:bg-transparent lg:border-0 lg:hover:text-blue-700 dark:text-white lg:dark:hover:text-blue-500 dark:hover:bg-gray-700 dark:hover:text-white lg:dark:hover:bg-transparent">Contact us</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
+29
View File
@@ -0,0 +1,29 @@
<div class="fixed bottom-0 left-0 z-50 lg:hidden w-full h-16 bg-gray-100 dark:bg-gray-800 border-t border-gray-200 dark:border-gray-700 text-gray-500 dark:text-gray-400 text-sm">
<div class="grid h-16 max-w-lg grid-cols-4 mx-auto font-medium">
<a href="/home" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" viewBox="0 0 24 24">
<path fill-rule="evenodd" d="M11.293 3.293a1 1 0 0 1 1.414 0l6 6 2 2a1 1 0 0 1-1.414 1.414L19 12.414V19a2 2 0 0 1-2 2h-3a1 1 0 0 1-1-1v-3h-2v3a1 1 0 0 1-1 1H7a2 2 0 0 1-2-2v-6.586l-.293.293a1 1 0 0 1-1.414-1.414l2-2 6-6Z" clip-rule="evenodd"/>
</svg>
<span class="text-gray-500 dark:text-gray-400 text-sm">Dashboard</span>
</a>
<a href="/assets" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" viewBox="0 0 24 24" aria-hidden="true">
<path d="M10.464 8.746c.227-.18.497-.311.786-.394v2.795a2.252 2.252 0 0 1-.786-.393c-.394-.313-.546-.681-.546-1.004 0-.323.152-.691.546-1.004ZM12.75 15.662v-2.824c.347.085.664.228.921.421.427.32.579.686.579.991 0 .305-.152.671-.579.991a2.534 2.534 0 0 1-.921.42Z" />
<path fill-rule="evenodd" d="M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25ZM12.75 6a.75.75 0 0 0-1.5 0v.816a3.836 3.836 0 0 0-1.72.756c-.712.566-1.112 1.35-1.112 2.178 0 .829.4 1.612 1.113 2.178.502.4 1.102.647 1.719.756v2.978a2.536 2.536 0 0 1-.921-.421l-.879-.66a.75.75 0 0 0-.9 1.2l.879.66c.533.4 1.169.645 1.821.75V18a.75.75 0 0 0 1.5 0v-.81a4.124 4.124 0 0 0 1.821-.749c.745-.559 1.179-1.344 1.179-2.191 0-.847-.434-1.632-1.179-2.191a4.122 4.122 0 0 0-1.821-.75V8.354c.29.082.559.213.786.393l.415.33a.75.75 0 0 0 .933-1.175l-.415-.33a3.836 3.836 0 0 0-1.719-.755V6Z" clip-rule="evenodd" />
</svg>
<span class="text-gray-500 dark:text-gray-400 text-sm">Assets</span>
</a>
<a href="/plans" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<svg xmlns="http://www.w3.org/2000/svg" width="30" height="30" fill="currentColor" viewBox="0 0 24 24">
<path d="M13.09 3.294c1.924.95 3.422 1.69 5.472.692a1 1 0 0 1 1.438.9v9.54a1 1 0 0 1-.562.9c-2.981 1.45-5.382.24-7.25-.701a38.739 38.739 0 0 0-.622-.31c-1.033-.497-1.887-.812-2.756-.77-.76.036-1.672.357-2.81 1.396V21a1 1 0 1 1-2 0V4.971a1 1 0 0 1 .297-.71c1.522-1.506 2.967-2.185 4.417-2.255 1.407-.068 2.653.453 3.72.967.225.108.443.216.655.32Z"/>
</svg>
<span class="text-gray-500 dark:text-gray-400 text-sm">Plans</span>
</a>
<a href="/more" class="inline-flex flex-col items-center justify-center px-5 hover:bg-gray-50 dark:hover:bg-gray-800 group">
<svg height="30" width="30" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 17 14">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M1 1h15M1 7h15M1 13h15"></path>
</svg>
<span class="text-gray-500 dark:text-gray-400 text-sm">More</span>
</a>
</div>
</div>
+9
View File
@@ -0,0 +1,9 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
The Plans Page
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>
+39 -8
View File
@@ -1,9 +1,40 @@
<!DOCTYPE html>
<html>
<head>
<%- include("./partials/fileHeader") %>
<%- include("./partials/headerStart") %>
</head>
<body>
<h1>SIGNUP</h1>
</body>
</html>
<main>
<div class="flex justify-center items-center h-screen">
<form action="/signup" method="POST">
<div class="w-96 p-6 shadow-1g bg-white rounded-md">
<h1 class="text-3xl block text-center font-semibold"> Signup </h1>
<hr class="mt-3">
<div class="mt-3">
<label for="email" class="block text-base mb-2">Email</label>
<input type="text" id="email" name="email"
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Email" />
</div>
<div class="mt-3">
<label for="password" class="block text-base mb-2">Password</label>
<input type="password" id="password" name="password"
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
<label for="password" class="block text-base mb-2 mt-3">Re-type Password</label>
<input type="password" id="repassword" name="repassword"
class="border focus:border-gray-600 w-full text-base px-2 py-1 focus:outline-none focus:ring-0 "
placeholder="Enter Password" />
</div>
<div class="text-red-800 font-bold " id="forgor"> <%= errMessage %></div>
<div class="mt-5">
<button type="submit"
class="border-2 border-gray-600 bg-blue-600 text-white py-1 w-full rounded-md hover:bg-transparent hover:text-indigo-700 font-semibold">Signup</button>
</div>
<div class="mt-5 block justify-between items-center">
<label>Already have an account?</label>
<a href="/login" class="text-indigo-600 font-semibold">Login</a>
</div>
</div>
</form>
</div>
</main>
<%- include("./partials/footer") %>
+9
View File
@@ -0,0 +1,9 @@
<%- include("./partials/fileHeader") %>
<%- include("./partials/header") %>
<main>
<!-- Your content here -->
</main>
<%- include("./partials/navBar") %>
<%- include("./partials/footer") %>