Co-Pilot / 辅助式
更新于 24 days ago

basilic

Bblockmatic
0.0k
blockmatic/basilic
82
Agent 评分

💡 摘要

Basilic 是一个 TypeScript 单体仓库,具有 REST API 架构,优化了开发工作流程。

🎯 适合人群

TypeScript 开发者API 开发者DevOps 工程师软件架构师技术项目经理

🤖 AI 吐槽:看起来很能打,但别让配置把人劝退。

安全分析中风险

风险:Medium。建议检查:是否执行 shell/命令行指令;是否发起外网请求(SSRF/数据外发);API Key/Token 的获取、存储与泄露风险。以最小权限运行,并在生产环境启用前审计代码与依赖。

Basilic

TypeScript monorepo with REST API architecture.

Requirements

  • Node.js: 22.x
  • pnpm: 10.28.0

Node.js Setup

Install and set Node.js 22 as default using nvm:

nvm install 22 && nvm alias default 22

Quick Start

pnpm install pnpm dev

Commands

Development

  • pnpm dev - Start all apps in development mode (see Development Workflow)
  • pnpm build - Build all apps and packages
  • pnpm lint - Lint all code (Biome + ESLint)
  • pnpm format - Format all code (Biome)
  • pnpm checktypes - Type check all TypeScript
  • pnpm test - Run all tests
  • pnpm qa - Quality assurance: install dependencies, lint, type-check, build, and test everything

Development Workflow

Turborepo Setup

This monorepo uses Turborepo for task orchestration and caching. Turborepo provides:

  • Intelligent caching - Only rebuilds what changed
  • Parallel execution - Runs independent tasks simultaneously
  • Task dependencies - Ensures correct build order
  • Remote caching - Share cache across team and CI/CD

pnpm dev - Development Mode

The pnpm dev command starts all development servers with watch mode:

pnpm dev

This runs:

  • @repo/core - Watches for OpenAPI changes and regenerates API client
  • @repo/react - Watches for OpenAPI changes and regenerates React hooks, watches TypeScript for rebuilds
  • @repo/error - Watches TypeScript for rebuilds
  • @repo/utils - Watches TypeScript for rebuilds
  • @repo/fastify - Starts Fastify API server with OpenAPI generation watcher
  • @repo/next - Starts Next.js development server

Key Features:

  • Watch mode - All packages automatically rebuild when source files change
  • OpenAPI regeneration - core and react packages watch for OpenAPI spec changes and regenerate clients
  • Hot reload - Next.js and Fastify support hot module replacement

pnpm qa - Quality Assurance

The pnpm qa command runs a complete quality check:

pnpm qa

This executes:

  1. pnpm i - Install/update dependencies
  2. pnpm lint:fix - Auto-fix linting issues (ESLint + Biome)
  3. turbo run checktypes build test - Type-check, build, and test all packages (excluding contracts)

Use Cases:

  • Before committing changes
  • Before opening a pull request
  • In CI/CD pipelines
  • When verifying the entire codebase

Running Individual Apps

You can run individual apps directly, but remember to build dependencies first:

# Build required packages pnpm build --filter=@repo/core --filter=@repo/react --filter=@repo/error --filter=@repo/utils # Then run the app cd apps/next pnpm dev

See individual app READMEs (e.g., apps/next/README.md) for app-specific instructions.

Security

  • pnpm secrets:scan:staged - Scan staged files for secrets (gitleaks)
  • pnpm secrets:scan - Scan entire repository for secrets (gitleaks)
  • pnpm deps:osv - Scan dependencies for vulnerabilities (OSV Scanner)
  • pnpm deps:audit - Run pnpm audit for dependency vulnerabilities

CI/CD Workflows

GitHub Actions workflows automate quality checks:

Lint Workflow (.github/workflows/lint.yml)

Runs on all pull requests to ensure code quality:

  • Executes pnpm lint (Biome + ESLint)
  • Catches linting errors before merge
  • Can be manually triggered via workflow_dispatch

Security Workflow (.github/workflows/security.yml)

Runs on all pull requests and pushes to main:

  • Secret scanning - Scans repository with gitleaks and TruffleHog
  • Dependency scanning - Checks for vulnerabilities with OSV Scanner and pnpm audit
  • Git history scan - Scans entire git history for exposed secrets
  • All checks must pass for CI to succeed

See Security Guide for complete details.

Structure

  • apps/ - Applications (API, Web, Docs)
  • packages/ - Shared packages (core, react, ui, utils)
  • devtools/ - Shared development tooling (eslint, react, typescript configs)

Documentation

Full documentation: https://basilic-docs.vercel.app/docs

Get Started

Core Concepts

Guides

Cursor Setup

Deep Dives

五维分析
清晰度8/10
创新性7/10
实用性9/10
完整性8/10
可维护性9/10
优缺点分析

优点

  • 支持现代开发实践。
  • 使用 Turborepo 进行高效的任务编排。
  • 全面的质量保证工作流程。

缺点

  • 需要熟悉单体仓库结构。
  • 依赖特定的 Node.js 版本。
  • 初始设置对新手可能较复杂。

相关技能

openai-agents-js

A
toolCo-Pilot / 辅助式
84/ 100

“看起来很能打,但别让配置把人劝退。”

mastra

A
toolCode Lib / 代码库
84/ 100

“这是 AI 智能体的瑞士军刀,但你需要一本说明书才能搞清楚哪片刀片是用来切 LLM 的,哪片是用来撬开顽固的工作流的。”

inferred-types

B
toolCo-Pilot / 辅助式
78/ 100

“这就像 TypeScript 的瑞士军刀,但刀片更少,类型安全性更高。”

免责声明:本内容来源于 GitHub 开源项目,仅供展示和评分分析使用。

版权归原作者所有 blockmatic.