项目结构
🌐 Project structure
Strapi 项目的结构取决于项目是使用 TypeScript(如果你在创建项目时使用了 --quickstart 选项,这将是默认选项)还是使用普通 JavaScript 创建的,其结构如下所示:
🌐 The structure of a Strapi project depends on whether the project was created with TypeScript (which is the default if you used the --quickstart option while creating the project) or with vanilla JavaScript, and looks like the following:
- TypeScript-based projects
- JavaScript-based projects
The following diagram is interactive: you can click on any file or folder name highlighted in purple to go to the corresponding documentation page.
. # root of the application
├──── .strapi # auto-generated folder — do not update manually
│ └──── client # files used by bundlers to render the application
│ ├ index.html
│ └ app.js
├──── .tmp
├──── config # API configurations
│ ├ admin.ts
│ ├ api.ts
│ ├ cron-tasks.ts # optional, only if you created CRON tasks
│ ├ database.ts
│ ├ middlewares.ts
│ ├ plugins.ts
│ └ server.ts
├──── database
│ └──── migrations
├──── dist # build of the backend
│ └──── build # build of the admin panel
├──── node_modules # npm packages used by the project
├──── public # files accessible to the outside world
│ ├──── uploads
│ └ robots.txt
├──── src