Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
Yash-Ainapure authored Nov 2, 2024
2 parents e209dee + 393c493 commit 1adfd43
Show file tree
Hide file tree
Showing 54 changed files with 13,786 additions and 713 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Keep Backend Alive

on:
schedule:
# Runs every 1 minute
- cron: '*/5 * * * *'

jobs:
ping-backend:
runs-on: ubuntu-latest
steps:
- name: Send ping to backend
run: |
curl -X GET "https://dypcetclubs-live.onrender.com/api/clubs/getcron"
83 changes: 45 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,17 +145,17 @@ We are grateful to all the contributors who have helped improve this project. Yo
</a>
</td>
<td align="center">
<a href="https://github.com/prateek2102">
<img src="https://avatars.githubusercontent.com/u/130992856?v=4" width="100;" alt="prateek2102"/>
<a href="https://github.com/Hh440">
<img src="https://avatars.githubusercontent.com/u/91595810?v=4" width="100;" alt="Hh440"/>
<br />
<sub><b>Prateek </b></sub>
<sub><b>Harsh</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/varma-101">
<img src="https://avatars.githubusercontent.com/u/138625491?v=4" width="100;" alt="varma-101"/>
<a href="https://github.com/Laxmi01345">
<img src="https://avatars.githubusercontent.com/u/122423386?v=4" width="100;" alt="Laxmi01345"/>
<br />
<sub><b>SAGI VENKATA NAGA GOPAL VARMA</b></sub>
<sub><b>Laxmi Ray</b></sub>
</a>
</td>
</tr>
Expand All @@ -168,47 +168,47 @@ We are grateful to all the contributors who have helped improve this project. Yo
</a>
</td>
<td align="center">
<a href="https://github.com/Laxmi01345">
<img src="https://avatars.githubusercontent.com/u/122423386?v=4" width="100;" alt="Laxmi01345"/>
<a href="https://github.com/varma-101">
<img src="https://avatars.githubusercontent.com/u/138625491?v=4" width="100;" alt="varma-101"/>
<br />
<sub><b>Laxmi Ray</b></sub>
<sub><b>SAGI VENKATA NAGA GOPAL VARMA</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Hh440">
<img src="https://avatars.githubusercontent.com/u/91595810?v=4" width="100;" alt="Hh440"/>
<a href="https://github.com/prateek2102">
<img src="https://avatars.githubusercontent.com/u/130992856?v=4" width="100;" alt="prateek2102"/>
<br />
<sub><b>Harsh</b></sub>
<sub><b>Prateek </b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/im-amanjai">
<img src="https://avatars.githubusercontent.com/u/145966547?v=4" width="100;" alt="im-amanjai"/>
<a href="https://github.com/sps234">
<img src="https://avatars.githubusercontent.com/u/141764206?v=4" width="100;" alt="sps234"/>
<br />
<sub><b>im-amanjai</b></sub>
<sub><b>Saumya Pratap Singh</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/ZayedShahcode">
<img src="https://avatars.githubusercontent.com/u/115407231?v=4" width="100;" alt="ZayedShahcode"/>
<a href="https://github.com/Sourabh782">
<img src="https://avatars.githubusercontent.com/u/103349890?v=4" width="100;" alt="Sourabh782"/>
<br />
<sub><b>Zayed</b></sub>
<sub><b>Sourabh Singh Rawat</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/vivekrawat21">
<img src="https://avatars.githubusercontent.com/u/116631005?v=4" width="100;" alt="vivekrawat21"/>
<a href="https://github.com/sushil-sagar05">
<img src="https://avatars.githubusercontent.com/u/169032900?v=4" width="100;" alt="sushil-sagar05"/>
<br />
<sub><b>Vivek Rawat</b></sub>
<sub><b>Sushil Sagar</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/vedhcet-07">
<img src="https://avatars.githubusercontent.com/u/176995332?v=4" width="100;" alt="vedhcet-07"/>
<a href="https://github.com/Swetabh333">
<img src="https://avatars.githubusercontent.com/u/109225662?v=4" width="100;" alt="Swetabh333"/>
<br />
<sub><b>Vishwas M D</b></sub>
<sub><b>Swetabh Shreyam</b></sub>
</a>
</td>
<td align="center">
Expand All @@ -219,35 +219,42 @@ We are grateful to all the contributors who have helped improve this project. Yo
</a>
</td>
<td align="center">
<a href="https://github.com/Swetabh333">
<img src="https://avatars.githubusercontent.com/u/109225662?v=4" width="100;" alt="Swetabh333"/>
<a href="https://github.com/vedhcet-07">
<img src="https://avatars.githubusercontent.com/u/176995332?v=4" width="100;" alt="vedhcet-07"/>
<br />
<sub><b>Swetabh Shreyam</b></sub>
<sub><b>Vishwas M D</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/sushil-sagar05">
<img src="https://avatars.githubusercontent.com/u/169032900?v=4" width="100;" alt="sushil-sagar05"/>
<a href="https://github.com/vivekrawat21">
<img src="https://avatars.githubusercontent.com/u/116631005?v=4" width="100;" alt="vivekrawat21"/>
<br />
<sub><b>Sushil Sagar</b></sub>
<sub><b>Vivek Rawat</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/Sourabh782">
<img src="https://avatars.githubusercontent.com/u/103349890?v=4" width="100;" alt="Sourabh782"/>
<a href="https://github.com/ZayedShahcode">
<img src="https://avatars.githubusercontent.com/u/115407231?v=4" width="100;" alt="ZayedShahcode"/>
<br />
<sub><b>Sourabh Singh Rawat</b></sub>
<sub><b>Zayed</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/sps234">
<img src="https://avatars.githubusercontent.com/u/141764206?v=4" width="100;" alt="sps234"/>
<a href="https://github.com/im-amanjai">
<img src="https://avatars.githubusercontent.com/u/145966547?v=4" width="100;" alt="im-amanjai"/>
<br />
<sub><b>Saumya Pratap Singh</b></sub>
<sub><b>im-amanjai</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/Pruthviraj-sawant">
<img src="https://avatars.githubusercontent.com/u/157594404?v=4" width="100;" alt="Pruthviraj-sawant"/>
<br />
<sub><b>pruthviraj-sawant</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/devxMani">
<img src="https://avatars.githubusercontent.com/u/122438942?v=4" width="100;" alt="devxMani"/>
Expand Down Expand Up @@ -283,15 +290,15 @@ We are grateful to all the contributors who have helped improve this project. Yo
<sub><b>Chetan SIngh</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/jainaryan04">
<img src="https://avatars.githubusercontent.com/u/138214350?v=4" width="100;" alt="jainaryan04"/>
<br />
<sub><b>Aryan Ramesh Jain</b></sub>
</a>
</td>
</tr>
<tr>
<td align="center">
<a href="https://github.com/NK-Works">
<img src="https://avatars.githubusercontent.com/u/132702983?v=4" width="100;" alt="NK-Works"/>
Expand Down
5 changes: 3 additions & 2 deletions backend/dist/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = __importDefault(require("express"));
const cors_1 = __importDefault(require("cors"));
// @ts-ignore
const cookie_parser_1 = __importDefault(require("cookie-parser"));
const env_config_1 = require("./config/env.config");
const index_1 = require("./routes/index");
const database_config_1 = require("./config/database.config");
const app = (0, express_1.default)();
Expand All @@ -39,13 +39,14 @@ app.use((0, cors_1.default)(corsOptions));
app.use((0, cookie_parser_1.default)());
app.use(express_1.default.urlencoded({ extended: true }));
(0, index_1.setupRoutes)(app);
const PORT = env_config_1.config.PORT || 4000;
const PORT = 4000;
function startServer() {
return __awaiter(this, void 0, void 0, function* () {
try {
yield (0, database_config_1.testDatabaseConnection)();
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}`);
console.log("groq api key: ", env_config_1.config.GROQ_API_KEY);
});
}
catch (error) {
Expand Down
10 changes: 9 additions & 1 deletion backend/dist/controllers/club.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.addClubMember = exports.getClubMembers = exports.login = exports.addClub = exports.getClubData = exports.getClubById = exports.getClubByEmail = void 0;
exports.getCronJob = exports.addClubMember = exports.getClubMembers = exports.login = exports.addClub = exports.getClubData = exports.getClubById = exports.getClubByEmail = void 0;
const database_config_1 = require("../config/database.config");
const bcrypt_1 = __importDefault(require("bcrypt"));
const const_1 = require("../config/const");
const logger_1 = __importDefault(require("../config/logger"));
// @ts-ignore
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
const getClubByEmail = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
const { email } = req.body; // Read email from request body
Expand Down Expand Up @@ -143,7 +144,10 @@ const login = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
res.cookie("auth_token", token, {
httpOnly: true,
secure: process.env.NODE_ENV === "production",
sameSite: "none",
});
console.log("secure??: ", process.env.NODE_ENV === "production");
console.log(process.env.NODE_ENV);
res.status(200).json({ message: const_1.MESSAGES.CLUB.LOGIN_SUCCESSFUL, club });
}
catch (error) {
Expand Down Expand Up @@ -218,3 +222,7 @@ const addClubMember = (req, res) => __awaiter(void 0, void 0, void 0, function*
}
});
exports.addClubMember = addClubMember;
const getCronJob = (req, res) => __awaiter(void 0, void 0, void 0, function* () {
res.json({ message: "Cron job running" });
});
exports.getCronJob = getCronJob;
102 changes: 0 additions & 102 deletions backend/dist/index.js

This file was deleted.

3 changes: 3 additions & 0 deletions backend/dist/routes/club.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const club_controller_1 = require("../controllers/club.controller");
// @ts-ignore
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
// @ts-ignore
const cookie_parser_1 = __importDefault(require("cookie-parser"));
const router = (0, express_1.Router)();
router.use((0, cookie_parser_1.default)());
Expand All @@ -27,6 +29,7 @@ const checkAuth = (req, res, next) => {
return res.status(401).json({ message: "Invalid token" });
}
};
router.get("/getcron", club_controller_1.getCronJob);
router.get("/getClubData", club_controller_1.getClubData);
router.post("/addClub", club_controller_1.addClub);
router.post("/addMember", checkAuth, club_controller_1.addClubMember);
Expand Down
2 changes: 2 additions & 0 deletions backend/dist/routes/event.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
// @ts-ignore
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
// @ts-ignore
const cookie_parser_1 = __importDefault(require("cookie-parser"));
const event_controller_1 = require("../controllers/event.controller");
const router = (0, express_1.Router)();
Expand Down
2 changes: 2 additions & 0 deletions backend/dist/routes/quiz.routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
Object.defineProperty(exports, "__esModule", { value: true });
const express_1 = require("express");
const quiz_controller_1 = require("../controllers/quiz.controller");
// @ts-ignore
const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
// @ts-ignore
const cookie_parser_1 = __importDefault(require("cookie-parser"));
const router = (0, express_1.Router)();
router.use((0, cookie_parser_1.default)());
Expand Down
5 changes: 5 additions & 0 deletions backend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1adfd43

Please sign in to comment.