This repository is a monorepo containing multiple services. Please follow these guidelines when working on this codebase.
api/- NestJS API service (TypeScript)frontend/- Next.js frontend application (TypeScript)github-service/- NestJS service for GitHub integration (TypeScript)k8s-service/- Kubernetes management service (Go)
- Package Manager:
pnpmis used for JavaScript/TypeScript projects. - Go: Standard Go toolchain (1.23+) and
make.
- Build:
pnpm build(Runsnest build) - Lint:
pnpm lint(Runseslint) - Format:
pnpm format(Runsprettier) - Run Dev:
pnpm start:dev - Test:
pnpm test(Runsjest) - Run Single Test:
# Run a specific test file npx jest src/path/to/file.spec.ts # Run a specific test case by name pnpm test -- -t "should do something"
- Build:
pnpm build(Runsnext build) - Dev:
pnpm dev - Lint:
pnpm lint - Run Single Test: (Assuming standard Jest/Vitest setup if present, otherwise rely on linting/build)
pnpm test -- path/to/file
- Build:
make build(compiles tobin/server) - Run:
make run - Test:
make test(Runsgo test -v ./...) - Run Single Test:
# Run tests in a specific package go test -v ./internal/package_name # Run a specific test function go test -v ./internal/package_name -run TestName
- Formatting: Use Prettier. 2 spaces indentation. Double quotes for strings and imports. Semicolons required.
- Naming:
- Variables/Functions:
camelCase - Classes/Interfaces/Components:
PascalCase - Files:
kebab-case.ts(NestJS conventions),PascalCase.tsx(React components) orpage.tsx/layout.tsx(Next.js App Router).
- Variables/Functions:
- Imports: Clean and organized. Remove unused imports.
- Typing: Strict TypeScript. Avoid
anywhere possible. Use interfaces/types for DTOs and props. - NestJS Specifics:
- Use Dependency Injection via constructors.
- Use Decorators (
@Injectable(),@Controller(),@Get()) appropriately. - Follow
module->controller->servicearchitecture.
- Next.js Specifics:
- Use App Router structure (
app/). - Mark Client Components with
"use client"at the top. - Use Tailwind CSS for styling.
- UI Components: ONLY use
shadcn/uicomponents for building UIs. Do not introduce other UI libraries or create custom components if ashadcnequivalent exists. Checkcomponents/uiorcomponents.jsonfor available components.
- Use App Router structure (
- Formatting: Standard
gofmt. - Project Layout: Follows Standard Go Project Layout (
cmd/,internal/,pkg/). - Error Handling:
- Return errors as the last return value.
- Check errors immediately:
if err != nil { return err }. - Don't panic unless during startup.
- Logging: Use
zap.SugaredLogger. - Web Framework: Uses
echo. - Configuration: Uses
internal/configand environment variables.
- Context is King: Always analyze the surrounding code before making changes to match the existing style.
- Verify Changes: Run the lint and test commands for the specific service you are modifying before declaring the task complete.
- Monorepo Awareness: Be aware of which directory you are in. Do not run
npmcommands in the root if you intend to affect a specific service;cdinto the service directory or usepnpm --filter. - No Blind Edits: Use
readto check file contents beforeeditorwrite. - Paths: Always use absolute paths for file operations.