Follow these steps to get LearnGuardian up and running on your local machine.
Make sure you have installed:
- ✅ Node.js (v16+):
node --version - ✅ MongoDB:
mongod --version - ✅ npm or yarn:
npm --version
cd Mini-projectcd backend
npm installWindows:
net start MongoDBmacOS/Linux:
sudo systemctl start mongod
# or
brew services start mongodb-communitynpm run dev✅ Backend should be running on http://localhost:5000
cd frontend
npm installnpm run dev✅ Frontend should be running on http://localhost:3000
You need to create users before you can log in. Use any HTTP client (Postman, curl, or Thunder Client in VS Code).
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d "{\"username\":\"teacher1\",\"password\":\"password123\",\"role\":\"teacher\",\"fullName\":\"John Doe\"}"Copy the _id from the response - you'll need it for the student!
Replace <TEACHER_ID> with the ID from step 1:
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d "{\"username\":\"student1\",\"password\":\"password123\",\"role\":\"student\",\"fullName\":\"Jane Smith\",\"assignedTeacher\":\"<TEACHER_ID>\"}"Copy the _id from the response - you'll need it for the parent!
Replace <STUDENT_ID> with the ID from step 2:
curl -X POST http://localhost:5000/api/auth/register \
-H "Content-Type: application/json" \
-d "{\"username\":\"parent1\",\"password\":\"password123\",\"role\":\"parent\",\"fullName\":\"Mary Smith\",\"childId\":\"<STUDENT_ID>\"}"-
Create Teacher
- Method: POST
- URL:
http://localhost:5000/api/auth/register - Body (JSON):
{ "username": "teacher1", "password": "password123", "role": "teacher", "fullName": "John Doe" } -
Create Student
- Method: POST
- URL:
http://localhost:5000/api/auth/register - Body (JSON):
{ "username": "student1", "password": "password123", "role": "student", "fullName": "Jane Smith", "assignedTeacher": "<PASTE_TEACHER_ID_HERE>" } -
Create Parent
- Method: POST
- URL:
http://localhost:5000/api/auth/register - Body (JSON):
{ "username": "parent1", "password": "password123", "role": "parent", "fullName": "Mary Smith", "childId": "<PASTE_STUDENT_ID_HERE>" }
Open your browser and go to http://localhost:3000
- Student:
student1/password123 - Teacher:
teacher1/password123 - Parent:
parent1/password123
- Log an academic activity
- Start a study session
- View focus exercises
- View your students
- Add an academic score
- Check if alerts are generated (add a low score to trigger)
- View child's overview
- Check performance trends
- View teacher remarks
Solution: Make sure MongoDB is running:
# Check if MongoDB is running
mongosh
# If not, start it
# Windows: net start MongoDB
# Mac/Linux: brew services start mongodb-communitySolution: Change the port in .env (backend) or vite.config.js (frontend)
Solution: Make sure you've created users and the backend is running
Solution:
- As teacher, add a score for a student
- Then add another score that's 20% lower
- Example: First score: 90, Second score: 70 or below
To see the academic alert system in action:
- Login as Teacher (
teacher1/password123) - Add First Score:
- Student: Jane Smith
- Subject: Mathematics
- Score: 90
- Type: Quiz
- Add Second Score (lower):
- Student: Jane Smith
- Subject: Mathematics
- Score: 70
- Type: Quiz
- Check Alerts Tab - You should see an alert!
- Login as Parent (
parent1/password123) - Check Alerts Tab - Parents can also see the alert!
Check the main README.md for more detailed information about:
- API endpoints
- Project structure
- Feature documentation
- Deployment guidelines
You're all set! Enjoy using LearnGuardian! 🎓