-
Notifications
You must be signed in to change notification settings - Fork 96
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
Main #196
base: main
Are you sure you want to change the base?
Main #196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉 Thank you @snehas-05 for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better
@Harshdev098 kindly have a look on this pr once. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Don't make another server(app.js) include it in the server.js file and make new endpoints for badges including making of badges and giving acheivements badges to user
- Remove the config folder its already there implemented
- Remove the package.json file because there will be only one server for now
- You have not integrated the backend with frontend so remove the files in the views folder(layout,profile). We will improve it to integrate it in better ways
- Also please sync fork and update your clone with updated branch code
Hey @Harshdev098 I have made all the necessary changes you asked me to do, committed them and synced also. Now do I need to create a new pr? Or is this pr sufficient? |
It's sufficient |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove the controller folder you have implemented the same thing in the badges.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove the styles.css
- Also you can remove the models folder because we are have config folder to connect with the database you can export that function to use here
@@ -14,6 +14,29 @@ const { allot, DisplayPapers } = require("../stakeholder/allotment"); | |||
const { Dis_fac_papers, fac_signup, fac_login, dis_mail, giverating } = require("../stakeholder/faculty"); | |||
const app = express(); | |||
|
|||
const mysql = require('mysql2'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of importing mysql module you can import the function in the config folder of main branch
database: process.env.DB_NAME | ||
}); | ||
|
||
db.connect((err) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the function in the config folder will connect to the database remove these lines of code to connect the db
Also remove the modules folder as I said the db connection is build using the config folder @snehas-05 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also delete the sql file instead of writing sql queries in this file include it in the readme file under running the application
Just add the badges table creation and student badges creation sql queries
badges_engagement/sql script
Outdated
-- Select the database to use | ||
USE research_nexas; | ||
|
||
-- Create the 'student' table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Delete this table its already created
@snehas-05 Please! Before opening a PR make sure that your fork is synced and clone is up to date with the main branch of the repo |
@snehas-05 The changes are not satisfactory, many changes are required to accomplish this feature. |
From my side all the changes you requested I have made. |
@Harshdev098 I'm so sorry for all the mess I have removed the unnecessary queries syntax. And for this db code I think this file is not mine.(The code in this is not written by me) |
@Harshdev098 ?. |
Issue number #185
This pull request introduces a Profile Badges and Achievements system to enhance student engagement and motivation on the Research-Nexas platform. The feature allows students to earn badges for significant accomplishments, such as submitting research papers, achieving high evaluation scores, and actively participating in peer reviews and collaborations.
Key Features
Badge Creation: Admins can create badges with specific criteria.
Awarding Badges: Badges can be awarded to students based on their achievements.
Viewing Badges: Students can view all badges available and those they have earned.
Database Integration: New tables for badges and student-badge relationships have been added to the MySQL database.
Instructions for Implementation-
Database Setup: Execute the provided SQL statements to create the badges and student_badges tables in your MySQL database.
Ensure that your database connection in config/db.js is properly configured to communicate with your MySQL server.
Connect Routes: Import the badges route in your main application file (e.g., app.js)
const badgesRouter =require('./routes/badges');
app.use('/api/badges', badgesRouter);
Testing the API: Use Postman or a similar tool to test the following endpoints:
POST /api/badges/create: Create a new badge.
GET /api/badges: Retrieve all badges.
POST /api/badges/award: Award a badge to a student.
GET /api/badges/:studentId: Retrieve badges for a specific student.
I know you’re already familiar with these instructions, but I’m including them here to ensure a smooth running of the feature. Please review the code changes thoroughly and let me know if you have any questions or need further modifications. Thankyou.
✅ Checklist
Before submitting the PR, please make sure you have completed the following:
🏷️ Types of Changes
What type of changes does your code introduce? (Check all that apply)