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:
3
apps/api/src/db/client.ts
Normal file
3
apps/api/src/db/client.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { PrismaClient } from '@prisma/client'
|
||||
|
||||
export const prisma = new PrismaClient()
|
||||
3
apps/api/src/db/index.ts
Normal file
3
apps/api/src/db/index.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import { prisma } from './client'
|
||||
|
||||
export { prisma }
|
||||
30
apps/api/src/index.ts
Normal file
30
apps/api/src/index.ts
Normal file
@@ -0,0 +1,30 @@
|
||||
import { Hono } from 'hono'
|
||||
import { cors } from 'hono/cors'
|
||||
import { authRoutes } from './routes/auth'
|
||||
import { groupsRoutes } from './routes/groups'
|
||||
import { studentsRoutes } from './routes/students'
|
||||
import { paymentsRoutes } from './routes/payments'
|
||||
import { waitlistRoutes } from './routes/waitlist'
|
||||
|
||||
const app = new Hono()
|
||||
|
||||
app.use('*', cors())
|
||||
|
||||
app.get('/', (c) => c.json({ name: 'Gruperly API', status: 'ok' }))
|
||||
|
||||
app.route('/auth', authRoutes)
|
||||
app.route('/groups', groupsRoutes)
|
||||
app.route('/students', studentsRoutes)
|
||||
app.route('/payments', paymentsRoutes)
|
||||
app.route('/waitlist', waitlistRoutes)
|
||||
|
||||
export default app
|
||||
|
||||
const port = Number(Bun.env.PORT ?? 4000)
|
||||
|
||||
Bun.serve({
|
||||
port,
|
||||
fetch: app.fetch,
|
||||
})
|
||||
|
||||
console.log(`Gruperly API running on http://localhost:${port}`)
|
||||
5
apps/api/src/routes/auth.ts
Normal file
5
apps/api/src/routes/auth.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
export const authRoutes = new Hono()
|
||||
|
||||
authRoutes.get('/session', (c) => c.json({ message: 'placeholder' }))
|
||||
5
apps/api/src/routes/groups.ts
Normal file
5
apps/api/src/routes/groups.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
export const groupsRoutes = new Hono()
|
||||
|
||||
groupsRoutes.get('/', (c) => c.json([]))
|
||||
5
apps/api/src/routes/payments.ts
Normal file
5
apps/api/src/routes/payments.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
export const paymentsRoutes = new Hono()
|
||||
|
||||
paymentsRoutes.get('/', (c) => c.json([]))
|
||||
5
apps/api/src/routes/students.ts
Normal file
5
apps/api/src/routes/students.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
export const studentsRoutes = new Hono()
|
||||
|
||||
studentsRoutes.get('/', (c) => c.json([]))
|
||||
5
apps/api/src/routes/waitlist.ts
Normal file
5
apps/api/src/routes/waitlist.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { Hono } from 'hono'
|
||||
|
||||
export const waitlistRoutes = new Hono()
|
||||
|
||||
waitlistRoutes.get('/', (c) => c.json([]))
|
||||
Reference in New Issue
Block a user