feat: Khởi tạo Prisma client, bổ sung các bài kiểm tra đơn vị và tích hợp, đồng thời điều chỉnh cấu hình dịch vụ.

This commit is contained in:
Ho Ngoc Hai
2026-01-04 09:34:37 +07:00
parent 1a2103f86e
commit 0d48dedc08
113 changed files with 42779 additions and 122 deletions

View File

@@ -0,0 +1,28 @@
# Architecture Rules
## Monorepo Structure
- **Apps**: Next.js (web) + Flutter (mobile)
- **Services**: Node.js/TypeScript microservices (Express)
- **Packages**: Shared libraries (logger, types, http-client, auth-sdk, tracing)
- **Infrastructure**: Traefik (API Gateway), Redis, Neon PostgreSQL, Observability
- **Deployments**: Local (Docker Compose), Staging/Production (Kubernetes)
## Template Location
- `services/_template/`: Always use this as the starting point for creating new services.
## Technology Stack
### Frontend
- Next.js 14+ (App Router), TypeScript, Tailwind CSS, Zustand
- Flutter 3.x with Provider pattern
- Prefer `@goodgo/types` and `@goodgo/http-client`
### Backend
- Node.js 20+, TypeScript 5+, Express
- Prisma ORM + Neon PostgreSQL
- Zod for validation
- Standard packages: `@goodgo/logger`, `@goodgo/tracing`, `@goodgo/auth-sdk`
### Infrastructure
- Traefik: Path-based routing
- Redis: Caching
- Monitoring: Prometheus, Grafana, Loki

View File

@@ -0,0 +1,19 @@
# Naming Conventions
## General Rules
- **Services/Packages**: `kebab-case` (e.g., `auth-service`, `http-client`)
- **Files**: `kebab-case.type.ts` (e.g., `user.controller.ts`, `auth.middleware.ts`)
- **Components**:
- React/Next.js: `PascalCase.tsx`
- Flutter: `snake_case.dart`
- **Classes**: `PascalCase`
- **Functions**: `camelCase`
- **Constants**: `UPPER_SNAKE_CASE`
- **Package Names**: `@goodgo/package-name`
## Specific Examples
- Controller: `user.controller.ts`
- Service: `user.service.ts`
- Repository: `user.repository.ts`
- Middleware: `auth.middleware.ts`
- DTO: `create-user.dto.ts`