Skip to content

kingz1127/Hackathon-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

134 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ Learner - School Management System

Learner Banner

License Version React Node.js MongoDB Express

A comprehensive school management system built collaboratively to streamline education administration

Features β€’ Demo β€’ Installation β€’ Architecture β€’ Contributing


πŸ“Š System Overview

graph TB
    A[πŸ‘₯ Users] --> B{Authentication}
    B -->|Admin| C[Admin Dashboard]
    B -->|Teacher| D[Teacher Portal]
    B -->|Student| E[Student Portal]
    
    C --> F[Student Management]
    C --> G[Staff Management]
    C --> H[Course Management]
    C --> I[Reports & Analytics]
    
    D --> J[Class Management]
    D --> K[Grade Entry]
    D --> L[Attendance]
    
    E --> M[View Grades]
    E --> N[Assignments]
    E --> O[Timetable]
    
    F --> P[(MongoDB)]
    G --> P
    H --> P
    J --> P
    K --> P
    L --> P
    M --> P
    N --> P
    O --> P
    
    I --> Q[πŸ“§ Email Notifications]
    Q --> R[Nodemailer Service]
Loading

✨ Features

πŸ‘¨β€πŸ’Ό For Administrators

πŸ“ˆ Dashboard Analytics     β†’ Real-time school performance metrics
πŸ‘¨β€πŸŽ“ Student Management     β†’ Complete enrollment and academic tracking
πŸ‘¨β€πŸ« Staff Management       β†’ Teacher profiles and performance monitoring
πŸ“š Course Management       β†’ Curriculum creation and subject management
βœ… Attendance Tracking     β†’ Comprehensive attendance reports
πŸ’° Fee Management          β†’ Payment tracking and invoice generation

πŸ‘¨β€πŸ« For Teachers

🏫 Class Management        β†’ View assigned classes and rosters
πŸ“ Grade Entry             β†’ Record and update assessments
πŸ“‹ Attendance Marking      β†’ Quick attendance submission
πŸ“€ Assignment Distribution β†’ Create and share coursework
πŸ’¬ Communication Hub       β†’ Direct messaging with students/parents

πŸ‘¨β€πŸŽ“ For Students

πŸ“Š Academic Dashboard      β†’ View grades and attendance
πŸ“₯ Assignment Tracking     β†’ Access and submit assignments
πŸ—“οΈ Timetable View          β†’ Personal class schedule
πŸ“ˆ Progress Reports        β†’ Track academic performance
πŸ”” Notifications           β†’ Important announcements and updates

πŸ—οΈ Architecture

System Architecture Diagram

graph LR
    subgraph "Frontend Layer"
        A[React App]
        B[CSS Styling]
        C[Components]
    end
    
    subgraph "Backend Layer"
        D[Express.js Server]
        E[REST API]
        F[Authentication Middleware]
    end
    
    subgraph "Data Layer"
        G[(MongoDB)]
        H[User Collection]
        I[Course Collection]
        J[Attendance Collection]
    end
    
    subgraph "External Services"
        K[πŸ“§ Nodemailer]
        L[Email Service]
    end
    
    A --> E
    C --> E
    E --> D
    D --> F
    F --> G
    G --> H
    G --> I
    G --> J
    D --> K
    K --> L
Loading

Data Flow Architecture

sequenceDiagram
    participant U as User
    participant F as Frontend (React)
    participant B as Backend (Express)
    participant D as Database (MongoDB)
    participant E as Email Service
    
    U->>F: Login Request
    F->>B: POST /api/auth/login
    B->>D: Verify Credentials
    D-->>B: User Data
    B-->>F: JWT Token
    F-->>U: Dashboard Access
    
    U->>F: Submit Assignment
    F->>B: POST /api/assignments
    B->>D: Save Assignment
    D-->>B: Success
    B->>E: Send Notification
    E-->>U: Email Confirmation
    B-->>F: Response
    F-->>U: Success Message
