Skip to content

Commit

Permalink
commit changes
Browse files Browse the repository at this point in the history
  • Loading branch information
snehas-05 committed Nov 10, 2024
1 parent 184b82c commit 5dc3326
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 146 deletions.
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,51 @@ Follow these steps to run the Research Nexas
password varchar(120) unique,
token varchar(130) not null unique
);
-- Create the database
CREATE DATABASE research_nexas;
-- Select the database to use
USE research_nexas;
-- Create the 'student' table
CREATE TABLE student (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
badge_count INT DEFAULT 0
);
-- Create the 'badges' table
CREATE TABLE badges (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255) NOT NULL,
description TEXT NOT NULL,
criteria VARCHAR(255)
);
-- Create the 'student_badges' table (stores which student earned which badge)
CREATE TABLE student_badges (
id INT AUTO_INCREMENT PRIMARY KEY,
student_id INT NOT NULL,
badge_id INT NOT NULL,
awarded_at DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (student_id) REFERENCES students(id) ON DELETE CASCADE,
FOREIGN KEY (badge_id) REFERENCES badges(id) ON DELETE CASCADE
);
-- Insert some example data into 'student' table
INSERT INTO student (name, email) VALUES ('Alice', '[email protected]');
-- Insert example badges into 'badges' table
INSERT INTO badges (name, description, criteria) VALUES
('Research Contributor', 'Awarded for submitting 5 research papers', 'Submit 5 papers'),
('Peer Reviewer', 'Awarded for completing 10 peer reviews', 'Complete 10 reviews');
-- Award badges to student (student_badges table)
INSERT INTO student_badges (user_id, badge_id) VALUES (1, 1), (1, 2);
```
- Now open code editor(eg. VS Code)
- Now run the following commands in your terminal
Expand Down
21 changes: 0 additions & 21 deletions badges_engagement/controller/badgeController.js

This file was deleted.

43 changes: 0 additions & 43 deletions badges_engagement/models/badge.js

This file was deleted.

39 changes: 0 additions & 39 deletions badges_engagement/public/styles.css

This file was deleted.

43 changes: 0 additions & 43 deletions badges_engagement/sql script

This file was deleted.

0 comments on commit 5dc3326

Please sign in to comment.