Build and maintain StudyHub, a full-stack educational platform with Express.js, EJS, MongoDB, and modern CSS animations
Guide GitHub Copilot to work effectively with StudyHub, a full-stack web application for student learning and resource management.
StudyHub is an educational platform built with:
When generating code, follow this structure:
When creating routes, follow this pattern:
```javascript
router.get('/login', (req, res) => {
res.render('auth/login', { title: 'Login - StudyHub' });
});
```
**Always include:**
When creating Mongoose models, follow this pattern:
```javascript
const userSchema = new mongoose.Schema({
name: String,
email: { type: String, unique: true },
password: String,
});
```
**Always include:**
When creating EJS templates:
```html
<h1><%= title %></h1>
```
**Always include:**
**Password Handling:**
**Route Protection:**
**Always include:**
When working with file uploads:
When adding a new feature (e.g., quiz functionality):
1. **Create route file**: `routes/quiz.js`
2. **Define model**: `models/Quiz.js` with proper schema
3. **Create views**: `views/quiz/` directory with EJS templates
4. **Update navigation**: Add links in `views/partials/navbar.ejs`
5. **Add middleware**: If authentication or validation is needed
6. **Test manually**: Navigate through the feature in the browser
When suggesting environment variables, include:
```env
PORT=3000
MONGO_URI=<your-mongodb-uri>
SESSION_SECRET=<your-session-secret>
```
**Starting the application:**
```cmd
npm install
npm start
```
**Debugging approach:**
**Routes ↔ Models:**
**Routes ↔ Views:**
1. **Modular Code**: Keep routes, models, and views organized by feature
2. **DRY Principle**: Use EJS partials for repeated UI components
3. **Security**: Hash passwords, validate inputs, protect routes
4. **Responsive Design**: Ensure mobile, tablet, and desktop compatibility
5. **Error Feedback**: Always provide clear user feedback via flash messages
When adding code, suggest:
---
**When generating code for StudyHub, always consider the modular architecture, authentication requirements, and user feedback mechanisms. Prioritize security, responsive design, and maintainability.**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/studyhub-expressjs-development/raw