Loading

πŸ› οΈ Tech Stack

graph TD
    A[Learner System] --> B[Frontend]
    A --> C[Backend]
    A --> D[Database]
    A --> E[Services]
    
    B --> B1[βš›οΈ React 18+]
    B --> B2[🎨 CSS3]
    B --> B3[πŸ“± Responsive Design]
    
    C --> C1[🟒 Node.js]
    C --> C2[⚑ Express.js]
    C --> C3[πŸ” JWT Authentication]
    C --> C4[πŸ›‘οΈ Bcrypt]
    
    D --> D1[πŸƒ MongoDB]
    D --> D2[πŸ“¦ Mongoose ODM]
    
    E --> E1[πŸ“§ Nodemailer]
    E --> E2[βœ‰οΈ SMTP Integration]
    
    style A fill:#4A90E2,color:#fff
    style B fill:#61DAFB,color:#000
    style C fill:#339933,color:#fff
    style D fill:#47A248,color:#fff
    style E fill:#EA4335,color:#fff
Loading

πŸš€ Getting Started

Prerequisites

graph LR
    A[Requirements] --> B[Node.js v14+]
    A --> C[MongoDB v4.4+]
    A --> D[npm/yarn]
    A --> E[Git]
    
    style A fill:#4A90E2,color:#fff
Loading

Installation

1. Clone the repository

git clone https://github.com/kingz1127/Hackathon-project.git
cd Hackathon-project

2. Install backend dependencies

cd backend
npm install

3. Install frontend dependencies

cd ../frontend
npm install

4. Configure environment variables

Create a .env file in the backend directory:

PORT=5000
MONGODB_URI=mongodb://localhost:27017/learner
JWT_SECRET=your_super_secret_jwt_key_here
JWT_EXPIRE=7d

# Email Configuration
EMAIL_HOST=smtp.gmail.com
EMAIL_PORT=587
EMAIL_USER=your_email@gmail.com
EMAIL_PASS=your_app_specific_password

# Frontend URL
CLIENT_URL=http://localhost:3000

5. Database Setup

# Start MongoDB service
mongod

# In a new terminal, seed the database (optional)
cd backend
npm run seed

6. Run the application

# Terminal 1 - Backend
cd backend
npm run dev

# Terminal 2 - Frontend
cd frontend
npm start

πŸŽ‰ Application running at: http://localhost:3000

πŸ“ Project Structure

