Skip to content

Conversation

@saifsweelam
Copy link
Member

No description provided.

NaderMohamed325 and others added 30 commits August 13, 2025 22:52
…culty, solved to Topic; create unique index on DailyQuiz
…ctions for courses and topics and tracks with server-side validation and aplly authntication middleware
Adds full CRUD functionality for user notes, including advanced filtering, sorting, and pagination.
Adds full CRUD functionality for user notes, including advanced
filtering, sorting, and pagination.

Description:

This pull request introduces the full backend implementation for the
user notes feature, allowing learners to create, manage, and review
personal notes associated with topics.

Key Changes:

Database: Added a Note model to the Prisma schema with relationships to
User, Topic, and Course for efficient filtering.
API Endpoints: Implemented a new set of RESTful endpoints under
/api/notes and /api/topics/:topicId/notes for complete CRUD
functionality.
Business Logic: Created a dedicated note.service.ts to encapsulate all
business logic, ensuring a clean separation of concerns.
Validation: Integrated Zod schemas for rigorous validation of all
incoming requests, including query parameters for advanced filtering,
sorting, search, and pagination.
Security: All new endpoints are protected and require user
authentication. Authorization checks are in place to ensure users can
only access and modify their own notes.
Apply authentication middleware and server-side validation, and
implement a course, topic, and track endpoints with course-completion
feature
saifsweelam and others added 6 commits August 19, 2025 23:04
Remove unused functions, update dependencies, and implement new features
for quiz management, including tracking user submissions and enhancing
the DailyQuiz and Topic models. Improve error handling and middleware
configuration for better application stability.
- Restructured routes and controllers
- Added comprehensive Postman collection with all API endpoints
- Removed deprecated controller files
- Added new service files for better organization
- Updated schemas and middleware
@saifsweelam saifsweelam requested a review from Copilot September 2, 2025 22:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR merges the 'dev' branch into main, introducing a comprehensive API and web application for an Open Learning Platform. The changes add complete functionality for tracks, courses, topics, notes, quizzes, and authentication systems.

  • Implementation of RESTful API endpoints for learning platform features
  • Frontend React components and services for user interaction
  • Authentication system using better-auth with JWT tokens
  • Database schema updates for notes and quiz functionality

Reviewed Changes

Copilot reviewed 52 out of 54 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
apps/web/src/services/* API service modules for frontend-backend communication
apps/web/src/hooks/* React Query hooks for data fetching and state management
apps/web/src/lib/* Authentication client and route protection components
apps/api/src/services/* Business logic services for API endpoints
apps/api/src/routes/* Express route handlers for API endpoints
apps/api/src/schemas/* Validation schemas using Zod
apps/api/prisma/* Database schema and migration files
package.json files Dependency updates for both frontend and backend

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

});
};

export const getToltalTopics = async (
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function name contains a typo: 'getToltalTopics' should be 'getTotalTopics'.

Suggested change
export const getToltalTopics = async (
export const getTotalTopics = async (

Copilot uses AI. Check for mistakes.
});
};

export const getToltalTopics = async (courseId: string) => {
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function name contains a typo: 'getToltalTopics' should be 'getTotalTopics'.

Suggested change
export const getToltalTopics = async (courseId: string) => {
export const getTotalTopics = async (courseId: string) => {

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +2
import exprees from "express";
const router = exprees.Router();
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import statement contains a typo: 'exprees' should be 'express'.

Suggested change
import exprees from "express";
const router = exprees.Router();
import express from "express";
const router = express.Router();

Copilot uses AI. Check for mistakes.
async (req, res) => {
const course = await Service.getCourse(req.params.courseId);

const totalTopics = await Service.getToltalTopics(req.params.courseId);
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function call contains a typo: 'getToltalTopics' should be 'getTotalTopics'.

Copilot uses AI. Check for mistakes.
async (req, res) => {
const { completed } = req.query;

const topics = await topicService.getToltalTopics(
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function call contains a typo: 'getToltalTopics' should be 'getTotalTopics'.

Suggested change
const topics = await topicService.getToltalTopics(
const topics = await topicService.getTotalTopics(

Copilot uses AI. Check for mistakes.
Comment on lines +34 to +42
router.delete(
"/:topicId/completion",
requireAuth,
validate({ params: getTopicParamsSchema }),
async (req, res) => {
await unmarkTopicAsCompleted(req.user!.id, req.params.topicId);
res.enhancedSend(204, undefined);
},
);
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The DELETE endpoint for topic completion should use POST method instead, as indicated by the frontend service which calls unMarkTopicAsCompleted via POST to /topics/${topicId}/uncompletion. This creates an API inconsistency.

Copilot uses AI. Check for mistakes.
title: string;
content: string;
topicId: string;
userId: string; // موجود في schema
Copy link

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment contains non-English text. Code comments should be in English for consistency and maintainability in international teams.

Suggested change
userId: string; // موجود في schema
userId: string; // Present in schema

Copilot uses AI. Check for mistakes.
@saifsweelam saifsweelam merged commit 1bc0f1e into main Sep 2, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants