Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Front end branch #75

Open
wants to merge 40 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
41ad2ec
add transaction modal skeleton added
affat25 Nov 24, 2022
3227834
Add Transaction complete,CSS left
affat25 Nov 25, 2022
cab4492
minor changes
affat25 Nov 25, 2022
5a4a64b
two columns of T account added
affat25 Nov 29, 2022
2622040
Add files via upload
Code1Here Nov 30, 2022
ce74466
App UI overview
Code1Here Nov 30, 2022
53184cb
Delete Contador.drawio
Code1Here Nov 30, 2022
d5a9ebc
App UI Overview
Code1Here Nov 30, 2022
721edf5
Next feature to add
Code1Here Nov 30, 2022
7a430fe
Database tables or schema
Code1Here Nov 30, 2022
46e00bd
Transaction name, price and date
Code1Here Nov 30, 2022
683c69b
Delete AboutUsPage.js
Code1Here Nov 30, 2022
7cd3a4c
About Us
Code1Here Nov 30, 2022
b830bf8
pushed edits
affat25 Dec 3, 2022
8deba87
Merge branch 'main' of https://github.com/affat25/Contador
affat25 Dec 3, 2022
9119234
small changes
affat25 Dec 3, 2022
8996855
fixed positions
affat25 Dec 3, 2022
5e3bbb8
aligned components properly
affat25 Dec 3, 2022
f0ecd99
balance and Target updated
affat25 Dec 3, 2022
7a3fef0
Models, About Usc, Sign up, Posts
Code1Here Dec 4, 2022
9fc3eda
Controller set up
Code1Here Dec 4, 2022
6bbb7c0
Hashing passwords in db
Code1Here Dec 4, 2022
1d15a73
hashing functions if needed
Code1Here Dec 4, 2022
96601ad
Content/micropost needs to be unique categories
Code1Here Dec 4, 2022
e9e4aad
transaction is history of a particular category
Code1Here Dec 4, 2022
3ef4de8
email must be unique
Code1Here Dec 4, 2022
8376abf
add transaction working, waiting on backend
affat25 Dec 4, 2022
e3aac2d
removed useless project starter code
affat25 Dec 4, 2022
83813b4
Added delete functionality
affat25 Dec 5, 2022
b0178db
minor changes
affat25 Dec 5, 2022
1a6d720
Merge branch 'main' into Front-end-branch
affat25 Dec 5, 2022
555d0c5
Merge pull request #1 from affat25/Front-end-branch
affat25 Dec 5, 2022
38e81a9
minor changes
affat25 Dec 5, 2022
9884988
Merged Anthony's Code into my Repo
affat25 Dec 5, 2022
5911e69
minor changes
affat25 Dec 5, 2022
24f9c41
Merge branch 'Code1Here-main'
affat25 Dec 5, 2022
049823f
minor change
affat25 Dec 5, 2022
4068931
navigation bar added
affat25 Dec 6, 2022
07fcb2a
category functionality added, merge with backend
affat25 Dec 6, 2022
3289379
Merge branch 'main' into Front-end-branch
affat25 Dec 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Contador schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Contador.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2022-11-30T15:07:34.029Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/18.0.1 Chrome/100.0.4896.143 Electron/18.2.0 Safari/537.36" etag="PwzccUfKJPjvsbkQuOR0" version="18.0.1" type="device"><diagram id="iLMtCZy83B022JAi_okA" name="Page-1">5ZvbctsoGICfxtOrZizQyZdxHLuzPUymyUzbvdnBEpbpSsJFuLb79AUL2ZagjneiCGVz44gfgdAH/CeUAbzJtjOGVsuPNMbpAAzj7QBOBgA4nu+KP1KyUxLHC0tJwkisZEfBPfmFlXCopGsS46J2I6c05WRVF0Y0z3HEazLEGN3Ub1vQtP7UFUqwJriPUKpLv5CYL0tp6A2P8neYJMvqyc5Q1WSoulkJiiWK6eZEBG8H8IZRysurbHuDU0mv4lK2m/6h9jAwhnN+SYMf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ef8Ebc8YXk8lslVSkedqh/NcbRDx83jk63xlGP3QVrlMuVPpxStkEsftqab6STFosFiCJTOin2577XUjpJz5MAw7nXKLgyJUqejbWuex9KI9sq4DDCZsDzUPjRw5bydSG8cmCdcKgTdrsl7F4Q8VlwAkAY1kj5hrXYcc7O7WHUB6HX2LSB9bjP1eO+PnIKrHO64Jss+5zCoXVO+oFNHzlB65x6+OWagZNvnVMPz14MnKyfvrj66Ysxf5fRnC/fFINXmr2DjmZaDJ9nHj4AfmKIIorHf1Upj8SP//EDb38D</diagram></mxfile>
1 change: 1 addition & 0 deletions Next Commit.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="Electron" modified="2022-11-30T15:07:52.243Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/18.0.1 Chrome/100.0.4896.143 Electron/18.2.0 Safari/537.36" etag="KI66o8E3C2q3j9NScZ_q" version="18.0.1" type="device"><diagram id="XMUIoXUdUy_daLNq1y6U" name="Page-1">7Vldk5owFP01PLoDCUR5XFG2nXa7ne52+xwlSlogNMRV++sbIChfdvaDrN1OfTGeJDfJuefeXMGAXry74jgNr1lAIgOYwc6AMwMAgMyx/MqRfYlMoFkCa06DErKOwC39RRRYDdvQgGSNgYKxSNC0CS5ZkpClaGCYc7ZtDluxqLlqitekA9wucdRFv9FAhOoUjnnE3xG6DquVLVP1xLgarIAsxAHb1iA4N6DHGRNlK955JMrJq3gp5/kneg8b4yQRj5lA7+cCpDPmwP304TpbfZhd+SNl5QFHG3VgA6BI2psuZGOdNypgxeQ68hhir7hBPzes6hhlhecu5QCA0l05TfVXhm5SQVkiR9xtWWVUbre021xLwrX1QWNZIMgux0MRRxKwZBNHdJ3I9lJSQbgEHggXVDrxUnXENAjy6VNO5EbxojBlyt8po4koJOJMDWeW29oIVh6mMJ0Jzn4Qj0VM2p0lLMmtrGgUtSF5CqVeAA+7rnunolpujexqkPLWFWExEXwvh6heWIWKCh0L2QrYHpVoIYWFNRVWE7ES//pg+6gP2VASeYJcQI9cWt7hbJMEJFD8bkMqyG2Kl3nvVqaIpuNKdqvAGoi3Q+6oeBtbXd5ss4c3CzmaiIMDE9eWW1OmBoC+PzFNUxvFbWmOAbwYOx2WodPDMtKlTvtkMstSnPTmroLmUVbynGevlJPe5CW/JatuM0eVZpup6/9Sf/9SMyyIjvirR1knIhHyfYR0xZ8LLs4dfs7Tw69dOsATpUNIKT0pm5dfQC0v+b62vInafoN9fuu70+3DwMEdh/Q5LuVUMv8qnvN9z5sjXZ5zzAP/f/ad4+jyXRLsghFDy8xyP967fHv79ea7poqsRqtZfLQFBGgFBBx3azXo9sTDZIA01svo0KXaI64G31cc67ga4KTLKLA1XQy9jHbrsjuOkwwvy/+Dr15hLHiFfMIxOcMGXmUpzZrNFVtclENo1m5r1u1qti8J2Lok+4xa5k3K5HN5P2vWiue57lBage0S6uxaeUb59Ca18vJ/TY+6CieDXYW2O27XbGcXy/ikWJ7/wPVU8T17fy+bOM69kCyytOgy29Ddl/n8n3scO0SicdqJBna1Y8Ee8YCni0f+PL4JKPpq71Pg/Dc=</diagram></mxfile>
77 changes: 77 additions & 0 deletions api/controllers/goals.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const express = require("express");
const router = express.Router();
const db = require("../models");
const { Goal } = db;

// This is a simple example for providing basic CRUD routes for
// a resource/model. It provides the following:
// GET /api/goal
// POST /api/goal
// GET /api/goal/:id
// PUT /api/goal/:id
// DELETE /api/goal/:id
//
// The full URL's for these routes are composed by combining the
// prefixes used to load the controller files.
// /api comes from the file ../app.js
// /goal comes from the file ./goals.js

router.get("/", (req, res) => {
Goal.findAll({}).then((allPosts) => res.json(allPosts));
});

router.post("/", (req, res) => {
let { content } = req.body;

Goal.create({ content })
.then((newPost) => {
res.status(201).json(newPost);
})
.catch((err) => {
res.status(400).json(err);
});
});

router.get("/:id", (req, res) => {
const { id } = req.params;
Goal.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

res.json(mpost);
});
});

router.put("/:id", (req, res) => {
const { id } = req.params;
Goal.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.content = req.body.content;
mpost
.save()
.then((updatedPost) => {
res.json(updatedPost);
})
.catch((err) => {
res.status(400).json(err);
});
});
});

router.delete("/:id", (req, res) => {
const { id } = req.params;
Goal.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.destroy();
res.sendStatus(204);
});
});

module.exports = router;
22 changes: 18 additions & 4 deletions api/controllers/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
const express = require("express");
const router = express.Router();

// Load each controller
// Mount each controller under a specific route. These will be prefixes to all routes defined inside the controller
// This'll be at api/micro_posts
const microPostsController = require("./microPosts.js");

// Mount each controller under a specific route. These
// will be prefixes to all routes defined inside the controller
router.use("/micro_posts", microPostsController);

// This'll be at api/profile
// const profileController = require("./profiles.js")
// router.use("/profile", profileController);

// This'll be at api/transaction
const transactionController = require("./transactions.js");
router.use("/transaction", transactionController);

// This'll be at api/login
const loginController = require("./logins.js");
router.use("/login", loginController);

// This'll be at api/goal
const goalController = require("./goals.js");
router.use("/goal", goalController);

