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

Moved YAUS/C4GT'22 repo to current monorepo #69

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
26 changes: 25 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
redis-data
redis.conf
.DS_Store
.DS_Store
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
18 changes: 18 additions & 0 deletions yaus_c4gt_backend/server/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules



# misc
.DS_Store
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
38 changes: 38 additions & 0 deletions yaus_c4gt_backend/server/controllers/data.controller.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const dashboard_table_data = require("../data/dashboard_table_data");
const main_dashboard_chart_data = require("../data/main_dashboard_chart_data");
const url_data = require("../data/Stats_For_Links");
const link_manager_data = require("../data/link_manager_data");
const recent_activity_data = require("../data/recent_activity_data");


const checkAPI = (req, res) => {
res.send("Api is running.");
};

const getDashboardTableData = (req, res) => {
res.set("Access-Control-Allow-Origin", "*");
res.json(dashboard_table_data);
};

const getMainDashboardChartData = (req, res) => {
res.set("Access-Control-Allow-Origin", "*");
res.json(main_dashboard_chart_data);
};

const getLinkManagerData = (req, res) => {
res.set("Access-Control-Allow-Origin", "*");
res.json(link_manager_data);
};

const getRecentActivityData = (req, res) => {
res.set("Access-Control-Allow-Origin", "*");
res.json(recent_activity_data);
};

module.exports = {
checkAPI,
getDashboardTableData,
getRecentActivityData,
getLinkManagerData,
getMainDashboardChartData,
};
77 changes: 77 additions & 0 deletions yaus_c4gt_backend/server/data/Stats_For_Links.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
const url_data=[

{
"customeHashID":'edu34',
"url":" https://yaus.xyz/education",
"date_created":"2022-07-09",
"no_of_clicks_overall":"3",
"no_of_views_overall":"8",
"no_of_opens_overall":"5",
"no_of_installs_overall":"89",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120001",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120002",
"daily_stats":[2,75,26,21,57,42,18],
"monthly_stats":[743,754,53,743,944,34,765,134,895,245,894,224]


},
{
"customeHashID":"gov32",
"url":"https://yaus.xyz/govt",
"date_created":"2022-06-22",
"no_of_clicks_overall":"33",
"no_of_views_overall":"28",
"no_of_opens_overall":"95",
"no_of_installs_overall":"64",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120007",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120003",
"daily_stats":[6,23,86,24,75,24,64],
"monthly_stats":[665,366,246,864,345,45,246,87,456,32,466,753]


},
{
"customeHashID":"des65",
"url":"https://yaus.xyz/design",
"date_created":"2022-07-19",
"no_of_clicks_overall":"34",
"no_of_views_overall":"86",
"no_of_opens_overall":"19",
"no_of_installs_overall":"23",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120008",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120004",
"daily_stats":[55,74,24,5,24,77,33],
"monthly_stats":[854,65,775,223,6565,784,775,24,633,675,687,355]

},
{
"customeHashID":"cre62",
"url":"https://yaus.xyz/create",
"date_created":"2022-07-03",
"no_of_clicks_overall":"31",
"no_of_views_overall":"68",
"no_of_opens_overall":"55",
"no_of_installs_overall":"32",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120009",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120005",
"daily_stats":[46,6,4,66,33,43,45],
"monthly_stats":[73,789,235,76,235,789,432,675,336,643,356,754]

},
{
"customeHashID":"cre31",
"url":" https://yaus.xyz/create",
"date_created":"2022-07-15",
"no_of_clicks_overall":"78",
"no_of_views_overall":"15",
"no_of_opens_overall":"46",
"no_of_installs_overall":"85",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120000",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120006",
"daily_stats":[65,33,76,24,85,25,86],
"monthly_stats":[356,64,78,335,754,23,67,24,687,344,68,245]

}
];

module.exports=url_data;
55 changes: 55 additions & 0 deletions yaus_c4gt_backend/server/data/dashboard_table_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
module.exports=[{
"url":" https://yaus.xyz/education",
"date_created":"2022-07-09",
"no_of_clicks":"3",
"no_of_views":"8",
"no_of_opens":"5",
"no_of_installs":"89",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120001",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120002"

},
{
"url":" https://yaus.xyz/govt",
"date_created":"2022-06-22",
"no_of_clicks":"33",
"no_of_views":"28",
"no_of_opens":"95",
"no_of_installs":"64",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120007",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120003",

},
{
"url":" https://yaus.xyz/design",
"date_created":"2022-07-19",
"no_of_clicks":"34",
"no_of_views":"86",
"no_of_opens":"19",
"no_of_installs":"23",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120008",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120004",

},
{
"url":" https://yaus.xyz/create",
"date_created":"2022-07-03",
"no_of_clicks":"31",
"no_of_views":"68",
"no_of_opens":"55",
"no_of_installs":"32",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120009",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120005",

},
{
"url":" https://yaus.xyz/create",
"date_created":"2022-06-15",
"no_of_clicks":"78",
"no_of_views":"15",
"no_of_opens":"46",
"no_of_installs":"85",
"userID":"0fe6ff38-fc46-11ec-b939-0242ac120000",
"projectID":"0fe6ff38-fc46-11ec-b939-0242ac120006",
}
];
43 changes: 43 additions & 0 deletions yaus_c4gt_backend/server/data/link_manager_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
module.exports=[{
"url":" https://yaus.xyz/sunbird437",
"date_created":"2022-07-09",
"title":"Test",
"no_of_clicks":"335",
"no_of_opens":"144",

},
{
"url":" https://yaus.xyz/sunbird842",
"date_created":"2022-06-22",
"title":"Test",
"no_of_clicks":"125",
"no_of_opens":"110",


},
{
"url":" https://yaus.xyz/sunbird371",
"date_created":"2022-07-19",
"no_of_clicks":"194",
"title":"Test",
"no_of_opens":"139",


},
{
"url":" https://yaus.xyz/sunbird752",
"date_created":"2022-07-03",
"title":"Test",
"no_of_clicks":"168",
"no_of_opens":"128",


},
{
"url":" https://yaus.xyz/create",
"date_created":"2022-06-15",
"no_of_clicks":"178",
"title":"Test",
"no_of_opens":"146",
}
];
37 changes: 37 additions & 0 deletions yaus_c4gt_backend/server/data/main_dashboard_chart_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports=
[

{
"month":"jan",
"url_created":"53"
},
{
"month":"feb",
"url_created":"62"
},
{
"month":"mar",
"url_created":"70"
},
{
"month":"apr",
"url_created":"67"
},
{
"month":"may",
"url_created":"77"
},
{
"month":"jun",
"url_created":"84"
},
{
"month":"jul",
"url_created":"90"
},
{
"month":"aug",
"url_created":"95"
},
]

44 changes: 44 additions & 0 deletions yaus_c4gt_backend/server/data/recent_activity_data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module.exports=[
{
"activity":" https://yaus.xyz/design_draft",
"date_created":"2022-07-19",
"title":"Design Draft",
"name":"Chakshu",
"email":"[email protected]",

},
{
"activity":" https://yaus.xyz/education_proposal",
"date_created":"2022-07-09",
"title":"Education Proposal",
"name":"Kanika",
"email":"[email protected]",


},
{
"activity":" https://yaus.xyz/Tax_bill",
"date_created":"2022-07-03",
"title":"Tax Expense",
"name":"Manav",
"email":"[email protected]",

},

{
"activity":" https://yaus.xyz/govt_docs",
"date_created":"2022-06-22",
"title":"Goverment Docs",
"name":"Akshay",
"email":"[email protected]",

},


{"activity":" https://yaus.xyz/property_stats",
"date_created":"2022-06-15",
"title":"Property Stats",
"name":"Shruti",
"email":"[email protected]",

}]
16 changes: 16 additions & 0 deletions yaus_c4gt_backend/server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
require("dotenv").config();
const express = require("express");
const app = express();
const cors = require("cors");
const bodyParser = require("body-parser");
const dataRouters = require("./routes/data.route");
const PORT = process.env.PORT || 3233;

app.use(cors());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
app.use("/", dataRouters);

app.listen(PORT, () => console.log(`Server running on port ${PORT}`));

module.exports = app;
Loading