diff --git a/apps/api/src/assignments/assignments.controller.spec.ts b/apps/api/src/assignments/assignments.controller.spec.ts new file mode 100644 index 00000000..df7c9a3b --- /dev/null +++ b/apps/api/src/assignments/assignments.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AssignmentsController } from './assignments.controller'; +import { AssignmentsService } from './assignments.service'; + +describe('AssignmentsController', () => { + let controller: AssignmentsController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [AssignmentsController], + providers: [AssignmentsService], + }).compile(); + + controller = module.get(AssignmentsController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/apps/api/src/assignments/assignments.controller.ts b/apps/api/src/assignments/assignments.controller.ts new file mode 100644 index 00000000..71fdc609 --- /dev/null +++ b/apps/api/src/assignments/assignments.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { AssignmentsService } from './assignments.service'; +import { CreateAssignmentDto } from './dto/create-assignment.dto'; +import { UpdateAssignmentDto } from './dto/update-assignment.dto'; + +@Controller('assignments') +export class AssignmentsController { + constructor(private readonly assignmentsService: AssignmentsService) {} + + @Post() + create(@Body() createAssignmentDto: CreateAssignmentDto) { + return this.assignmentsService.create(createAssignmentDto); + } + + @Get() + findAll() { + return this.assignmentsService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.assignmentsService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateAssignmentDto: UpdateAssignmentDto) { + return this.assignmentsService.update(+id, updateAssignmentDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.assignmentsService.remove(+id); + } +} diff --git a/apps/api/src/assignments/assignments.module.ts b/apps/api/src/assignments/assignments.module.ts new file mode 100644 index 00000000..4cf26e35 --- /dev/null +++ b/apps/api/src/assignments/assignments.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { AssignmentsService } from './assignments.service'; +import { AssignmentsController } from './assignments.controller'; + +@Module({ + controllers: [AssignmentsController], + providers: [AssignmentsService], +}) +export class AssignmentsModule {} diff --git a/apps/api/src/assignments/assignments.service.spec.ts b/apps/api/src/assignments/assignments.service.spec.ts new file mode 100644 index 00000000..0dfde70a --- /dev/null +++ b/apps/api/src/assignments/assignments.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { AssignmentsService } from './assignments.service'; + +describe('AssignmentsService', () => { + let service: AssignmentsService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [AssignmentsService], + }).compile(); + + service = module.get(AssignmentsService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/apps/api/src/assignments/assignments.service.ts b/apps/api/src/assignments/assignments.service.ts new file mode 100644 index 00000000..c2a80c3b --- /dev/null +++ b/apps/api/src/assignments/assignments.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateAssignmentDto } from './dto/create-assignment.dto'; +import { UpdateAssignmentDto } from './dto/update-assignment.dto'; + +@Injectable() +export class AssignmentsService { + create(createAssignmentDto: CreateAssignmentDto) { + return 'This action adds a new assignment'; + } + + findAll() { + return `This action returns all assignments`; + } + + findOne(id: number) { + return `This action returns a #${id} assignment`; + } + + update(id: number, updateAssignmentDto: UpdateAssignmentDto) { + return `This action updates a #${id} assignment`; + } + + remove(id: number) { + return `This action removes a #${id} assignment`; + } +} diff --git a/apps/api/src/assignments/dto/create-assignment.dto.ts b/apps/api/src/assignments/dto/create-assignment.dto.ts new file mode 100644 index 00000000..5a9c41fd --- /dev/null +++ b/apps/api/src/assignments/dto/create-assignment.dto.ts @@ -0,0 +1 @@ +export class CreateAssignmentDto {} diff --git a/apps/api/src/assignments/dto/update-assignment.dto.ts b/apps/api/src/assignments/dto/update-assignment.dto.ts new file mode 100644 index 00000000..49641b9e --- /dev/null +++ b/apps/api/src/assignments/dto/update-assignment.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateAssignmentDto } from './create-assignment.dto'; + +export class UpdateAssignmentDto extends PartialType(CreateAssignmentDto) {} diff --git a/apps/api/src/assignments/entities/assignment.entity.ts b/apps/api/src/assignments/entities/assignment.entity.ts new file mode 100644 index 00000000..8f6c391a --- /dev/null +++ b/apps/api/src/assignments/entities/assignment.entity.ts @@ -0,0 +1 @@ +export class Assignment {} diff --git a/apps/api/src/courses/courses.controller.spec.ts b/apps/api/src/courses/courses.controller.spec.ts new file mode 100644 index 00000000..58024ef4 --- /dev/null +++ b/apps/api/src/courses/courses.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { CoursesController } from './courses.controller'; +import { CoursesService } from './courses.service'; + +describe('CoursesController', () => { + let controller: CoursesController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [CoursesController], + providers: [CoursesService], + }).compile(); + + controller = module.get(CoursesController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/apps/api/src/courses/courses.controller.ts b/apps/api/src/courses/courses.controller.ts new file mode 100644 index 00000000..215fc295 --- /dev/null +++ b/apps/api/src/courses/courses.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { CoursesService } from './courses.service'; +import { CreateCourseDto } from './dto/create-course.dto'; +import { UpdateCourseDto } from './dto/update-course.dto'; + +@Controller('courses') +export class CoursesController { + constructor(private readonly coursesService: CoursesService) {} + + @Post() + create(@Body() createCourseDto: CreateCourseDto) { + return this.coursesService.create(createCourseDto); + } + + @Get() + findAll() { + return this.coursesService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.coursesService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateCourseDto: UpdateCourseDto) { + return this.coursesService.update(+id, updateCourseDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.coursesService.remove(+id); + } +} diff --git a/apps/api/src/courses/courses.module.ts b/apps/api/src/courses/courses.module.ts new file mode 100644 index 00000000..f9b6d95a --- /dev/null +++ b/apps/api/src/courses/courses.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { CoursesService } from './courses.service'; +import { CoursesController } from './courses.controller'; + +@Module({ + controllers: [CoursesController], + providers: [CoursesService], +}) +export class CoursesModule {} diff --git a/apps/api/src/courses/courses.service.spec.ts b/apps/api/src/courses/courses.service.spec.ts new file mode 100644 index 00000000..ffad4725 --- /dev/null +++ b/apps/api/src/courses/courses.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { CoursesService } from './courses.service'; + +describe('CoursesService', () => { + let service: CoursesService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [CoursesService], + }).compile(); + + service = module.get(CoursesService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/apps/api/src/courses/courses.service.ts b/apps/api/src/courses/courses.service.ts new file mode 100644 index 00000000..4ac1a1e4 --- /dev/null +++ b/apps/api/src/courses/courses.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateCourseDto } from './dto/create-course.dto'; +import { UpdateCourseDto } from './dto/update-course.dto'; + +@Injectable() +export class CoursesService { + create(createCourseDto: CreateCourseDto) { + return 'This action adds a new course'; + } + + findAll() { + return `This action returns all courses`; + } + + findOne(id: number) { + return `This action returns a #${id} course`; + } + + update(id: number, updateCourseDto: UpdateCourseDto) { + return `This action updates a #${id} course`; + } + + remove(id: number) { + return `This action removes a #${id} course`; + } +} diff --git a/apps/api/src/courses/dto/create-course.dto.ts b/apps/api/src/courses/dto/create-course.dto.ts new file mode 100644 index 00000000..556b61e2 --- /dev/null +++ b/apps/api/src/courses/dto/create-course.dto.ts @@ -0,0 +1 @@ +export class CreateCourseDto {} diff --git a/apps/api/src/courses/dto/update-course.dto.ts b/apps/api/src/courses/dto/update-course.dto.ts new file mode 100644 index 00000000..26acf7be --- /dev/null +++ b/apps/api/src/courses/dto/update-course.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateCourseDto } from './create-course.dto'; + +export class UpdateCourseDto extends PartialType(CreateCourseDto) {} diff --git a/apps/api/src/courses/entities/course.entity.ts b/apps/api/src/courses/entities/course.entity.ts new file mode 100644 index 00000000..f2e50092 --- /dev/null +++ b/apps/api/src/courses/entities/course.entity.ts @@ -0,0 +1 @@ +export class Course {} diff --git a/apps/api/src/feedback/dto/create-feedback.dto.ts b/apps/api/src/feedback/dto/create-feedback.dto.ts new file mode 100644 index 00000000..aeeba82a --- /dev/null +++ b/apps/api/src/feedback/dto/create-feedback.dto.ts @@ -0,0 +1 @@ +export class CreateFeedbackDto {} diff --git a/apps/api/src/feedback/dto/update-feedback.dto.ts b/apps/api/src/feedback/dto/update-feedback.dto.ts new file mode 100644 index 00000000..43838705 --- /dev/null +++ b/apps/api/src/feedback/dto/update-feedback.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateFeedbackDto } from './create-feedback.dto'; + +export class UpdateFeedbackDto extends PartialType(CreateFeedbackDto) {} diff --git a/apps/api/src/feedback/entities/feedback.entity.ts b/apps/api/src/feedback/entities/feedback.entity.ts new file mode 100644 index 00000000..2bcbcace --- /dev/null +++ b/apps/api/src/feedback/entities/feedback.entity.ts @@ -0,0 +1 @@ +export class Feedback {} diff --git a/apps/api/src/feedback/feedback.controller.spec.ts b/apps/api/src/feedback/feedback.controller.spec.ts new file mode 100644 index 00000000..dd210ecc --- /dev/null +++ b/apps/api/src/feedback/feedback.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { FeedbackController } from './feedback.controller'; +import { FeedbackService } from './feedback.service'; + +describe('FeedbackController', () => { + let controller: FeedbackController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [FeedbackController], + providers: [FeedbackService], + }).compile(); + + controller = module.get(FeedbackController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/apps/api/src/feedback/feedback.controller.ts b/apps/api/src/feedback/feedback.controller.ts new file mode 100644 index 00000000..2827b92e --- /dev/null +++ b/apps/api/src/feedback/feedback.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { FeedbackService } from './feedback.service'; +import { CreateFeedbackDto } from './dto/create-feedback.dto'; +import { UpdateFeedbackDto } from './dto/update-feedback.dto'; + +@Controller('feedback') +export class FeedbackController { + constructor(private readonly feedbackService: FeedbackService) {} + + @Post() + create(@Body() createFeedbackDto: CreateFeedbackDto) { + return this.feedbackService.create(createFeedbackDto); + } + + @Get() + findAll() { + return this.feedbackService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.feedbackService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateFeedbackDto: UpdateFeedbackDto) { + return this.feedbackService.update(+id, updateFeedbackDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.feedbackService.remove(+id); + } +} diff --git a/apps/api/src/feedback/feedback.module.ts b/apps/api/src/feedback/feedback.module.ts new file mode 100644 index 00000000..72e6d603 --- /dev/null +++ b/apps/api/src/feedback/feedback.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { FeedbackService } from './feedback.service'; +import { FeedbackController } from './feedback.controller'; + +@Module({ + controllers: [FeedbackController], + providers: [FeedbackService], +}) +export class FeedbackModule {} diff --git a/apps/api/src/feedback/feedback.service.spec.ts b/apps/api/src/feedback/feedback.service.spec.ts new file mode 100644 index 00000000..cfd5d39f --- /dev/null +++ b/apps/api/src/feedback/feedback.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { FeedbackService } from './feedback.service'; + +describe('FeedbackService', () => { + let service: FeedbackService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [FeedbackService], + }).compile(); + + service = module.get(FeedbackService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/apps/api/src/feedback/feedback.service.ts b/apps/api/src/feedback/feedback.service.ts new file mode 100644 index 00000000..78b9459d --- /dev/null +++ b/apps/api/src/feedback/feedback.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateFeedbackDto } from './dto/create-feedback.dto'; +import { UpdateFeedbackDto } from './dto/update-feedback.dto'; + +@Injectable() +export class FeedbackService { + create(createFeedbackDto: CreateFeedbackDto) { + return 'This action adds a new feedback'; + } + + findAll() { + return `This action returns all feedback`; + } + + findOne(id: number) { + return `This action returns a #${id} feedback`; + } + + update(id: number, updateFeedbackDto: UpdateFeedbackDto) { + return `This action updates a #${id} feedback`; + } + + remove(id: number) { + return `This action removes a #${id} feedback`; + } +} diff --git a/apps/api/src/grades/dto/create-grade.dto.ts b/apps/api/src/grades/dto/create-grade.dto.ts new file mode 100644 index 00000000..d375a9ff --- /dev/null +++ b/apps/api/src/grades/dto/create-grade.dto.ts @@ -0,0 +1 @@ +export class CreateGradeDto {} diff --git a/apps/api/src/grades/dto/update-grade.dto.ts b/apps/api/src/grades/dto/update-grade.dto.ts new file mode 100644 index 00000000..9041ad22 --- /dev/null +++ b/apps/api/src/grades/dto/update-grade.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateGradeDto } from './create-grade.dto'; + +export class UpdateGradeDto extends PartialType(CreateGradeDto) {} diff --git a/apps/api/src/grades/entities/grade.entity.ts b/apps/api/src/grades/entities/grade.entity.ts new file mode 100644 index 00000000..3b88a093 --- /dev/null +++ b/apps/api/src/grades/entities/grade.entity.ts @@ -0,0 +1 @@ +export class Grade {} diff --git a/apps/api/src/grades/grades.controller.spec.ts b/apps/api/src/grades/grades.controller.spec.ts new file mode 100644 index 00000000..dc98c821 --- /dev/null +++ b/apps/api/src/grades/grades.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { GradesController } from './grades.controller'; +import { GradesService } from './grades.service'; + +describe('GradesController', () => { + let controller: GradesController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [GradesController], + providers: [GradesService], + }).compile(); + + controller = module.get(GradesController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/apps/api/src/grades/grades.controller.ts b/apps/api/src/grades/grades.controller.ts new file mode 100644 index 00000000..2145902f --- /dev/null +++ b/apps/api/src/grades/grades.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { GradesService } from './grades.service'; +import { CreateGradeDto } from './dto/create-grade.dto'; +import { UpdateGradeDto } from './dto/update-grade.dto'; + +@Controller('grades') +export class GradesController { + constructor(private readonly gradesService: GradesService) {} + + @Post() + create(@Body() createGradeDto: CreateGradeDto) { + return this.gradesService.create(createGradeDto); + } + + @Get() + findAll() { + return this.gradesService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.gradesService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateGradeDto: UpdateGradeDto) { + return this.gradesService.update(+id, updateGradeDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.gradesService.remove(+id); + } +} diff --git a/apps/api/src/grades/grades.module.ts b/apps/api/src/grades/grades.module.ts new file mode 100644 index 00000000..b6a750da --- /dev/null +++ b/apps/api/src/grades/grades.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { GradesService } from './grades.service'; +import { GradesController } from './grades.controller'; + +@Module({ + controllers: [GradesController], + providers: [GradesService], +}) +export class GradesModule {} diff --git a/apps/api/src/grades/grades.service.spec.ts b/apps/api/src/grades/grades.service.spec.ts new file mode 100644 index 00000000..7b21295a --- /dev/null +++ b/apps/api/src/grades/grades.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { GradesService } from './grades.service'; + +describe('GradesService', () => { + let service: GradesService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [GradesService], + }).compile(); + + service = module.get(GradesService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/apps/api/src/grades/grades.service.ts b/apps/api/src/grades/grades.service.ts new file mode 100644 index 00000000..9ef2d878 --- /dev/null +++ b/apps/api/src/grades/grades.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateGradeDto } from './dto/create-grade.dto'; +import { UpdateGradeDto } from './dto/update-grade.dto'; + +@Injectable() +export class GradesService { + create(createGradeDto: CreateGradeDto) { + return 'This action adds a new grade'; + } + + findAll() { + return `This action returns all grades`; + } + + findOne(id: number) { + return `This action returns a #${id} grade`; + } + + update(id: number, updateGradeDto: UpdateGradeDto) { + return `This action updates a #${id} grade`; + } + + remove(id: number) { + return `This action removes a #${id} grade`; + } +} diff --git a/apps/api/src/submissions/dto/create-submission.dto.ts b/apps/api/src/submissions/dto/create-submission.dto.ts new file mode 100644 index 00000000..97e45ea2 --- /dev/null +++ b/apps/api/src/submissions/dto/create-submission.dto.ts @@ -0,0 +1 @@ +export class CreateSubmissionDto {} diff --git a/apps/api/src/submissions/dto/update-submission.dto.ts b/apps/api/src/submissions/dto/update-submission.dto.ts new file mode 100644 index 00000000..b21a8cd6 --- /dev/null +++ b/apps/api/src/submissions/dto/update-submission.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateSubmissionDto } from './create-submission.dto'; + +export class UpdateSubmissionDto extends PartialType(CreateSubmissionDto) {} diff --git a/apps/api/src/submissions/entities/submission.entity.ts b/apps/api/src/submissions/entities/submission.entity.ts new file mode 100644 index 00000000..17ac8bf2 --- /dev/null +++ b/apps/api/src/submissions/entities/submission.entity.ts @@ -0,0 +1 @@ +export class Submission {} diff --git a/apps/api/src/submissions/submissions.controller.spec.ts b/apps/api/src/submissions/submissions.controller.spec.ts new file mode 100644 index 00000000..4848b8f3 --- /dev/null +++ b/apps/api/src/submissions/submissions.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { SubmissionsController } from './submissions.controller'; +import { SubmissionsService } from './submissions.service'; + +describe('SubmissionsController', () => { + let controller: SubmissionsController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [SubmissionsController], + providers: [SubmissionsService], + }).compile(); + + controller = module.get(SubmissionsController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/apps/api/src/submissions/submissions.controller.ts b/apps/api/src/submissions/submissions.controller.ts new file mode 100644 index 00000000..11d60db6 --- /dev/null +++ b/apps/api/src/submissions/submissions.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { SubmissionsService } from './submissions.service'; +import { CreateSubmissionDto } from './dto/create-submission.dto'; +import { UpdateSubmissionDto } from './dto/update-submission.dto'; + +@Controller('submissions') +export class SubmissionsController { + constructor(private readonly submissionsService: SubmissionsService) {} + + @Post() + create(@Body() createSubmissionDto: CreateSubmissionDto) { + return this.submissionsService.create(createSubmissionDto); + } + + @Get() + findAll() { + return this.submissionsService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.submissionsService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateSubmissionDto: UpdateSubmissionDto) { + return this.submissionsService.update(+id, updateSubmissionDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.submissionsService.remove(+id); + } +} diff --git a/apps/api/src/submissions/submissions.module.ts b/apps/api/src/submissions/submissions.module.ts new file mode 100644 index 00000000..7bf12852 --- /dev/null +++ b/apps/api/src/submissions/submissions.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { SubmissionsService } from './submissions.service'; +import { SubmissionsController } from './submissions.controller'; + +@Module({ + controllers: [SubmissionsController], + providers: [SubmissionsService], +}) +export class SubmissionsModule {} diff --git a/apps/api/src/submissions/submissions.service.spec.ts b/apps/api/src/submissions/submissions.service.spec.ts new file mode 100644 index 00000000..fec43ee7 --- /dev/null +++ b/apps/api/src/submissions/submissions.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { SubmissionsService } from './submissions.service'; + +describe('SubmissionsService', () => { + let service: SubmissionsService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [SubmissionsService], + }).compile(); + + service = module.get(SubmissionsService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/apps/api/src/submissions/submissions.service.ts b/apps/api/src/submissions/submissions.service.ts new file mode 100644 index 00000000..73252394 --- /dev/null +++ b/apps/api/src/submissions/submissions.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateSubmissionDto } from './dto/create-submission.dto'; +import { UpdateSubmissionDto } from './dto/update-submission.dto'; + +@Injectable() +export class SubmissionsService { + create(createSubmissionDto: CreateSubmissionDto) { + return 'This action adds a new submission'; + } + + findAll() { + return `This action returns all submissions`; + } + + findOne(id: number) { + return `This action returns a #${id} submission`; + } + + update(id: number, updateSubmissionDto: UpdateSubmissionDto) { + return `This action updates a #${id} submission`; + } + + remove(id: number) { + return `This action removes a #${id} submission`; + } +} diff --git a/apps/api/src/users/dto/create-user.dto.ts b/apps/api/src/users/dto/create-user.dto.ts new file mode 100644 index 00000000..0311be13 --- /dev/null +++ b/apps/api/src/users/dto/create-user.dto.ts @@ -0,0 +1 @@ +export class CreateUserDto {} diff --git a/apps/api/src/users/dto/update-user.dto.ts b/apps/api/src/users/dto/update-user.dto.ts new file mode 100644 index 00000000..dfd37fb1 --- /dev/null +++ b/apps/api/src/users/dto/update-user.dto.ts @@ -0,0 +1,4 @@ +import { PartialType } from '@nestjs/mapped-types'; +import { CreateUserDto } from './create-user.dto'; + +export class UpdateUserDto extends PartialType(CreateUserDto) {} diff --git a/apps/api/src/users/entities/user.entity.ts b/apps/api/src/users/entities/user.entity.ts new file mode 100644 index 00000000..4f82c145 --- /dev/null +++ b/apps/api/src/users/entities/user.entity.ts @@ -0,0 +1 @@ +export class User {} diff --git a/apps/api/src/users/users.controller.spec.ts b/apps/api/src/users/users.controller.spec.ts new file mode 100644 index 00000000..a76d3103 --- /dev/null +++ b/apps/api/src/users/users.controller.spec.ts @@ -0,0 +1,20 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { UsersController } from './users.controller'; +import { UsersService } from './users.service'; + +describe('UsersController', () => { + let controller: UsersController; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + controllers: [UsersController], + providers: [UsersService], + }).compile(); + + controller = module.get(UsersController); + }); + + it('should be defined', () => { + expect(controller).toBeDefined(); + }); +}); diff --git a/apps/api/src/users/users.controller.ts b/apps/api/src/users/users.controller.ts new file mode 100644 index 00000000..3eca7ebd --- /dev/null +++ b/apps/api/src/users/users.controller.ts @@ -0,0 +1,34 @@ +import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'; +import { UsersService } from './users.service'; +import { CreateUserDto } from './dto/create-user.dto'; +import { UpdateUserDto } from './dto/update-user.dto'; + +@Controller('users') +export class UsersController { + constructor(private readonly usersService: UsersService) {} + + @Post() + create(@Body() createUserDto: CreateUserDto) { + return this.usersService.create(createUserDto); + } + + @Get() + findAll() { + return this.usersService.findAll(); + } + + @Get(':id') + findOne(@Param('id') id: string) { + return this.usersService.findOne(+id); + } + + @Patch(':id') + update(@Param('id') id: string, @Body() updateUserDto: UpdateUserDto) { + return this.usersService.update(+id, updateUserDto); + } + + @Delete(':id') + remove(@Param('id') id: string) { + return this.usersService.remove(+id); + } +} diff --git a/apps/api/src/users/users.module.ts b/apps/api/src/users/users.module.ts new file mode 100644 index 00000000..ecca17ad --- /dev/null +++ b/apps/api/src/users/users.module.ts @@ -0,0 +1,9 @@ +import { Module } from '@nestjs/common'; +import { UsersService } from './users.service'; +import { UsersController } from './users.controller'; + +@Module({ + controllers: [UsersController], + providers: [UsersService], +}) +export class UsersModule {} diff --git a/apps/api/src/users/users.service.spec.ts b/apps/api/src/users/users.service.spec.ts new file mode 100644 index 00000000..62815ba6 --- /dev/null +++ b/apps/api/src/users/users.service.spec.ts @@ -0,0 +1,18 @@ +import { Test, TestingModule } from '@nestjs/testing'; +import { UsersService } from './users.service'; + +describe('UsersService', () => { + let service: UsersService; + + beforeEach(async () => { + const module: TestingModule = await Test.createTestingModule({ + providers: [UsersService], + }).compile(); + + service = module.get(UsersService); + }); + + it('should be defined', () => { + expect(service).toBeDefined(); + }); +}); diff --git a/apps/api/src/users/users.service.ts b/apps/api/src/users/users.service.ts new file mode 100644 index 00000000..0a55903d --- /dev/null +++ b/apps/api/src/users/users.service.ts @@ -0,0 +1,26 @@ +import { Injectable } from '@nestjs/common'; +import { CreateUserDto } from './dto/create-user.dto'; +import { UpdateUserDto } from './dto/update-user.dto'; + +@Injectable() +export class UsersService { + create(createUserDto: CreateUserDto) { + return 'This action adds a new user'; + } + + findAll() { + return `This action returns all users`; + } + + findOne(id: number) { + return `This action returns a #${id} user`; + } + + update(id: number, updateUserDto: UpdateUserDto) { + return `This action updates a #${id} user`; + } + + remove(id: number) { + return `This action removes a #${id} user`; + } +} diff --git a/apps/docs/Assignment_rows.csv b/apps/docs/Assignment_rows.csv new file mode 100644 index 00000000..54f81b83 --- /dev/null +++ b/apps/docs/Assignment_rows.csv @@ -0,0 +1,4 @@ +id,title,description,due_date,post_date,course_id +1,Python Basics Homework,Write a program that prints the first 10 Fibonacci numbers.,2025-09-25 23:59:59,2025-09-15 09:00:00,1 +2,Linked List Implementation,Implement a singly linked list with insert and delete operations.,2025-09-28 23:59:59,2025-09-18 10:00:00,2 +3,Build a Personal Webpage,Create a simple portfolio site using HTML and CSS.,2025-10-01 23:59:59,2025-09-20 11:00:00,3 \ No newline at end of file diff --git a/apps/docs/Course_rows.csv b/apps/docs/Course_rows.csv new file mode 100644 index 00000000..6f845a06 --- /dev/null +++ b/apps/docs/Course_rows.csv @@ -0,0 +1,4 @@ +id,title,description,instructor_id,files +1,Intro to Programming,Learn the basics of Python programming.,2001,"[""syllabus.pdf"",""week1-slides.pptx""]" +2,Data Structures,"Covers arrays, linked lists, stacks, and trees.",2001,"[""syllabus.pdf"",""linked-list-guide.docx""]" +3,Web Development,"Introduction to HTML, CSS, and JavaScript.",2002,"[""syllabus.pdf"",""web-dev-resources.zip""]" \ No newline at end of file diff --git a/apps/docs/Feedback_rows.csv b/apps/docs/Feedback_rows.csv new file mode 100644 index 00000000..ab18cb24 --- /dev/null +++ b/apps/docs/Feedback_rows.csv @@ -0,0 +1,4 @@ +id,comment,submission_id,grade +1,Good effort! Try using a loop instead of hardcoding values.,1,85 +2,Excellent use of recursion. Clean code!,2,95 +3,Nice webpage structure. Add some styling with CSS.,3,90 \ No newline at end of file diff --git a/apps/docs/Grade_rows.csv b/apps/docs/Grade_rows.csv new file mode 100644 index 00000000..a963192c --- /dev/null +++ b/apps/docs/Grade_rows.csv @@ -0,0 +1,4 @@ +id,course_id,semester,grade,school_id +1,1,Fall 2025,88.5,1001 +2,1,Fall 2025,91,1002 +3,2,Fall 2025,76.3,1003 \ No newline at end of file diff --git a/apps/docs/Submission_rows.csv b/apps/docs/Submission_rows.csv new file mode 100644 index 00000000..70a3740e --- /dev/null +++ b/apps/docs/Submission_rows.csv @@ -0,0 +1,4 @@ +id,assignment_id,student_id,file +1,1,1001,alice-fibonacci.py +2,1,1002,bob-fibonacci.py +3,3,1003,charlie-portfolio.zip \ No newline at end of file diff --git a/apps/docs/User_rows.csv b/apps/docs/User_rows.csv new file mode 100644 index 00000000..91c707e3 --- /dev/null +++ b/apps/docs/User_rows.csv @@ -0,0 +1,7 @@ +id,school_id,name,email,role +1,1001,Alice Johnson,alice@example.com,STUDENT +2,1002,Bob Smith,bob@example.com,STUDENT +3,1003,Charlie Williams,charlie@example.com,STUDENT +4,2001,Prof. Dana Lee,dana@example.com,INSTRUCTOR +5,2002,Prof. Ethan Brown,ethan@example.com,INSTRUCTOR +6,9999,Admin User,admin@example.com,ADMIN \ No newline at end of file diff --git a/apps/docs/schemaAndData.md b/apps/docs/schemaAndData.md new file mode 100644 index 00000000..4ad07add --- /dev/null +++ b/apps/docs/schemaAndData.md @@ -0,0 +1,11 @@ +Link to prisma.schema: https://github.com/sampaez05/25-cisc474-individual/blob/main/packages/database/prisma/schema.prisma + +Link to Course csv: https://github.com/sampaez05/25-cisc474-individual/blob/main/apps/docs/Course_rows.csv + +Link to Assignment csv: https://github.com/sampaez05/25-cisc474-individual/blob/main/apps/docs/Feedback_rows.csv + +Link to Grade csv: https://github.com/sampaez05/25-cisc474-individual/blob/main/apps/docs/Grade_rows.csv + +Link to Submission csv: https://github.com/sampaez05/25-cisc474-individual/blob/main/apps/docs/Submission_rows.csv + +Link to User csv: https://github.com/sampaez05/25-cisc474-individual/blob/main/apps/docs/User_rows.csv \ No newline at end of file diff --git a/apps/web/app/[course]/assignment/page.tsx b/apps/web/app/[course]/assignment/page.tsx new file mode 100644 index 00000000..6ce2f636 --- /dev/null +++ b/apps/web/app/[course]/assignment/page.tsx @@ -0,0 +1,22 @@ +import Link from "next/link"; + +export default async function assignment({params}: {params: Promise<{ course: string}>}) { + const course = (await params).course; + return ( +
+ +

+

+

{course}

+

+

Assignment Name - Due Date

+

+

[Description]

+

+

Rubric

+

+ + +
+ ) +} \ No newline at end of file diff --git a/apps/web/app/[course]/course-grade/page.tsx b/apps/web/app/[course]/course-grade/page.tsx new file mode 100644 index 00000000..1295713a --- /dev/null +++ b/apps/web/app/[course]/course-grade/page.tsx @@ -0,0 +1,21 @@ +import Link from "next/link"; + +export default async function grade({params}: {params: Promise<{ course: string}>}) { + const course = (await params).course; + return ( +
+ +

+

+

{course}

+

+
  • Assignment Name - Grade
  • +
  • Assignment Name - Grade
  • +
  • Exam Name --------- Grade
  • +
  • Project Name ------- Grade
  • +
  • Assignment Name - Grade
  • +

    +
  • Final Grade --------- Grade
  • +
    + ) +} diff --git a/apps/web/app/[course]/lesson-plan/page.tsx b/apps/web/app/[course]/lesson-plan/page.tsx new file mode 100644 index 00000000..02c6a646 --- /dev/null +++ b/apps/web/app/[course]/lesson-plan/page.tsx @@ -0,0 +1,20 @@ +import Link from "next/link"; + +export default async function lessons({params}: {params: Promise<{ course: string}>}) { + const course = (await params).course; + return ( +
    + +

    +

    +

    {course}

    +

    +

    Topic - Week

    +

    +
  • Notes
  • +
  • Readings
  • +
  • Assignment 1 - Due Date
  • +
  • Assignment 2 - Due Date
  • +
    + ) +} \ No newline at end of file diff --git a/apps/web/app/[course]/page.tsx b/apps/web/app/[course]/page.tsx new file mode 100644 index 00000000..bc68887c --- /dev/null +++ b/apps/web/app/[course]/page.tsx @@ -0,0 +1,25 @@ +import Link from "next/link"; + +/** The parameters were causing issues with the deployment when I had an interface where params:{course:string} + * I was able to fix the issue by changing param's type to Promise<{ course: string}> + * This YouTube video was where I found this solution: https://www.youtube.com/watch?v=k9g6aVLH3p4 (around 4:06) + * This solution has been applied to all the pages under the [course] segment +*/ + +export default async function course({params}: {params: Promise<{ course: string}>}) { + const course = (await params).course; + return ( +
    + +

    +

    +

    {course} -------------------------- Grade

    +

    +
  • Syllabus
  • +
  • Lesson Plan
  • +
  • Assignment
  • +
  • Grade
  • + +
    + ) +} \ No newline at end of file diff --git a/apps/web/app/[course]/past-assignment/page.tsx b/apps/web/app/[course]/past-assignment/page.tsx new file mode 100644 index 00000000..f5150cbd --- /dev/null +++ b/apps/web/app/[course]/past-assignment/page.tsx @@ -0,0 +1,19 @@ +import Link from "next/link"; + +export default async function pastAssignment({params}: {params: Promise<{ course: string}>}) { + const course = (await params).course; + return ( +
    + +

    +

    +

    {course}

    +

    +

    Assignment Name

    +

    Grade: x/100

    +

    Feedback: [Any feedback left by the instructor]

    +

    Submission: [link/file/whatever submission type was]

    +

    Date Submitted: x/x/xxxx

    +
    + ) +} \ No newline at end of file diff --git a/apps/web/app/[course]/syllabus/page.tsx b/apps/web/app/[course]/syllabus/page.tsx new file mode 100644 index 00000000..cc71179c --- /dev/null +++ b/apps/web/app/[course]/syllabus/page.tsx @@ -0,0 +1,25 @@ +import Link from "next/link"; + +export default async function Syllabus({params}: {params: Promise<{ course: string}>}) { + const course = (await params).course; + return ( +
    + +

    +

    +

    Syllabus for {course}

    +

    +

    Late policy

    +

    [Description of late policy]

    +

    +

    Grading

    +

    [Grade breakdown and grade weighing]

    +

    +

    Office Hours

    +

    [Office hours times and locations]

    +

    +

    Contact Information

    +

    [Contact Info such as email, discord]

    +
    + ) +} \ No newline at end of file diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index fb037cb8..5c9a9125 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -1,70 +1,18 @@ -import Image, { type ImageProps } from "next/image"; -import { Button } from "@repo/ui/button"; -import styles from "./page.module.css"; -type Props = Omit & { - srcLight: string; - srcDark: string; -}; - -const ThemeImage = (props: Props) => { - const { srcLight, srcDark, ...rest } = props; - - return ( - <> - - - - ); -}; +import Link from "next/link"; export default function Home() { return ( -
    -
    -

    CISC474 Project Starter

    -
      -
    1. - Get started by editing{" "} - apps/web/app/page.tsx -
    2. -
    3. Save and see your changes instantly.
    4. -
    - - +
    +
    +

    Welcome to Your Courses

    +
  • Course 1
  • +
  • Course 2
  • +
  • Course 3
  • +
  • Course 4
  • +
  • Course 5
  • +

    -
    ); } diff --git a/apps/web/public/calendar-stock-img.jpg b/apps/web/public/calendar-stock-img.jpg new file mode 100644 index 00000000..a93ba312 Binary files /dev/null and b/apps/web/public/calendar-stock-img.jpg differ diff --git a/package-lock.json b/package-lock.json index a2988cde..22efe764 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11,6 +11,10 @@ "database" ], "dependencies": { + "@nestjs/common": "^11.1.6", + "@nestjs/core": "^11.1.6", + "@nestjs/mapped-types": "*", + "@nestjs/platform-express": "^11.1.6", "@prisma/client": "latest" }, "devDependencies": { @@ -3031,7 +3035,6 @@ "version": "11.1.6", "resolved": "https://registry.npmjs.org/@nestjs/common/-/common-11.1.6.tgz", "integrity": "sha512-krKwLLcFmeuKDqngG2N/RuZHCs2ycsKcxWIDgcm7i1lf3sQ0iG03ci+DsP/r3FcT/eJDFsIHnKtNta2LIi7PzQ==", - "license": "MIT", "dependencies": { "file-type": "21.0.0", "iterare": "1.2.1", @@ -3063,7 +3066,6 @@ "resolved": "https://registry.npmjs.org/@nestjs/core/-/core-11.1.6.tgz", "integrity": "sha512-siWX7UDgErisW18VTeJA+x+/tpNZrJewjTBsRPF3JVxuWRuAB1kRoiJcxHgln8Lb5UY9NdvklITR84DUEXD0Cg==", "hasInstallScript": true, - "license": "MIT", "dependencies": { "@nuxt/opencollective": "0.4.1", "fast-safe-stringify": "2.1.1", @@ -3123,7 +3125,6 @@ "version": "11.1.6", "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-11.1.6.tgz", "integrity": "sha512-HErwPmKnk+loTq8qzu1up+k7FC6Kqa8x6lJ4cDw77KnTxLzsCaPt+jBvOq6UfICmfqcqCCf3dKXg+aObQp+kIQ==", - "license": "MIT", "dependencies": { "cors": "2.8.5", "express": "5.1.0", diff --git a/package.json b/package.json index 74a2681f..dfd4c09a 100644 --- a/package.json +++ b/package.json @@ -15,13 +15,13 @@ "db:seed": "turbo run db:seed" }, "devDependencies": { - "prettier": "^3.6.2", - "turbo": "^2.5.6", - "prisma": "latest", - "typescript": "5.9.2", "@repo/eslint-config": "*", "@repo/typescript-config": "*", - "tsx": "4.19.1" + "prettier": "^3.6.2", + "prisma": "latest", + "tsx": "4.19.1", + "turbo": "^2.5.6", + "typescript": "5.9.2" }, "prisma": { "schema": "packages/database/prisma/schema.prisma", @@ -31,6 +31,10 @@ "node": ">=18" }, "dependencies": { + "@nestjs/common": "^11.1.6", + "@nestjs/core": "^11.1.6", + "@nestjs/mapped-types": "*", + "@nestjs/platform-express": "^11.1.6", "@prisma/client": "latest" }, "packageManager": "npm@10.9.0", diff --git a/packages/database/package.json b/packages/database/package.json index f2fd92ad..3bbd14f8 100644 --- a/packages/database/package.json +++ b/packages/database/package.json @@ -1,15 +1,23 @@ { "name": "@repo/database", "version": "1.0.0", + "main": "./dist/client.js", + "module": "./dist/client.mjs", + "types": "./dist/client.d.ts", "exports": { - ".": "./src/client.ts" + ".": { + "types": "./dist/client.d.ts", + "require": "./dist/client.js", + "import": "./dist/client.mjs" + } }, "scripts": { "db:migrate:deploy": "prisma migrate deploy", "db:migrate:dev": "prisma migrate dev", "db:push": "prisma db push", "db:seed": "tsx src/seed.ts", - "dev": "tsup src/* --watch", + "types": "tsc -p tsconfig.types.json", + "dev": "tsup src/* --format cjs,esm --watch --onSuccess \"npm run types\"", "format": "prisma format", "generate": "prisma generate", "lint": "eslint . --max-warnings 0", diff --git a/packages/database/prisma/migrations/20250918151319_update_schema/migration.sql b/packages/database/prisma/migrations/20250918151319_update_schema/migration.sql new file mode 100644 index 00000000..7c63ff65 --- /dev/null +++ b/packages/database/prisma/migrations/20250918151319_update_schema/migration.sql @@ -0,0 +1,67 @@ +-- CreateTable +CREATE TABLE "public"."User" ( + "id" SERIAL NOT NULL, + "school_id" INTEGER NOT NULL, + "name" TEXT, + "email" TEXT, + "role" TEXT, + + CONSTRAINT "User_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "public"."Grade" ( + "id" SERIAL NOT NULL, + "student_id" INTEGER NOT NULL, + "course_id" INTEGER NOT NULL, + "semester" TEXT NOT NULL, + "grade" DOUBLE PRECISION NOT NULL, + + CONSTRAINT "Grade_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "public"."Course" ( + "id" SERIAL NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT NOT NULL, + "instructor_id" INTEGER NOT NULL, + "files" TEXT NOT NULL, + + CONSTRAINT "Course_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "public"."Assignment" ( + "id" SERIAL NOT NULL, + "title" TEXT NOT NULL, + "description" TEXT NOT NULL, + "due_date" TIMESTAMP(3) NOT NULL, + "post_date" TIMESTAMP(3) NOT NULL, + "course_id" INTEGER NOT NULL, + + CONSTRAINT "Assignment_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "public"."Submission" ( + "id" SERIAL NOT NULL, + "assignment_id" INTEGER NOT NULL, + "student_id" INTEGER NOT NULL, + "file" TEXT NOT NULL, + + CONSTRAINT "Submission_pkey" PRIMARY KEY ("id") +); + +-- CreateTable +CREATE TABLE "public"."Feedback" ( + "id" SERIAL NOT NULL, + "comment" TEXT NOT NULL, + "submission_id" INTEGER NOT NULL, + "grade" DOUBLE PRECISION NOT NULL, + + CONSTRAINT "Feedback_pkey" PRIMARY KEY ("id") +); + +-- CreateIndex +CREATE UNIQUE INDEX "User_email_key" ON "public"."User"("email"); diff --git a/packages/database/prisma/migrations/20250919200746_ready/migration.sql b/packages/database/prisma/migrations/20250919200746_ready/migration.sql new file mode 100644 index 00000000..a638448e --- /dev/null +++ b/packages/database/prisma/migrations/20250919200746_ready/migration.sql @@ -0,0 +1,12 @@ +/* + Warnings: + + - The `files` column on the `Course` table would be dropped and recreated. This will lead to data loss if there is data in the column. + +*/ +-- AlterTable +ALTER TABLE "public"."Course" DROP COLUMN "files", +ADD COLUMN "files" TEXT[]; + +-- AlterTable +ALTER TABLE "public"."User" ALTER COLUMN "school_id" DROP NOT NULL; diff --git a/packages/database/prisma/migrations/20250919202555_ready/migration.sql b/packages/database/prisma/migrations/20250919202555_ready/migration.sql new file mode 100644 index 00000000..078e4c03 --- /dev/null +++ b/packages/database/prisma/migrations/20250919202555_ready/migration.sql @@ -0,0 +1,10 @@ +/* + Warnings: + + - You are about to drop the column `student_id` on the `Grade` table. All the data in the column will be lost. + - Added the required column `school_id` to the `Grade` table without a default value. This is not possible if the table is not empty. + +*/ +-- AlterTable +ALTER TABLE "public"."Grade" DROP COLUMN "student_id", +ADD COLUMN "school_id" INTEGER NOT NULL; diff --git a/packages/database/prisma/migrations/migration_lock.toml b/packages/database/prisma/migrations/migration_lock.toml new file mode 100644 index 00000000..044d57cd --- /dev/null +++ b/packages/database/prisma/migrations/migration_lock.toml @@ -0,0 +1,3 @@ +# Please do not edit this file manually +# It should be added in your version-control system (e.g., Git) +provider = "postgresql" diff --git a/packages/database/prisma/schema.prisma b/packages/database/prisma/schema.prisma index 03c84701..7616fd88 100644 --- a/packages/database/prisma/schema.prisma +++ b/packages/database/prisma/schema.prisma @@ -1,5 +1,7 @@ -// This is your Prisma schema file, -// learn more about it in the docs: https://pris.ly/d/prisma-schema +generator client { + provider = "prisma-client-js" + output = "../generated/client" +} datasource db { provider = "postgresql" @@ -7,14 +9,49 @@ datasource db { directUrl = env("DIRECT_URL") } -generator client { - provider = "prisma-client-js" - output = "../generated/client" +model User { + id Int @id @default(autoincrement()) + school_id Int? + name String? + email String? @unique + role String? } -model User { - id String @id @default(cuid()) - name String? - email String? @unique - emailVerified DateTime? +model Grade { + id Int @id @default(autoincrement()) + school_id Int + course_id Int + semester String + grade Float +} + +model Course { + id Int @id @default(autoincrement()) + title String + description String + instructor_id Int + files String[] +} + +model Assignment { + id Int @id @default(autoincrement()) + title String + description String + due_date DateTime + post_date DateTime + course_id Int +} + +model Submission { + id Int @id @default(autoincrement()) + assignment_id Int + student_id Int + file String +} + +model Feedback { + id Int @id @default(autoincrement()) + comment String + submission_id Int + grade Float } diff --git a/packages/database/seed-data/README.md b/packages/database/seed-data/README.md new file mode 100644 index 00000000..da135be6 --- /dev/null +++ b/packages/database/seed-data/README.md @@ -0,0 +1,15 @@ +The JSON files in this folder were generated by chatGPT using the following prompt: + +"Can you generate JSON files with fake data that fits the following schema: + +User: id (int), school_id (int), name (text), email (text), role (text) + +Course: id (int), title (text), description (text), instructor_id (int), files, where instructor_id is related to the user's school_id + +Grades: id (int), school_id (int), course_id (int), semester (text), grade (float) where school_id is related to the user's school_id and course_id is related to the id in the course data + +Assignment: id (int), title (text), description (text), due date (datetime), post date (datetime), course_id (int) where course_id is related to the id in the course data + +Submission: id (int), assignment_id (int), student_id (int), file, where assignment_id is related to the id in the assignment data and student_id is related to the school_id in the user data + +Feedback: id (int), comment (text), submission_id (int), grade (float), where the submission_id is related to the id in the submission data" \ No newline at end of file diff --git a/packages/database/seed-data/assignments.json b/packages/database/seed-data/assignments.json new file mode 100644 index 00000000..ad4efd2b --- /dev/null +++ b/packages/database/seed-data/assignments.json @@ -0,0 +1,27 @@ +[ + { + "id": 1, + "title": "Python Basics Homework", + "description": "Write a program that prints the first 10 Fibonacci numbers.", + "due_date": "2025-09-25T23:59:59Z", + "post_date": "2025-09-15T09:00:00Z", + "course_id": 1 + }, + { + "id": 2, + "title": "Linked List Implementation", + "description": "Implement a singly linked list with insert and delete operations.", + "due_date": "2025-09-28T23:59:59Z", + "post_date": "2025-09-18T10:00:00Z", + "course_id": 2 + }, + { + "id": 3, + "title": "Build a Personal Webpage", + "description": "Create a simple portfolio site using HTML and CSS.", + "due_date": "2025-10-01T23:59:59Z", + "post_date": "2025-09-20T11:00:00Z", + "course_id": 3 + } +] + \ No newline at end of file diff --git a/packages/database/seed-data/courses.json b/packages/database/seed-data/courses.json new file mode 100644 index 00000000..2ce02bfa --- /dev/null +++ b/packages/database/seed-data/courses.json @@ -0,0 +1,24 @@ +[ + { + "id": 1, + "title": "Intro to Programming", + "description": "Learn the basics of Python programming.", + "instructor_id": 2001, + "files": ["syllabus.pdf", "week1-slides.pptx"] + }, + { + "id": 2, + "title": "Data Structures", + "description": "Covers arrays, linked lists, stacks, and trees.", + "instructor_id": 2001, + "files": ["syllabus.pdf", "linked-list-guide.docx"] + }, + { + "id": 3, + "title": "Web Development", + "description": "Introduction to HTML, CSS, and JavaScript.", + "instructor_id": 2002, + "files": ["syllabus.pdf", "web-dev-resources.zip"] + } +] + \ No newline at end of file diff --git a/packages/database/seed-data/feedback.json b/packages/database/seed-data/feedback.json new file mode 100644 index 00000000..597561fd --- /dev/null +++ b/packages/database/seed-data/feedback.json @@ -0,0 +1,21 @@ +[ + { + "id": 1, + "comment": "Good effort! Try using a loop instead of hardcoding values.", + "submission_id": 1, + "grade": 85.0 + }, + { + "id": 2, + "comment": "Excellent use of recursion. Clean code!", + "submission_id": 2, + "grade": 95.0 + }, + { + "id": 3, + "comment": "Nice webpage structure. Add some styling with CSS.", + "submission_id": 3, + "grade": 90.0 + } +] + \ No newline at end of file diff --git a/packages/database/seed-data/grades.json b/packages/database/seed-data/grades.json new file mode 100644 index 00000000..d6d557b4 --- /dev/null +++ b/packages/database/seed-data/grades.json @@ -0,0 +1,6 @@ +[ + { "id": 1, "school_id": 1001, "course_id": 1, "semester": "Fall 2025", "grade": 88.5 }, + { "id": 2, "school_id": 1002, "course_id": 1, "semester": "Fall 2025", "grade": 91.0 }, + { "id": 3, "school_id": 1003, "course_id": 2, "semester": "Fall 2025", "grade": 76.3 } +] + \ No newline at end of file diff --git a/packages/database/seed-data/submissions.json b/packages/database/seed-data/submissions.json new file mode 100644 index 00000000..ef22af4f --- /dev/null +++ b/packages/database/seed-data/submissions.json @@ -0,0 +1,21 @@ +[ + { + "id": 1, + "assignment_id": 1, + "student_id": 1001, + "file": "alice-fibonacci.py" + }, + { + "id": 2, + "assignment_id": 1, + "student_id": 1002, + "file": "bob-fibonacci.py" + }, + { + "id": 3, + "assignment_id": 3, + "student_id": 1003, + "file": "charlie-portfolio.zip" + } +] + \ No newline at end of file diff --git a/packages/database/seed-data/users.json b/packages/database/seed-data/users.json new file mode 100644 index 00000000..ec893d40 --- /dev/null +++ b/packages/database/seed-data/users.json @@ -0,0 +1,9 @@ +[ + { "id": 1, "school_id": 1001, "name": "Alice Johnson", "email": "alice@example.com", "role": "STUDENT" }, + { "id": 2, "school_id": 1002, "name": "Bob Smith", "email": "bob@example.com", "role": "STUDENT" }, + { "id": 3, "school_id": 1003, "name": "Charlie Williams", "email": "charlie@example.com", "role": "STUDENT" }, + { "id": 4, "school_id": 2001, "name": "Prof. Dana Lee", "email": "dana@example.com", "role": "INSTRUCTOR" }, + { "id": 5, "school_id": 2002, "name": "Prof. Ethan Brown", "email": "ethan@example.com", "role": "INSTRUCTOR" }, + { "id": 6, "school_id": 9999, "name": "Admin User", "email": "admin@example.com", "role": "ADMIN" } +] + \ No newline at end of file diff --git a/packages/database/src/seed.ts b/packages/database/src/seed.ts index a64ae69d..a5410985 100644 --- a/packages/database/src/seed.ts +++ b/packages/database/src/seed.ts @@ -1,22 +1,32 @@ import { prisma } from "./client"; +import path from "path"; +import fs from "fs"; +import type { User, Grade, Course, Assignment, Submission, Feedback } from "../generated/client"; +import type usersData from "../seed-data/users.json"; -import type { User } from "../generated/client"; - -const DEFAULT_USERS = [ +/*const DEFAULT_USERS = [ // Add your own user to pre-populate the database with { name: "Tim Apple", email: "tim@apple.com", }, -] as Array>; +] as Array>; */ + +const DEFAULT_USERS = loadJSON("users.json"); +const DEFAULT_COURSES = loadJSON("courses.json"); +const DEFAULT_GRADES = loadJSON("grades.json"); +const DEFAULT_ASSIGNMENTS = loadJSON("assignments.json"); +const DEFAULT_SUBMISSIONS = loadJSON("submissions.json"); +const DEFAULT_FEEDBACK = loadJSON("feedback.json"); (async () => { try { await Promise.all( - DEFAULT_USERS.map((user) => + DEFAULT_USERS.map((user:User) => prisma.user.upsert({ where: { - email: user.email!, + id: user.id, + school_id: user.school_id, }, update: { ...user, @@ -27,6 +37,81 @@ const DEFAULT_USERS = [ }) ) ); + await Promise.all( + DEFAULT_COURSES.map((course:Course) => + prisma.course.upsert({ + where: { + id: course.id, + }, + update: { + ...course, + }, + create: { + ...course, + }, + }) + ) + ); + await Promise.all( + DEFAULT_GRADES.map((grade:Grade) => + prisma.grade.upsert({ + where: { + id: grade.id, + }, + update: { + ...grade, + }, + create: { + ...grade, + }, + }) + ) + ); + await Promise.all( + DEFAULT_ASSIGNMENTS.map((assignment:Assignment) => + prisma.assignment.upsert({ + where: { + id: assignment.id, + }, + update: { + ...assignment, + }, + create: { + ...assignment, + }, + }) + ) + ); + await Promise.all( + DEFAULT_SUBMISSIONS.map((submission:Submission) => + prisma.submission.upsert({ + where: { + id: submission.id, + }, + update: { + ...submission, + }, + create: { + ...submission, + }, + }) + ) + ); + await Promise.all( + DEFAULT_FEEDBACK.map((feedback:Feedback) => + prisma.feedback.upsert({ + where: { + id: feedback.id, + }, + update: { + ...feedback, + }, + create: { + ...feedback, + }, + }) + ) + ); } catch (error) { console.error(error); process.exit(1); @@ -34,3 +119,13 @@ const DEFAULT_USERS = [ await prisma.$disconnect(); } })(); + +// loads JSON file to be seeded in +function loadJSON(filename: string) { + const filePath = path.join(__dirname,"seed-data", filename) + //builds the full file path using just the file name (ex. users.json) + return JSON.parse(fs.readFileSync(filePath,"utf-8")); + //utf-8 makes function return a string + //JSON.parse converts string into JavaScript +} + diff --git a/packages/database/tsconfig.json b/packages/database/tsconfig.json index a7f7fdee..51651873 100644 --- a/packages/database/tsconfig.json +++ b/packages/database/tsconfig.json @@ -1,5 +1,12 @@ { "extends": "@repo/typescript-config/base.json", + "compilerOptions": { + "declaration": true, + "emitDeclarationOnly": true, + "outDir": "dist", + "composite": false, + "noEmit": false + }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", "tsup.config.ts"], "exclude": ["node_modules"] } diff --git a/packages/typescript-config/base.json b/packages/typescript-config/base.json index 5117f2a3..492bee28 100644 --- a/packages/typescript-config/base.json +++ b/packages/typescript-config/base.json @@ -7,7 +7,6 @@ "incremental": false, "isolatedModules": true, "lib": ["es2022", "DOM", "DOM.Iterable"], - "module": "NodeNext", "moduleDetection": "force", "moduleResolution": "NodeNext", "noUncheckedIndexedAccess": true, diff --git a/packages/typescript-config/nestjs.json b/packages/typescript-config/nestjs.json index 399a8ed1..48ba0579 100644 --- a/packages/typescript-config/nestjs.json +++ b/packages/typescript-config/nestjs.json @@ -7,8 +7,7 @@ "experimentalDecorators": true, "forceConsistentCasingInFileNames": false, "incremental": true, - "module": "commonjs", - "moduleResolution": "Node10", + "module": "NodeNext", "noFallthroughCasesInSwitch": false, "noImplicitAny": false, "removeComments": true, @@ -17,4 +16,4 @@ "strictNullChecks": false, "strictBindCallApply": false } -} +} \ No newline at end of file diff --git a/requirements.md b/requirements.md new file mode 100644 index 00000000..9ee6e03b --- /dev/null +++ b/requirements.md @@ -0,0 +1,10 @@ +## Website Planning + +- User Stories: https://docs.google.com/document/d/1EL1pDPADpDb-U2Jicey_trV3Lz-Bf3xF9XI3Z44gPa0/edit?tab=t.0 + +- Site Mapping: https://docs.google.com/document/d/1RBvX-KSpJj9-l75XciAwHnosZNJ4dItIxCzITSfSDcM/edit?tab=t.0 + +- Wireframes: https://drive.google.com/file/d/1R-xyUyJb68NAAPX8zqTyj13IkTYOvPqB/view?usp=sharing + +- Data Model: https://drive.google.com/file/d/1QtLEi6E5MbCLGR-QEdtbb8TWNILlfcT0/view?usp=sharing +