mkdir learning-management-app
cd learning-management-app
npm init -y
npm install express mysql ejs bcryptjs express-session express-validator
-- Create users table
CREATE TABLE users (
id INT AUTO_INCREMENT PRIMARY KEY,
username VARCHAR(255) UNIQUE,
password VARCHAR(255),
email VARCHAR(255) UNIQUE,
full_name VARCHAR(255)
);
-- Create courses table
CREATE TABLE courses (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255)
);
-- Insert sample data into courses table
INSERT INTO courses (name) VALUES
('Introduction to HTML'),
('CSS Fundamentals'),
('JavaScript Basics');
-- Create leaderboard table
CREATE TABLE leaderboard (
id INT AUTO_INCREMENT PRIMARY KEY,
name VARCHAR(255),
score INT
);
-- Insert sample data into leaderboard table
INSERT INTO leaderboard (name, score) VALUES
('John Doe', 100),
('Jane Smith', 90),
('Michael Brown', 85),
('Emily Jones', 80);
node server.js
Open your web browser and navigate to http://localhost:3000.
Finish up the project by:
- creating functionality for the logged in user to select their preferred courses.
- store the selection in the database
- create a page where the selected courses for each specific logged in user is displayed.
Fork this repository and clone it to your local machine. Create a new branch with your GitHub username (git checkout -b username). Complete the tasks. Commit your changes and push them to your forked repository. Submit a pull request to the main repository for review.
Happy hacking! 🚀