Skip to content

Yousef-karem/Sagely_Backend_Java

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

13 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sagely - Learning Management System Backend API

Sagely is a comprehensive Learning Management System (LMS) backend API built with Spring Boot that provides RESTful services for educational institutions to manage courses, announcements, requirements, and student interactions.

πŸš€ Features

πŸ” Authentication & Authorization

  • JWT-based Authentication: Secure token-based authentication system
  • Role-based Access Control: Two user roles - Admin and Student
  • User Registration & Login: Complete user management system
  • Profile Management: Users can update their profiles and change passwords
  • Default Admin Account: Automatically creates admin user on startup

πŸ“š Course Management

  • Course CRUD Operations: Create, read, update, and delete courses
  • Course Enrollment: Students can enroll in available courses
  • Course Details: View course information and descriptions
  • Student Management: Admins can view enrolled students for each course

πŸ“’ Announcement System

  • Announcement Management: Create, update, and delete announcements
  • Course-specific Announcements: Link announcements to specific courses
  • Categorized Announcements: Organize announcements by categories
  • Attachment Support: Attach files to announcements

πŸ“‹ Requirement Management

  • Assignment Creation: Admins can create course requirements/assignments
  • File Submission: Students can submit files for requirements
  • Submission Tracking: Track and view all submissions
  • Requirement Management: Full CRUD operations for requirements

πŸ”” Notification System

  • Course Notifications: Send notifications to all students in a course
  • Individual Notifications: Send targeted notifications to specific students
  • Notification Status: Track read/unread status of notifications
  • User Preferences: Configure email and site notification preferences

πŸ“ File Management

  • File Upload: Support for file uploads in requirements and announcements
  • File Storage: Secure file storage in the uploads directory
  • Download Support: Access to downloadable course materials

πŸ› οΈ Technology Stack

  • Backend Framework: Spring Boot 3.5.5
  • Java Version: Java 21
  • Database: MySQL
  • ORM: Spring Data JPA with Hibernate
  • Security: Spring Security with JWT
  • Authentication: JWT (JSON Web Tokens)
  • Password Encoding: BCrypt
  • Build Tool: Maven
  • Code Generation: Lombok

πŸ“¦ Dependencies

  • Spring Boot Web Starter
  • Spring Boot Data JPA
  • Spring Boot Security
  • MySQL Connector
  • JWT (jjwt 0.12.3)
  • Lombok
  • Spring Boot Test

πŸš€ Getting Started

Prerequisites

  • Java 21 or higher
  • Maven 3.6+
  • MySQL 8.0+
  • Git

Installation

  1. Clone the repository

    git clone <repository-url>
    cd sagely
  2. Database Setup

    • Create a MySQL database named sagely
    • Update database credentials in src/main/resources/application.properties:
      spring.datasource.url=jdbc:mysql://localhost:3306/sagely
      spring.datasource.username=your_username
      spring.datasource.password=your_password
  3. Build and Run

    mvn clean install
    mvn spring-boot:run
  4. Access the Application

    • The application will start on http://localhost:8080
    • Default admin credentials:
      • Email: admin@sagely.com
      • Password: admin123

πŸ“‘ API Endpoints

Authentication (/api)

  • POST /signup - User registration
  • POST /login - User login
  • POST /logout - User logout
  • POST /change-password - Change password
  • GET /me - Get current user profile
  • PUT /profile/update - Update user profile

Courses (/api/courses)

  • GET / - Get all courses
  • GET /{id} - Get course by ID
  • POST / - Create course (Admin only)
  • PUT /{id} - Update course (Admin only)
  • DELETE /{id} - Delete course (Admin only)
  • POST /{courseID}/enroll - Enroll in course (Student only)
  • GET /{courseID}/announcements - Get course announcements
  • GET /{courseID}/students - Get enrolled students (Admin only)

Announcements (/api/announcements)

  • GET / - Get all announcements
  • GET /{id} - Get announcement by ID
  • POST / - Create announcement (Admin only)
  • PUT /{id} - Update announcement (Admin only)
  • DELETE /{id} - Delete announcement (Admin only)

Requirements (/api)

  • GET /courses/{id}/requirements - Get course requirements
  • POST /requirements - Create requirement (Admin only)
  • PUT /requirements/{id} - Update requirement (Admin only)
  • DELETE /requirements/{id} - Delete requirement (Admin only)
  • POST /requirements/{requirementID}/submit - Submit requirement (Student only)
  • GET /requirements/{requirementID}/submissions - Get requirement submissions
  • GET /me/submissions - Get my submissions (Student only)

Notifications (/api)

  • GET /notifications/me - Get my notifications
  • POST /courses/{courseID}/notify - Send course notification (Admin only)
  • POST /students/{studentID}/notify - Send student notification (Admin only)
  • PATCH /notifications/{notificationID}/read - Mark notification as read

πŸ—„οΈ Database Schema

The application uses the following main entities:

  • User: Stores user information with roles (Admin/Student)
  • Course: Course information and details
  • Announcement: Course announcements with attachments
  • Requirement: Course assignments/requirements
  • RequirementSubmission: Student submissions for requirements
  • Notification: User notifications
  • EnrolledStudents: Course enrollment tracking
  • Attachment: File attachments for announcements
  • DownloadableFiles: Course materials

πŸ”’ Security Features

  • JWT Authentication: Stateless authentication using JSON Web Tokens
  • Role-based Authorization: Different access levels for Admin and Student roles
  • Password Encryption: BCrypt password hashing
  • CORS Configuration: Cross-origin resource sharing setup
  • Session Management: Stateless session management

πŸ“ Project Structure

src/
β”œβ”€β”€ main/
β”‚   β”œβ”€β”€ java/com/EgronX/sagely/
β”‚   β”‚   β”œβ”€β”€ config/          # Security and configuration classes
β”‚   β”‚   β”œβ”€β”€ Controller/      # REST API controllers
β”‚   β”‚   β”œβ”€β”€ Dto/            # Data Transfer Objects
β”‚   β”‚   β”œβ”€β”€ Entities/       # JPA entities
β”‚   β”‚   β”œβ”€β”€ Mapper/         # Entity-DTO mappers
β”‚   β”‚   β”œβ”€β”€ Repository/     # Data access layer
β”‚   β”‚   β”œβ”€β”€ Service/        # Business logic layer
β”‚   β”‚   └── SagelyApplication.java
β”‚   └── resources/
β”‚       β”œβ”€β”€ application.properties
β”‚       β”œβ”€β”€ sagely.sql      # Database schema
β”‚       └── static/         # Static resources
└── test/                   # Test classes

🎯 Key Features in Detail

User Management

  • Secure user registration and authentication
  • Profile management with notification preferences
  • Role-based access control (Admin/Student)
  • Password change functionality

Course System

  • Complete course lifecycle management
  • Student enrollment system
  • Course-specific content organization
  • Student roster management for admins

Communication

  • Announcement system for course updates
  • Notification system for important messages
  • File attachment support
  • Categorized content organization

Assignment Management

  • Requirement/assignment creation and management
  • File submission system for students
  • Submission tracking and review
  • Course-specific requirement organization

πŸ”§ Configuration

The application can be configured through application.properties:

  • Database connection settings
  • Server port configuration
  • Default admin account settings
  • JPA/Hibernate configuration

--

Sagely - Empowering education through technology πŸŽ“

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages