LearnHub is a MERN stack application designed to provide a platform where users can register, log in, view a list of courses, and enroll in courses. The application utilizes React.js for the frontend, Node.js for the backend, and MongoDB (a non-SQL database) for data storage.
- Project Description
- Table of Contents
- Installation
- Usage
- Features
- Dependencies
- Configuration
- Contributors
- Deployed Application
To set up the project locally, follow these steps:
-
Clone the repository:
git clone https://github.com/soumik-saha/LearnHub
-
Install dependencies for both client and server:
cd LearnHub-main/client npm install cd ../server npm install
-
Add the localhost ports to the
.env
file for both client and server.
Example of.env
file for the client:REACT_APP_API_URL=http://localhost:5000
Example of
.env
file for the server:PORT=5000 MONGO_URI=<your-mongodb-connection-string>
To run the project locally:
-
Start the frontend:
cd LearnHub-main/client npm start
-
Start the backend:
cd LearnHub-main/server npm run dev
-
Open the application:
- Open your web browser and navigate to
http://localhost:3000
.
- Open your web browser and navigate to
-
Workflow:
- Open the home page.
- Register a new account.
- Log in with your account.
- Go to the dashboard (home).
- Enroll in courses.
- Navigate to "Enrolled Courses" to see your enrolled courses.
- User registration and login
- Course listing
- Course enrollment
- Dashboard to view enrolled courses
Make sure you have the following installed on your local machine:
- Node.js
- npm
- MongoDB
Run npm install
in both the client and server directories to install all required dependencies.
Ensure you have a .env
file in both the client and server directories with the appropriate configurations.
-
Client
.env
file:REACT_APP_API_URL=http://localhost:5000/api/
-
Server
.env
file:PORT=5000 CONNECTION_URL=<your-mongodb-connection-string> JWT_SECRET=<your-secret-key>
Access the deployed application here: LearnHub
- MERN Stack: The project is built using the MERN stack (MongoDB, Express.js, React.js, Node.js) to leverage the full JavaScript ecosystem.
- User Flow: The user flow includes registration, login, viewing courses, and enrolling in courses, which are typical functionalities for an e-learning platform.
- Localhost Ports: The application is configured to run on localhost, with the frontend on port 3000 and the backend on port 5000 by default.