module.exports = router;
77 changes: 77 additions & 0 deletions api/controllers/logins.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const express = require("express");
const router = express.Router();
const db = require("../models");
const { Login } = db;

// This is a simple example for providing basic CRUD routes for
// a resource/model. It provides the following:
// GET /api/login
// POST /api/login
// GET /api/login/:id
// PUT /api/login/:id
// DELETE /api/login/:id
//
// The full URL's for these routes are composed by combining the
// prefixes used to load the controller files.
// /api comes from the file ../app.js
// /login comes from the file ./logins.js

router.get("/", (req, res) => {
Login.findAll({}).then((allPosts) => res.json(allPosts));
});

router.post("/", (req, res) => {
let { content } = req.body;

Login.create({ content })
.then((newPost) => {
res.status(201).json(newPost);
})
.catch((err) => {
res.status(400).json(err);
});
});

router.get("/:id", (req, res) => {
const { id } = req.params;
Login.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

res.json(mpost);
});
});

router.put("/:id", (req, res) => {
const { id } = req.params;
Login.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.content = req.body.content;
mpost
.save()
.then((updatedPost) => {
res.json(updatedPost);
})
.catch((err) => {
res.status(400).json(err);
});
});
});

router.delete("/:id", (req, res) => {
const { id } = req.params;
Login.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.destroy();
res.sendStatus(204);
});
});

module.exports = router;
77 changes: 77 additions & 0 deletions api/controllers/profiles.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const express = require("express");
const router = express.Router();
const db = require("../models");
const { Profile } = db;

// This is a simple example for providing basic CRUD routes for
// a resource/model. It provides the following:
// GET /api/profile
// POST /api/profile
// GET /api/profile/:id
// PUT /api/profile/:id
// DELETE /api/profile/:id
//
// The full URL's for these routes are composed by combining the
// prefixes used to load the controller files.
// /api comes from the file ../app.js
// /profile comes from the file ./profiles.js

router.get("/", (req, res) => {
Profile.findAll({}).then((allPosts) => res.json(allPosts));
});

router.post("/", (req, res) => {
let { content } = req.body;

Profile.create({ content })
.then((newPost) => {
res.status(201).json(newPost);
})
.catch((err) => {
res.status(400).json(err);
});
});

router.get("/:id", (req, res) => {
const { id } = req.params;
Profile.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

res.json(mpost);
});
});

router.put("/:id", (req, res) => {
const { id } = req.params;
Profile.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.content = req.body.content;
mpost
.save()
.then((updatedPost) => {
res.json(updatedPost);
})
.catch((err) => {
res.status(400).json(err);
});
});
});

router.delete("/:id", (req, res) => {
const { id } = req.params;
Profile.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.destroy();
res.sendStatus(204);
});
});

module.exports = router;
79 changes: 79 additions & 0 deletions api/controllers/transactions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
import { v4 as uuid } from 'uuid';

const express = require("express");
const router = express.Router();
const db = require("../models");
const { Transaction } = db;

// This is a simple example for providing basic CRUD routes for
// a resource/model. It provides the following:
// GET /api/transaction
// POST /api/transaction
// GET /api/transaction/:id
// PUT /api/transaction/:id
// DELETE /api/transaction/:id
//
// The full URL's for these routes are composed by combining the
// prefixes used to load the controller files.
// /api comes from the file ../app.js
// /transaction comes from the file ./transactions.js

router.get("/", (req, res) => {
Transaction.findAll({}).then((allPosts) => res.json(allPosts));
});

router.post("/", (req, res) => {
let { content } = req.body;

Transaction.create({ content })
.then((newPost) => {
res.status(201).json(newPost);
})
.catch((err) => {
res.status(400).json(err);
});
});

router.get("/:id", (req, res) => {
const { id } = req.params;
Transaction.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

res.json(mpost);
});
});

router.put("/:id", (req, res) => {
const { id } = req.params;
Transaction.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.content = req.body.content;
mpost
.save()
.then((updatedPost) => {
res.json(updatedPost);
})
.catch((err) => {
res.status(400).json(err);
});
});
});

router.delete("/:id", (req, res) => {
const { id } = req.params;
Transaction.findByPk(id).then((mpost) => {
if (!mpost) {
return res.sendStatus(404);
}

mpost.destroy();
res.sendStatus(204);
});
});

module.exports = router;
39 changes: 39 additions & 0 deletions api/models/Goal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"use strict";
const { Model } = require("sequelize");

module.exports = (sequelize, DataTypes) => {
class Goal extends Model {}

Goal.init(
{
targetDate: {
type: DataTypes.DATEONLY,
validate: {
isDate: true,
},
},
targetFund: {
type: DataTypes.FLOAT,
validate: {
isNumeric: true,
},
},
totalMinusIncome: {
type: DataTypes.FLOAT,
validate: {
isNumeric: true,
},
},
},
{
sequelize,
modelName: "Goal",
}
);

Goal.associate = (models) => {
// associations can be defined here
};

return Goal;
};
Loading