Hackathon-project/
β”‚
β”œβ”€β”€ πŸ“‚ frontend/
β”‚   β”œβ”€β”€ πŸ“‚ public/
β”‚   β”‚   β”œβ”€β”€ index.html
β”‚   β”‚   └── favicon.ico
β”‚   β”œβ”€β”€ πŸ“‚ src/
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ components/
β”‚   β”‚   β”‚   β”œβ”€β”€ Admin/
β”‚   β”‚   β”‚   β”œβ”€β”€ Teacher/
β”‚   β”‚   β”‚   β”œβ”€β”€ Student/
β”‚   β”‚   β”‚   └── Shared/
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ pages/
β”‚   β”‚   β”‚   β”œβ”€β”€ Dashboard.js
β”‚   β”‚   β”‚   β”œβ”€β”€ Login.js
β”‚   β”‚   β”‚   └── Register.js
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ styles/
β”‚   β”‚   β”‚   β”œβ”€β”€ global.css
β”‚   β”‚   β”‚   └── components.css
β”‚   β”‚   β”œβ”€β”€ πŸ“‚ utils/
β”‚   β”‚   β”‚   β”œβ”€β”€ api.js
β”‚   β”‚   β”‚   └── helpers.js
β”‚   β”‚   β”œβ”€β”€ App.js
β”‚   β”‚   └── index.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ πŸ“‚ backend/
β”‚   β”œβ”€β”€ πŸ“‚ config/
β”‚   β”‚   β”œβ”€β”€ db.js
β”‚   β”‚   └── email.js
β”‚   β”œβ”€β”€ πŸ“‚ controllers/
β”‚   β”‚   β”œβ”€β”€ authController.js
β”‚   β”‚   β”œβ”€β”€ studentController.js
β”‚   β”‚   └── teacherController.js
β”‚   β”œβ”€β”€ πŸ“‚ models/
β”‚   β”‚   β”œβ”€β”€ User.js
β”‚   β”‚   β”œβ”€β”€ Course.js
β”‚   β”‚   β”œβ”€β”€ Assignment.js
β”‚   β”‚   └── Attendance.js
β”‚   β”œβ”€β”€ πŸ“‚ routes/
β”‚   β”‚   β”œβ”€β”€ authRoutes.js
β”‚   β”‚   β”œβ”€β”€ studentRoutes.js
β”‚   β”‚   └── teacherRoutes.js
β”‚   β”œβ”€β”€ πŸ“‚ middleware/
β”‚   β”‚   β”œβ”€β”€ auth.js
β”‚   β”‚   β”œβ”€β”€ errorHandler.js
β”‚   β”‚   └── validation.js
β”‚   β”œβ”€β”€ πŸ“‚ utils/
β”‚   β”‚   β”œβ”€β”€ emailService.js
β”‚   β”‚   └── tokenGenerator.js
β”‚   β”œβ”€β”€ server.js
β”‚   └── package.json
β”‚
β”œβ”€β”€ πŸ“„ README.md
β”œβ”€β”€ πŸ“„ .gitignore
└── πŸ“„ LICENSE

πŸ” Authentication Flow

stateDiagram-v2
    [*] --> Login
    Login --> ValidateCredentials
    ValidateCredentials --> CheckRole
    
    CheckRole --> AdminDashboard: Admin Role
    CheckRole --> TeacherPortal: Teacher Role
    CheckRole --> StudentPortal: Student Role
    
    ValidateCredentials --> LoginError: Invalid Credentials
    LoginError --> Login
    
    AdminDashboard --> [*]
    TeacherPortal --> [*]
    StudentPortal --> [*]
Loading

πŸ“§ Email Notification System

graph TD
    A[Event Trigger] --> B{Event Type}
    
    B -->|Enrollment| C[Welcome Email]
    B -->|Grade Update| D[Grade Notification]
    B -->|Assignment| E[Assignment Alert]
    B -->|Attendance| F[Attendance Warning]
    B -->|Fee| G[Payment Reminder]
    
    C --> H[Nodemailer Service]
    D --> H
    E --> H
    F --> H
    G --> H
    
    H --> I[SMTP Server]
    I --> J[πŸ“§ User Email]
    
    style A fill:#4A90E2,color:#fff
    style H fill:#EA4335,color:#fff
    style J fill:#34A853,color:#fff
Loading

Automated Emails Include:

  • βœ… New student enrollment confirmations
  • πŸ“Š Grade updates and report cards
  • πŸ“ Assignment due date reminders
  • ⚠️ Attendance alerts
  • πŸ’° Fee payment reminders
  • πŸ“’ System announcements

πŸ”’ Security Features

mindmap
  root((Security))
    Authentication
      JWT Tokens
      Password Hashing
      Session Management
    Authorization
      Role Based Access
      Permission Levels
      Route Protection
    Data Protection
      Input Validation
      SQL Injection Prevention
      XSS Protection
    Communication
      HTTPS
      Secure Headers
      CORS Configuration
Loading
  • πŸ” JWT Authentication - Secure token-based authentication
  • πŸ”’ Password Encryption - Bcrypt hashing for passwords
  • πŸ‘₯ Role-Based Access Control - Admin, Teacher, Student roles
  • βœ… Input Validation - Server-side validation and sanitization
  • πŸ›‘οΈ Secure Headers - Protection against common vulnerabilities

πŸ“Š Database Schema

