Fullstack Turborepo Starter 项目教程

Fullstack Turborepo Starter 项目教程

fullstack-turborepo-starterFullstack Turborepo starter. Typescript, Nestjs, Nextjs, Tailwind, Prisma, Github Actions, Docker, And Reverse proxy configured项目地址:https://gitcode.com/gh_mirrors/fu/fullstack-turborepo-starter

1. 项目的目录结构及介绍

fullstack-turborepo-starter/
├── apps/
│   ├── api/
│   └── web/
├── packages/
│   ├── config/
│   ├── eslint-config-custom/
│   ├── tsconfig/
│   └── ui/
├── turbo.json
└── README.md
  • apps/: 包含项目的两个主要应用,apiweb

    • api/: 后端服务目录,包含 API 相关的代码。
    • web/: 前端服务目录,包含 Web 应用相关的代码。
  • packages/: 包含共享的配置和组件。

    • config/: 共享的配置文件。
    • eslint-config-custom/: 自定义的 ESLint 配置。
    • tsconfig/: 共享的 TypeScript 配置。
    • ui/: 共享的 UI 组件。
  • turbo.json: Turborepo 的配置文件,用于管理构建和部署流程。

  • README.md: 项目说明文档。

2. 项目的启动文件介绍

apps/apiapps/web 目录中,分别有启动文件用于启动后端和前端服务。

  • apps/api/src/index.ts: 后端服务的入口文件,负责启动 API 服务器。
  • apps/web/src/index.tsx: 前端服务的入口文件,负责启动 React 应用。

3. 项目的配置文件介绍

  • turbo.json: 这是 Turborepo 的核心配置文件,定义了项目的构建和部署流程。
{
  "pipeline": {
    "build": {
      "dependsOn": ["^build"]
    },
    "test": {
      "dependsOn": ["build"]
    },
    "lint": {},
    "deploy": {
      "dependsOn": ["build", "test", "lint"]
    }
  }
}
  • packages/tsconfig/base.json: 共享的 TypeScript 配置文件,定义了 TypeScript 编译选项。
{
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "es2015"],
    "module": "commonjs",
    "moduleResolution": "node",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["**/*.ts", "**/*.tsx"]
}
  • packages/eslint-config-custom/index.js: 自定义的 ESLint 配置文件,定义了代码风格和检查规则。
module.exports = {
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:react/recommended',
    'plugin:react-hooks/recommended'
  ],
  parser: '@typescript-eslint/parser',
  plugins: ['@typescript-eslint', 'react', 'react-hooks'],
  rules: {
    // 自定义规则
  }
};

通过以上配置文件,项目可以实现统一的代码风格和构建流程,提高开发效率和代码质量。

fullstack-turborepo-starterFullstack Turborepo starter. Typescript, Nestjs, Nextjs, Tailwind, Prisma, Github Actions, Docker, And Reverse proxy configured项目地址:https://gitcode.com/gh_mirrors/fu/fullstack-turborepo-starter

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

吕岚伊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值