A web application designed to help beginners learn programming languages and computer science concepts. This project features user authentication, course browsing, and course request functionality, with a MongoDB backend.
- User registration and login (with JWT authentication)
- Browse available programming courses
- Request new courses
- Responsive UI with HTML, CSS, and JavaScript
- Email notifications (via Nodemailer)
- MongoDB database integration
- Clone the repository:
git clone https://github.com/Ariz253/CS-FOR-BEGINNERS.git cd CS-FOR-BEGINNERS
i
2. Install dependencies:
bash npm install
-
Set up environment variables:
- Copy
.env.exampleto.envand fill in your credentials:EMAIL=your_email_here PASSWORD=your_email_app_password_here MONGODB_URI=your_mongodb_uri_here
- Copy
-
Start the server:
node serverfinal.js
The server will run on
http://localhost:3013by default.Feel free to change the port no if needed
The application uses MongoDB with Mongoose. The main schema is for users:
const userSchema = new mongoose.Schema({
username: {
type: String,
required: true,
},
email: {
type: String,
required: true,
unique: true,
},
password: {
type: String,
required: true,
},
requestedCourses: {
type: [String],
default: [],
}
}, { timestamps: true });- username: User’s display name (String, required)
- email: User’s email address (String, required, unique)
- password: Hashed password (String, required)
- requestedCourses: Array of course names the user has requested (Array of Strings)
- timestamps: Automatically adds
createdAtandupdatedAtfields
.
├── css/ # Stylesheets
├── img/ # Images and icons
├── js/ # JavaScript files (if any)
├── serverfinal.js # Main backend server file
├── package.json
├── .env.example
├── .gitignore
├── README.md
└── ... (HTML files)
The following environment variables are required (see .env.example):
EMAIL: Email address for sending notificationsPASSWORD: App password for the email accountMONGODB_URI: MongoDB connection string
Ariz Ejaz Khan