feat: initialize monorepo structure with Bun and Turborepo

- Add package.json for the root with workspace configuration and scripts
- Create @gruperly/config package with TypeScript configuration
- Establish shared package @gruperly/shared with Zod schemas for validation
- Implement group, student, and payment schemas using Zod
- Set up TypeScript configuration for shared package
- Document stack architecture and technical specifications in stack.md
- Configure Turborepo with build, dev, lint, and typecheck tasks
This commit is contained in:
Jose Selesan
2026-08-28 17:03:53 -03:00
parent 52b3074631
commit ed8d280995
50 changed files with 1660 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
{
"name": "@gruperly/config",
"version": "0.1.0",
"private": true,
"type": "module"
}

View File

@@ -0,0 +1,17 @@
{
"$schema": "https://json.schemastore.org/tsconfig",
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"lib": ["ES2022"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"declaration": true
}
}

View File

@@ -0,0 +1,22 @@
{
"name": "@gruperly/shared",
"version": "0.1.0",
"private": true,
"type": "module",
"main": "./src/index.ts",
"types": "./src/index.ts",
"exports": {
".": "./src/index.ts",
"./schemas/*": "./src/schemas/*"
},
"scripts": {
"typecheck": "tsc --noEmit"
},
"dependencies": {
"zod": "^3.24.0"
},
"devDependencies": {
"@prisma/client": "^6.0.0",
"typescript": "^5.7.0"
}
}

View File

@@ -0,0 +1,3 @@
export * from './schemas/group.schema'
export * from './schemas/student.schema'
export * from './schemas/payment.schema'

View File

@@ -0,0 +1,15 @@
import { z } from 'zod'
export const createGroupSchema = z.object({
name: z.string().min(1, 'El nombre es obligatorio'),
description: z.string().optional(),
})
export const updateGroupSchema = createGroupSchema.partial()
export const groupIdParamsSchema = z.object({
id: z.string().min(1),
})
export type CreateGroupInput = z.infer<typeof createGroupSchema>
export type UpdateGroupInput = z.infer<typeof updateGroupSchema>

View File

@@ -0,0 +1,17 @@
import { z } from 'zod'
export const paymentStatusSchema = z.enum(['PENDING', 'PAID', 'OVERDUE', 'CANCELLED'])
export const createPaymentSchema = z.object({
groupId: z.string().min(1),
studentId: z.string().min(1),
amount: z.coerce.number().positive(),
currency: z.string().default('MXN'),
dueDate: z.coerce.date(),
status: paymentStatusSchema.optional(),
})
export const updatePaymentSchema = createPaymentSchema.partial()
export type CreatePaymentInput = z.infer<typeof createPaymentSchema>
export type UpdatePaymentInput = z.infer<typeof updatePaymentSchema>

View File

@@ -0,0 +1,16 @@
import { z } from 'zod'
export const createStudentSchema = z.object({
groupId: z.string().min(1),
fullName: z.string().min(1, 'El nombre completo es obligatorio'),
email: z.string().email().optional().or(z.literal('')),
phone: z.string().optional().or(z.literal('')),
guardianName: z.string().optional().or(z.literal('')),
guardianPhone: z.string().optional().or(z.literal('')),
notes: z.string().optional().or(z.literal('')),
})
export const updateStudentSchema = createStudentSchema.omit({ groupId: true }).partial()
export type CreateStudentInput = z.infer<typeof createStudentSchema>
export type UpdateStudentInput = z.infer<typeof updateStudentSchema>

View File

@@ -0,0 +1,10 @@
{
"extends": "@gruperly/config/tsconfig.base.json",
"compilerOptions": {
"moduleResolution": "bundler",
"paths": {
"@gruperly/shared": ["./src/index.ts"]
}
},
"include": ["src/**/*.ts"]
}