A TypeScript-based backend server template for PR review automation.
- Fastify Server: High-performance web framework
- TypeScript: Full type safety and modern JavaScript features
- GitHub Integration: Webhook handling for PR events
- LLM Support: Pluggable LLM providers (Gemma, OpenAI)
- Code Quality: Biome for linting and formatting
- Pre-commit Hooks: Automated code quality checks
kkachinote/
├── src/
│ ├── index.ts # Fastify entry point
│ ├── config.ts # Environment configuration
│ ├── handlers/ # GitHub webhook handlers
│ │ └── webhook.ts
│ ├── plugins/ # Feature modules
│ │ ├── review.ts # PR review functionality
│ │ ├── summary.ts # PR summary generation
│ │ └── index.ts
│ ├── llm/ # LLM integration modules
│ │ ├── base.ts # Base LLM interface
│ │ ├── gemma.ts # Gemma provider
│ │ ├── openai.ts # OpenAI provider
│ │ ├── factory.ts # Provider factory
│ │ └── index.ts
│ └── utils/ # Utilities
│ └── logger.ts # Pino logger setup
├── .env.template # Environment variables template
├── .biome.json # Biome configuration
├── .husky/ # Git hooks
├── lint-staged.config.js # Lint-staged configuration
├── tsconfig.json # TypeScript configuration
├── package.json # Package configuration
└── README.md
-
Install dependencies:
pnpm install
-
Setup environment variables:
cp .env.template .env
Edit
.envwith your configuration values. -
Initialize git hooks:
pnpm prepare
# Start development server
pnpm dev
# Build for production
pnpm build
# Start production server
pnpm startPORT: Server port (default: 3000)GITHUB_TOKEN: GitHub API tokenSLACK_WEBHOOK_URL: Slack webhook URL for notificationsLLM_BACKEND: LLM provider (gemma, openai)LOG_LEVEL: Logging level (default: info)
POST /webhook: GitHub webhook endpointGET /health: Health check endpoint
ISC