erDiagram
    USER ||--o{ ATTENDANCE : records
    USER ||--o{ ASSIGNMENT : submits
    USER ||--o{ GRADE : receives
    COURSE ||--o{ ASSIGNMENT : contains
    COURSE ||--o{ GRADE : includes
    USER ||--o{ COURSE : enrolls
    
    USER {
        string id PK
        string name
        string email
        string role
        string password
        date createdAt
    }
    
    COURSE {
        string id PK
        string name
        string code
        string teacherId FK
        array students
    }
    
    ASSIGNMENT {
        string id PK
        string title
        string courseId FK
        string teacherId FK
        date dueDate
    }
    
    ATTENDANCE {
        string id PK
        string studentId FK
        string courseId FK
        date date
        boolean present
    }
    
    GRADE {
        string id PK
        string studentId FK
        string courseId FK
        number score
        date date
    }
Loading

πŸ‘₯ Team & Contributors

This project is a collaborative effort built during a hackathon. We believe in the power of teamwork and open-source contribution!

🌟 Core Contributors

Role Contribution
🎨 Frontend Developers React components, UI/UX design, responsive layouts
βš™οΈ Backend Developers API development, database design, authentication
πŸ—„οΈ Database Architects MongoDB schema, data modeling, optimization
πŸ“§ Integration Specialists Nodemailer setup, email templates, notifications

How to Contribute

We welcome contributions from everyone! Here's how you can help:

graph LR
    A[Fork Repository] --> B[Create Branch]
    B --> C[Make Changes]
    C --> D[Write Tests]
    D --> E[Commit Changes]
    E --> F[Push to Branch]
    F --> G[Open Pull Request]
    G --> H[Code Review]
    H --> I[Merge to Main]
    
    style A fill:#4A90E2,color:#fff
    style I fill:#34A853,color:#fff
Loading

Step-by-step:

  1. 🍴 Fork the repository
  2. 🌿 Create a feature branch (git checkout -b feature/AmazingFeature)
  3. ✏️ Commit your changes (git commit -m 'Add some AmazingFeature')
  4. πŸ“€ Push to the branch (git push origin feature/AmazingFeature)
  5. 🎯 Open a Pull Request

Contribution Guidelines

  • Follow the existing code style
  • Write meaningful commit messages
  • Add tests for new features
  • Update documentation as needed
  • Be respectful and collaborative

πŸ§ͺ Testing

# Run backend tests
cd backend
npm test

# Run frontend tests
cd frontend
npm test

# Run coverage report
npm run test:coverage

πŸ“± Demo

Screenshots

Admin Dashboard Teacher Portal Student View
Admin Teacher Student

πŸš€ Deployment

graph LR
    A[Local Development] --> B[Testing]
    B --> C[Build Production]
    C --> D{Deploy To}
    D -->|Frontend| E[Vercel/Netlify]
    D -->|Backend| F[Heroku/Railway]
    D -->|Database| G[MongoDB Atlas]
    
    E --> H[Live Application]
    F --> H
    G --> H
    
    style H fill:#34A853,color:#fff
Loading

Deployment Options

  • Frontend: Vercel, Netlify, GitHub Pages
  • Backend: Heroku, Railway, DigitalOcean
  • Database: MongoDB Atlas, AWS DocumentDB

🀝 Support

Need help? We're here for you!

πŸ™ Acknowledgments

  • πŸ’‘ Built with passion during a hackathon
  • 🌟 Inspired by the need for better education management
  • πŸ‘ Thanks to all contributors and supporters
  • πŸ“š Special thanks to the open-source community

πŸ“ˆ Project Stats

pie title Technology Distribution
    "React (Frontend)" : 35
    "Node.js/Express (Backend)" : 30
    "MongoDB (Database)" : 20
    "CSS (Styling)" : 10
    "Nodemailer (Email)" : 5
Loading

Made with ❀️ by the Learner Team

⭐ Star us on GitHub β€” it helps!

Report Bug β€’ Request Feature β€’ Documentation

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6