Feature/Use fastify instead of express (#1)
- Replaced Apollo Server with Mercurius for GraphQL API - Updated resolvers to use Mercurius-compatible GraphQL implementation - Migrated from Express to Fastify for server framework - Improved error handling with GraphQL error extensions - Added Zod for environment variable validation - Updated Prisma schema and migrations - Configured CORS and WebSocket subscriptions - Simplified GraphQL schema and resolver structure - Enhanced type safety and code organization - Replaced Apollo Server with Mercurius for GraphQL API - Updated resolvers to use Mercurius-compatible GraphQL implementation - Migrated from Express to Fastify for server framework - Improved error handling with GraphQL error extensions - Added Zod for environment variable validation - Updated Prisma schema and migrations - Configured CORS and WebSocket subscriptions - Simplified GraphQL schema and resolver structure - Enhanced type safety and code organization Reviewed-on: #1 Co-authored-by: Jusemon <juansmm@outlook.com> Co-committed-by: Jusemon <juansmm@outlook.com>
This commit is contained in:
		
							parent
							
								
									b4e5a04126
								
							
						
					
					
						commit
						6214b503bc
					
				
					 47 changed files with 4968 additions and 5424 deletions
				
			
		
							
								
								
									
										62
									
								
								apps/api/prisma/migrations/20250306073430_init/migration.sql
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										62
									
								
								apps/api/prisma/migrations/20250306073430_init/migration.sql
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,62 @@ | |||
| -- CreateTable | ||||
| CREATE TABLE `User` ( | ||||
|     `id` VARCHAR(191) NOT NULL, | ||||
|     `email` VARCHAR(191) NOT NULL, | ||||
|     `username` VARCHAR(191) NOT NULL, | ||||
|     `password` VARCHAR(191) NOT NULL, | ||||
|     `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||||
|     `updatedAt` DATETIME(3) NOT NULL, | ||||
| 
 | ||||
|     UNIQUE INDEX `User_email_key`(`email`), | ||||
|     UNIQUE INDEX `User_username_key`(`username`), | ||||
|     PRIMARY KEY (`id`) | ||||
| ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||||
| 
 | ||||
| -- CreateTable | ||||
| CREATE TABLE `Room` ( | ||||
|     `id` VARCHAR(191) NOT NULL, | ||||
|     `name` VARCHAR(191) NOT NULL, | ||||
|     `description` VARCHAR(191) NULL, | ||||
|     `isPrivate` BOOLEAN NOT NULL DEFAULT false, | ||||
|     `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||||
|     `updatedAt` DATETIME(3) NOT NULL, | ||||
|     `ownerId` VARCHAR(191) NOT NULL, | ||||
| 
 | ||||
|     PRIMARY KEY (`id`) | ||||
| ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||||
| 
 | ||||
| -- CreateTable | ||||
| CREATE TABLE `Message` ( | ||||
|     `id` VARCHAR(191) NOT NULL, | ||||
|     `content` VARCHAR(191) NOT NULL, | ||||
|     `createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||||
|     `updatedAt` DATETIME(3) NOT NULL, | ||||
|     `userId` VARCHAR(191) NOT NULL, | ||||
|     `roomId` VARCHAR(191) NOT NULL, | ||||
| 
 | ||||
|     PRIMARY KEY (`id`) | ||||
| ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||||
| 
 | ||||
| -- CreateTable | ||||
| CREATE TABLE `_RoomMembers` ( | ||||
|     `A` VARCHAR(191) NOT NULL, | ||||
|     `B` VARCHAR(191) NOT NULL, | ||||
| 
 | ||||
|     UNIQUE INDEX `_RoomMembers_AB_unique`(`A`, `B`), | ||||
|     INDEX `_RoomMembers_B_index`(`B`) | ||||
| ) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE `Room` ADD CONSTRAINT `Room_ownerId_fkey` FOREIGN KEY (`ownerId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE `Message` ADD CONSTRAINT `Message_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE `Message` ADD CONSTRAINT `Message_roomId_fkey` FOREIGN KEY (`roomId`) REFERENCES `Room`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE `_RoomMembers` ADD CONSTRAINT `_RoomMembers_A_fkey` FOREIGN KEY (`A`) REFERENCES `Room`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; | ||||
| 
 | ||||
| -- AddForeignKey | ||||
| ALTER TABLE `_RoomMembers` ADD CONSTRAINT `_RoomMembers_B_fkey` FOREIGN KEY (`B`) REFERENCES `User`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue