LearnHub is a comprehensive online learning platform designed to enhance user engagement and motivation. Users have acccess to courses, take quizzes, track their progress, participate in discussion forums, and leave reviews and ratings. The platform is built using TypeScript, Node.js, Express, React, and PostgreSQL.
- User Authentication: Secure authentication system for user registration, login, and logout to protect user data and ensure privacy.
- Courses and Quizzes: Users have access to a variety of courses, each with interactive quizzes that can be attempted multiple times to improve learning outcomes.
- Progress Tracking: Display quiz progress, including scores and completion status, to help users monitor their learning journey.
- Leaderboards: Boost motivation with leaderboards that display top performers, encouraging a competitive yet fun learning environment.
- Discussion Forums: Engage with other learners through topic-based discussion forums to ask questions, share knowledge, and collaborate.
- Reviews and Ratings: Provide valuable feedback by leaving reviews and ratings for courses, helping other users make informed decisions.
- Node.js (v14 or higher)
- PostgreSQL (v12 or higher)
- npm
-
Clone the repository:
git clone https://github.com/chrispsang/LearnHub.git cd LearnHub
-
Install backend dependencies:
npm install
-
Install frontend dependencies:
cd online-learning-platform-frontend npm install cd ..
-
Start the PostgreSQL service:
- Linux:
sudo service postgresql start
- macOS with Homebrew:
brew services start postgresql
- Windows:
net start postgresql
- Linux:
-
Access the PostgreSQL command line:
- Linux:
sudo -u postgres psql
- macOS with Homebrew:
psql postgres
- Windows:
psql -U postgres
- Linux:
-
Create a superuser in PostgreSQL:
CREATE USER myuser WITH SUPERUSER PASSWORD 'mypassword';
-
Create the database:
psql -U myuser -d postgres -c "CREATE DATABASE online_learning_platform OWNER myuser;"
-
Grant all privileges to the user:
psql -U myuser -d postgres -c "GRANT ALL PRIVILEGES ON DATABASE online_learning_platform TO myuser;"
-
Verify the creation:
psql -U myuser -l
-
Run the Sequelize migrations to set up the database schema:
npx sequelize-cli db:migrate
-
Seed the database with initial data:
npx sequelize-cli db:seed:all
-
Start the backend server (runs on http://localhost:5001):
npm start
-
Start the frontend development server (runs on http://localhost:3000):
cd online-learning-platform-frontend npm start